I have noticed that the Click event, or other control behaviour, is not always fired when a control contained in a ScrollableControl (Panel, etc) is clicked on.
If the control being clicked doesn't have the focus and is only partially visible it is scrolled into view. This is what I am expecting, however the Click event doesn't get fired or other control behaviour doesn't occur.
If the control already has the focus and is only partially visible the events do get fired.
Checkbox - Scrolls into view, checked state does not change. CheckedListBox - Scrolls into view, clicked item does not get selected. TreeView - Scrolls into view, clicked node does not get selected. Button - Scrolls into view, click event does not get raised.
To reproduce this you can do the following:
- Add any of the above controls to a Panel
- Add an event handler for Click, SelectedItemChanged, etc
- Resize the form so that scrollbars are visible on the panel
- Scroll the panel so one of the controls is partially visible
- Click the partially visible control
Is there any way to ensure the events get fired?