PowerTools InputMan for ASP.NET 8.0J
SelectedIndexChanged イベント (GcComboBox)
使用例 

SelectedIndexプロパティが変更されたときに発生します。
構文
Public Event SelectedIndexChanged As EventHandler
public event EventHandler SelectedIndexChanged
解説
SelectedIndexChangedイベントを使用すると、コンボコントロール内で選択されているインデックスがいつ変更されたかを検出できます。

なお、このイベントは、次のいずれかの場合に発生します。
使用例
次のサンプルコードは、選択項目が変更されたときにその内容を取得します。
Private Sub GcComboBox1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles GcComboBox1.SelectedIndexChanged
    If GcComboBox1.SelectedIndex = -1 Then Return
    Label1.Text = GcComboBox1.Items(GcComboBox1.SelectedIndex).Text.ToString()
End Sub
private void GcComboBox1_SelectedIndexChanged(object sender, System.EventArgs e)
{
    if (GcComboBox1.SelectedIndex == -1) return;
    label1.Text = GcComboBox1.Items[GcComboBox1.SelectedIndex].Text.ToString();
}
参照

GcComboBox クラス
GcComboBox メンバ

 

 


© 2005-2015 GrapeCity inc. All rights reserved.