Private Sub ToolBar1_ButtonClick()Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Select Case e.Button.Text
Case "OK" @#"OK" is ToolBarButton.Text
Dim fr As New frmName
fr.MdiParent = Me @#Me is MdiForm
fr.Show()
End Select
End Sub
http://www.chinaaspx.com/club/topic_5_7796.htm
参考了一下,得出下面的代码
Private Shared fr As New frmName
Private Sub ToolBar1_ButtonClick()Sub ToolBar1_ButtonClick(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ToolBarButtonClickEventArgs) Handles ToolBar1.ButtonClick
Select Case e.Button.Text
Case "OK" @#"OK" is ToolBarButton.Text
If fr Is Nothing Or fr.IsDisposed Then
fr = New frmName
fr.MdiParent = Me
fr.Show()
Else
fr.MdiParent = Me
fr.Show()
fr.Focus()
End If
End Select
End Sub
这样就实例了一次窗体~ ---end---
延伸阅读
文章来源于领测软件测试网 https://www.ltesting.net/