Hi Adam,
The only way I can think of is to create message filter and screen off the
mouse messages.
1. Add IMessageFilter interface to the list of interfaces implemented by the
form
public class MyForm: Form, IMessageFilter
{
.....
}
2. In form constructor add the following line
Application.AddMessageFilter(this);
3. Implement the IMessageFilter's only member in the form's class
Something like
public bool PreFilterMessage(ref Message m)
{
Control ctrl = Control.FromHandle(m.HWnd);
if(ctrl != null && (ctrl == this || this.Contains(ctrl))))
{
switch(m.Msg)
{
case 0x0201: //0x0201 is the constant value for
WM_LBUTTONDOWN. For more constants see winuser.h
///Do something when the left-mouse button is down
break
case .....
break
}
}
return false;
}
HTH
B\rgds
100