SelectionChanged事件

套用至
TabControl, Wizard

說明
在重新選擇頁面時執行的事件。

使用方式

Form_Control_SelectionChanged(Sender$ As String, SelectedIndex As Integer, PreviousIndex As Integer)
Sender$
被設定為引發事件的控制項名稱。
SelectedIndex
所選擇的頁面的索引編號。
PreviousIndex
之前選擇的頁面的索引編號。

數值
傳回所選項目的索引,從0開始。若未選擇項目則會傳回 -1。

備註
使用SelectedIndex判斷使用者已在清單方塊或下拉式方塊中,選擇何種項目。一般而言,您會在控制項的點選事件中進行此動作。

另請參閱
標籤控制項 , 精靈控制項

範例

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