What you need to do is create a class that inherits ToolStrip and processes WndProc . This is one way to do this. There are others.
private class MyToolStrip : ToolStrip { private const uint WM_LBUTTONDOWN = 0x201; private const uint WM_LBUTTONUP = 0x202; private static bool down = false; protected override void WndProc(ref Message m) { if (m.Msg == WM_LBUTTONUP && !down) { m.Msg = (int)WM_LBUTTONDOWN; base.WndProc(ref m); m.Msg = (int)WM_LBUTTONUP; } if (m.Msg == WM_LBUTTONDOWN) down = true; if (m.Msg == WM_LBUTTONUP) down = false; base.WndProc(ref m); } }
I also saw this solution:
protected override void WndProc(ref Message m) {
I came across this at the last place of work, I think that the solution that I came up with was more like the last, but I do not have access to the exact code that I used.
dwidel
source share