'************************************************************************************
' フォーム起動のテスト
'************************************************************************************
Public Class Form1
' Load起動スイッチ
Private g_swLoaded As Boolean = False ' 初期値はFalse
'********************************************************************************
' Loadイベント
'********************************************************************************
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
' Loadイベントの再起動判定
If g_swLoaded Then
MessageBox.Show("Loadイベントが再起動されました。")
End If
' Load起動スイッチにTrueをセット
g_swLoaded = True
End Sub
'--------------------------------<< End of Source >>-----------------------------
End Class
'************************************************************************************
' フォーム起動のテスト
'************************************************************************************
Public Class Form1
' Load起動スイッチ
Private g_swLoaded As Boolean = False ' 初期値はFalse
'********************************************************************************
' ComboBox_SelectedIndexChangedイベント(集合)
'********************************************************************************
Private Sub ComboBox_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs)
' テスト
Dim strName As String = sender.Name
MessageBox.Show(strName & " " & sender.Text)
End Sub
'********************************************************************************
' Loadイベント
'********************************************************************************
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
' Loadイベントの再起動判定
If g_swLoaded Then
MessageBox.Show("Loadイベントが再起動されました。")
End If
' Load起動スイッチにTrueをセット
g_swLoaded = True
'----------------------------------------------------------------------------
' ComboBox1のリストセット
Dim tblList() As String = New String() {"あああ", "いいい", "ううう"}
ComboBox1.Items.AddRange(tblList)
' ComboBox2のリストセット
tblList = New String() {"かかか", "ききき", "くくく"}
ComboBox2.Items.AddRange(tblList)
' ComboBox3のリストセット
tblList = New String() {"さささ", "ししし", "すすす"}
ComboBox3.Items.AddRange(tblList)
'----------------------------------------------------------------------------
' イベントハンドラに関連付け(SelectedIndexChanged)
AddHandler ComboBox1.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
AddHandler ComboBox2.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
AddHandler ComboBox3.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
End Sub
'--------------------------------<< End of Source >>-----------------------------
End Class
'************************************************************************************
' フォーム起動のテスト
'************************************************************************************
Public Class Form1
' Load起動スイッチ
Private g_swLoaded As Boolean = False ' 初期値はFalse
'********************************************************************************
' ComboBox_SelectedIndexChangedイベント(集合)
'********************************************************************************
Private Sub ComboBox_SelectedIndexChanged(ByVal sender As Object, _
ByVal e As System.EventArgs)
' テスト
Dim strName As String = sender.Name
MessageBox.Show(strName & " " & sender.Text)
End Sub
'********************************************************************************
' Loadイベント
'********************************************************************************
Private Sub Form1_Load(ByVal sender As Object, _
ByVal e As System.EventArgs) Handles Me.Load
' Loadイベントの初回起動判定
If g_swLoaded <> True Then
'------------------------------------------------------------------------
' Load起動スイッチにTrueをセット
g_swLoaded = True
'------------------------------------------------------------------------
' ComboBox1のリストセット
Dim tblList() As String = New String() {"あああ", "いいい", "ううう"}
ComboBox1.Items.AddRange(tblList)
' ComboBox2のリストセット
tblList = New String() {"かかか", "ききき", "くくく"}
ComboBox2.Items.AddRange(tblList)
' ComboBox3のリストセット
tblList = New String() {"さささ", "ししし", "すすす"}
ComboBox3.Items.AddRange(tblList)
'------------------------------------------------------------------------
' イベントハンドラに関連付け(SelectedIndexChanged)
AddHandler ComboBox1.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
AddHandler ComboBox2.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
AddHandler ComboBox3.SelectedIndexChanged, _
AddressOf Me.ComboBox_SelectedIndexChanged
End If
End Sub
'--------------------------------<< End of Source >>-----------------------------
End Class