关于TabControl 的Selected 事件触发问题
frmTabControlSelected 里增加了了TabControl 控件。在另外一个Form里创建这个form并且打开它发现TabControl1.SelectedTab 设置了后 Selected事件不触发。
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New frmTabControlSelected
frm.TabControl1.SelectedTab = frm.TabPage2
frm.Show()
End Sub
把Form.Show和frm.TabControl1.SelectedTab 的顺序换了一下就触发了。。。
Code
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim frm As New frmTabControlSelected
frm.Show()
frm.TabControl1.SelectedTab = frm.TabPage2
End Sub