I am writing a custom control in .NET Windows Forms. Consider the following code:
protected override void WndProc(ref Message m)
{
base.WndProc(ref m);
switch(m.Msg)
{
case WM_LBUTTONDOWN: // Yes, it's defined correctly.
MessageBox.Show("Left Button Down");
break;
}
}
It works when running, but I need it to work in the designer. How can I achieve this?
NOTE:
I guess someone might say that "You can't detect clicks in the designer because the design surface captures them and processes them as part of the design process"
...Take for example the TabControl
. When you add a new tab, you can click to navigate through the tabs, and then click the tab's designable area to begin designing the tab page's content. How does that work?