Unexpected events are raised when you switch between tab pages with a ComboBox or a ListBox control (820633)
The information in this article applies to:
- Microsoft Visual Basic 2005
- Microsoft Visual Basic .NET (2003)
- Microsoft Visual Basic .NET (2002)
- Microsoft Visual C# .NET (2003)
- Microsoft Visual C# .NET (2002)
SYMPTOMSYou add a ListBox control or a ComboBox control to the TabPage property of
the TabControl control. When you switch between the tab pages of the TabControl,
the BindingContextChanged event of the ComboBox or of the ListBox is raised. When you bind
the ListBox or the ComboBox to a Datasource property and then switch between the
tab pages, the BindingContextChanged event, the SelectedValueChanged event, and the SelectedIndexChanged event of the control are raised.
Note In Microsoft Visual Studio .NET 2003, when you bind the ListBox
or the ComboBox to a Datasource property and then switch between the tab pages, the BindingContextChanged event and the SelectedValueChanged event of the control are raised.CAUSEWhen you select a particular TabPage property on the TabControl, the Visible property of the TabPage property is set to true, and the SetVisibleCore(True) method
is called. This method calls the Control.CreateControl method. The
Control.CreateControl method calls the OnBindingContextChanged method. The OnBindingContextChanged method call is at the root of the SelectedValueChanged call,
the SelectedIndexChanged call, and the BindingContextChanged call. As a result, the SelectedValueChanged event, the BindingContextChanged event, and the SelectedIndexChanged event are
raised.STATUS This
behavior is by design.REFERENCESFor more information about the ListBox control, visit the following Microsoft Developer Network (MSDN) Web
site:
Modification Type: | Minor | Last Reviewed: | 10/3/2006 |
---|
Keywords: | kbvs2005swept kbvs2005applies kbEvent kbDataBinding kbTabCtrl kbListBox kbCtrl kbControl kbComboBox kbprb KB820633 kbAudDeveloper |
---|
|