Click here to Skip to main content
15,919,774 members
Home / Discussions / C#
   

C#

 
QuestionHow to write to file using FileStream class Pin
Chintan.Desai19-Jul-07 20:12
Chintan.Desai19-Jul-07 20:12 
AnswerRe: How to write to file using FileStream class Pin
Michael Sync19-Jul-07 20:33
Michael Sync19-Jul-07 20:33 
GeneralRe: How to write to file using FileStream class Pin
Chintan.Desai19-Jul-07 23:30
Chintan.Desai19-Jul-07 23:30 
AnswerRe: How to write to file using FileStream class Pin
Rudolf Jan20-Jul-07 7:12
Rudolf Jan20-Jul-07 7:12 
Questionbinding combo box with array Pin
monuSaini19-Jul-07 20:08
monuSaini19-Jul-07 20:08 
AnswerRe: binding combo box with array Pin
Michael Sync19-Jul-07 20:30
Michael Sync19-Jul-07 20:30 
GeneralRe: binding combo box with array Pin
monuSaini19-Jul-07 20:39
monuSaini19-Jul-07 20:39 
Questiondetect mouseclick in an area Pin
cyn819-Jul-07 19:34
cyn819-Jul-07 19:34 
Below are parts of the code that i've done, However, it does not detect the mousedown over the area or the rectangle or ellipse. Where did i do the mistake? Can anybody help?

Thanks

public class Form1 : System.Windows.Forms.Form
{
private System.Drawing.Bitmap m_objDrawingSurface;
///
/// Required designer variable.
///

private System.ComponentModel.Container components = null;

Graphics objGraphics;
Rectangle rectBounds;
Rectangle rectangle=new Rectangle(0,10,50,50);
Rectangle ellipse=new Rectangle(100,10,50,50);
private Point mouse_pos;

.................................................................



private void Form1_MouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{

Point current_pos = Control.MousePosition;
mouse_pos.X = e.X;
mouse_pos.Y = e.Y;
if (rectangle.Contains(current_pos.X,current_pos.Y ))
{ MessageBox.Show("Detect rectangle", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}

else if (ellipse.Contains(current_pos.X,current_pos.Y ))
{MessageBox.Show("Detect ellipse", "Info", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);}


else

return;


}
Edit/Delete Message
AnswerRe: detect mouseclick in an area Pin
Christian Graus19-Jul-07 19:42
protectorChristian Graus19-Jul-07 19:42 
GeneralRe: detect mouseclick in an area Pin
cyn819-Jul-07 19:53
cyn819-Jul-07 19:53 
GeneralRe: detect mouseclick in an area Pin
Martin#19-Jul-07 20:05
Martin#19-Jul-07 20:05 
AnswerRe: detect mouseclick in an area Pin
Martin#19-Jul-07 19:53
Martin#19-Jul-07 19:53 
GeneralRe: detect mouseclick in an area Pin
cyn819-Jul-07 19:57
cyn819-Jul-07 19:57 
Questionproblem with SQL server Pin
prasadbuddhika19-Jul-07 19:21
prasadbuddhika19-Jul-07 19:21 
AnswerRe: problem with SQL server Pin
originSH19-Jul-07 21:55
originSH19-Jul-07 21:55 
QuestionCustom Tab Control Pin
T.EDY19-Jul-07 16:50
T.EDY19-Jul-07 16:50 
AnswerRe: Custom Tab Control Pin
Martin#19-Jul-07 19:15
Martin#19-Jul-07 19:15 
QuestionSocket communication (Winsock), interop ... Pin
devvvy19-Jul-07 15:30
devvvy19-Jul-07 15:30 
AnswerRe: Socket communication (Winsock), interop ... Pin
originSH19-Jul-07 21:59
originSH19-Jul-07 21:59 
GeneralRe: Socket communication (Winsock), interop ... Pin
devvvy20-Jul-07 3:15
devvvy20-Jul-07 3:15 
GeneralRe: Socket communication (Winsock), interop ... Pin
originSH20-Jul-07 4:10
originSH20-Jul-07 4:10 
GeneralRe: Socket communication (Winsock), interop ... Pin
devvvy20-Jul-07 22:31
devvvy20-Jul-07 22:31 
GeneralRe: Socket communication (Winsock), interop ... Pin
originSH23-Jul-07 12:10
originSH23-Jul-07 12:10 
AnswerRe: Socket communication (Winsock), interop ... Pin
pbraun20-Jul-07 9:12
pbraun20-Jul-07 9:12 
GeneralRe: Socket communication (Winsock), interop ... Pin
devvvy24-Jul-07 5:26
devvvy24-Jul-07 5:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.