TedZhao

UseCase1:

- Press mouse left button on windows form control

- Don't move mouse and release the left button

The mouse message will be "WM_MouseDown", "WM_MouseUP", "WM_MouseCaptureChanged" and "WM_MouseMove"

Why does control receive the last receive message

UseCase2:

- Write a custom control inherit from system control

- Override WndProc function, adn write the following code:
public class MyControl2 : Control
{
protected override void WndProc(ref Message m)
{

//WM_LButtonUp message
if (m.Msg == 0x202)
{
return;
}

base.WndProc(ref m);
}

}

- Repeat the action in usecase1

the mouse message will be "WM_MouseDown", "WM_MouseUP",

Why does the last MouseMove message disappaer




Re: Windows Forms General About MouseMove message

nobugz

You get the MouseMove message because the mouse capture was released. In the 2nd case, you don't give it a chance to detect MouseUp so it won't release the capture.