SelectionChanged事件
适用范围
TabControl, Wizard
描述
是选中页面被变更时执行的事件。
使用
Form_Control_SelectionChanged(Sender$ As String, SelectedIndex As Integer, PreviousIndex As Integer)
- Sender$
- 被设置为引发事件的控件的名称。
- SelectedIndex
- 是选中页面的索引编号。
- PreviousIndex
- 是此前选中页面的索引编号。
数值
返回以0开头且为整数的选定项目编号。如果未选定项目,则会返回-1。
备注
使用SelectedIndex可确定用户在列表框或组合框中选定的项目。通常,会在控件的Click事件中完成。
示例
Function frmMain_TabControl1_SelectionChanged(Sender$ As String, SelectedIndex As Integer, PreviousIndex As Integer)
Print "The TabControl selection was changed to ", Str$(SelectedIndex), " from ", Str$(PreviousIndex)
Fend