Click here to Skip to main content
15,914,162 members
Home / Discussions / C#
   

C#

 
GeneralRe: Use GAC Assembly. Pin
Rahul.RK1-Feb-07 19:14
Rahul.RK1-Feb-07 19:14 
QuestionHow to capture mouse enter event while left mouse button is clicked? Pin
Alvaro Enriquez30-Jan-07 21:18
Alvaro Enriquez30-Jan-07 21:18 
AnswerRe: How to capture mouse enter event while left mouse button is clicked? Pin
Mircea Puiu31-Jan-07 0:34
Mircea Puiu31-Jan-07 0:34 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Alvaro Enriquez31-Jan-07 1:31
Alvaro Enriquez31-Jan-07 1:31 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Mircea Puiu31-Jan-07 2:35
Mircea Puiu31-Jan-07 2:35 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Martin#31-Jan-07 2:49
Martin#31-Jan-07 2:49 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Mircea Puiu31-Jan-07 3:32
Mircea Puiu31-Jan-07 3:32 
QuestionRe: How to capture mouse enter event while left mouse button is clicked? Pin
Alvaro Enriquez31-Jan-07 3:55
Alvaro Enriquez31-Jan-07 3:55 
What you are suggesting works in the case you click the left button in the main form, outside the pictureboxes. If you create two pictureboxes: picturebox1 and picturebox2 in your form and assign picturebox1 the mousedown event and the whole form the mousemove event you proposed,you will reproduce my problem. What I want is: clicking in area of the picturebox and holding the button pressed (drag, if you prefer), go to the area of the picturebox2 and obtain the message: "I have gone from 1 to 2" while my mouse button is still pressed.

I hope the code below clarify the issue.

int origin=0;
int target=0;

private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
Point pt = pictureBox2.PointToClient(Cursor.Position);
Rectangle rc = pictureBox2.ClientRectangle;
if (rc.Contains(pt))
{
target = 2;
// Do what you wanted to do within the MouseEnter event handler
MessageBox.Show("I have gone from " + origin + " to " + target);
}
}
}

private void pictureBox1_MouseDown(object sender, MouseEventArgs e)
{
origin = 1;
}


Any ideas? Thank you for all your efforts!
AnswerRe: How to capture mouse enter event while left mouse button is clicked? Pin
Mircea Puiu31-Jan-07 4:59
Mircea Puiu31-Jan-07 4:59 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Martin#31-Jan-07 10:46
Martin#31-Jan-07 10:46 
GeneralRe: How to capture mouse enter event while left mouse button is clicked? Pin
Alvaro Enriquez31-Jan-07 23:15
Alvaro Enriquez31-Jan-07 23:15 
AnswerRe: How to capture mouse enter event while left mouse button is clicked? Pin
Alvaro Enriquez1-Feb-07 0:31
Alvaro Enriquez1-Feb-07 0:31 
QuestionAlgorithm for encryption and Connect Pin
zanele sibongile30-Jan-07 21:18
zanele sibongile30-Jan-07 21:18 
Question"Window class name is not valid. " in designer Pin
Christian Graus30-Jan-07 20:47
protectorChristian Graus30-Jan-07 20:47 
AnswerRe: "Window class name is not valid. " in designer Pin
Martin#30-Jan-07 21:15
Martin#30-Jan-07 21:15 
QuestionRe: "Window class name is not valid. " in designer Pin
Seishin#30-Jan-07 21:17
Seishin#30-Jan-07 21:17 
AnswerRe: "Window class name is not valid. " in designer Pin
Martin#30-Jan-07 21:24
Martin#30-Jan-07 21:24 
GeneralRe: "Window class name is not valid. " in designer Pin
Seishin#30-Jan-07 21:31
Seishin#30-Jan-07 21:31 
GeneralRe: "Window class name is not valid. " in designer Pin
Christian Graus30-Jan-07 22:01
protectorChristian Graus30-Jan-07 22:01 
GeneralRe: "Window class name is not valid. " in designer Pin
Martin#30-Jan-07 22:26
Martin#30-Jan-07 22:26 
GeneralRe: "Window class name is not valid. " in designer Pin
engsrini31-Jan-07 3:30
engsrini31-Jan-07 3:30 
AnswerRe: "Window class name is not valid. " in designer Pin
Seishin#30-Jan-07 21:15
Seishin#30-Jan-07 21:15 
AnswerRe: "Window class name is not valid. " in designer Pin
Luc Pattyn31-Jan-07 9:03
sitebuilderLuc Pattyn31-Jan-07 9:03 
GeneralRe: "Window class name is not valid. " in designer Pin
Christian Graus31-Jan-07 9:22
protectorChristian Graus31-Jan-07 9:22 
GeneralRe: "Window class name is not valid. " in designer Pin
Luc Pattyn31-Jan-07 9:25
sitebuilderLuc Pattyn31-Jan-07 9:25 

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.