2009-04-20 00:21 UTC
To the best of my knowledge, the OnSelChanging event only fires when the user selects a new tab on the TabStrip. Also the OnChanged event fires on form show, preselecting first tab. Placing dcl_TabStrip_SetCurSel in OnIntialize allows a different tab to show on form show. The result being OnChanged event is fired twice.
It makes sense to call OnSelChanging when a user tries to pick a new tab; forcing some action be done before the change, and perhaps permanently saving the control data somewhere else.
I was thinking that to be consistent the OnSelChanging event should always fire if defined regardless of how the tab is changed, since dcl_TabStrip_SetCurSel accomplishes the same as picking a tab. But now I am thinking that would mean an unnecessary event call when the programmer already has control of the tab.
Comments encouraged.
Jim
It makes sense to call OnSelChanging when a user tries to pick a new tab; forcing some action be done before the change, and perhaps permanently saving the control data somewhere else.
I was thinking that to be consistent the OnSelChanging event should always fire if defined regardless of how the tab is changed, since dcl_TabStrip_SetCurSel accomplishes the same as picking a tab. But now I am thinking that would mean an unnecessary event call when the programmer already has control of the tab.
Comments encouraged.
Jim