The WinForms GroupBox control doesn't support MouseMove (or at least, not consistently), and I don't understand why.
Since it descends from Control, it does have a MouseMove event, but GroupBox explicitly reintroduces it with Browsable(false)
, so it's not shown in the Property Grid. You can hook the MouseMove event at runtime, and sometimes it works -- as long as FlatStyle is left at Standard. If the GroupBox's FlatStyle is set to System, then no MouseMove events are fired at all.
Reflector hasn't given me any clues. The GroupBox constructor doesn't seem to be setting any strange control styles, and GroupBox doesn't do anything silly like override MouseMove and fail to call base.
This also appears to be a WinForms-specific limitation, because Delphi group boxes support OnMouseMove just fine. Correction: the comparison to Delphi isn't valid. Delphi group boxes aren't actually standard BM_GROUPBOX controls; they're just painted to look like group boxes, without actually inheriting strange groupbox behaviors like this. So this may well be a limitation of the Windows groupbox control, though I haven't seen it documented anywhere.
Why does the WinForms GroupBox not support MouseMove?