|
I've come across what I think is a bug in with the TreeView control and how the AfterSelect event appears to take control of the event queue by placing itself higher than other events.
Situation: 1. Focus is currently on TextBox control. 2. User clicks on a different (than the currently selected node) child node in TreeView.
The following events occur in this order:
TreeView_AfterSelect TextBox_Leave
I would expect the order to be reversed because one must LEAVE the textbox before one can trigger an TreeView event.
I tested my findings with other controls (ListBox, ComboBox, Buttons, etc.) and in those cases the event sequence is:
TextBox_Leave OtherControls_Click (or appropriate event for that control)
It appears that TreeView is the ONLY control that seems able to somehow change the event sequence. (CauseValidation is set to True on all controls which should not have any significance with the TextBox_Leave, but thought I just add that info). I also changed the TabOrder but that had no affect.
Can anyone else confirm this problem? or Feature? ;)
To reproduce just create a Form, add a TreeView, add a TextBox, populate TreeView with some nodes & child nodes. Place a*space space*point in the TreeView_AfterSelect and place another*space space*point in the TextBox_Leave. Run the application, place your cursor in the TextBox (with Mouse), then click on a child node (different that current) in the TreeView.
Thanks,
Mike |