本文整理汇总了VB.NET中System.Windows.Forms.ToolBarButtonClickEventArgs类的典型用法代码示例。如果您正苦于以下问题:VB.NET ToolBarButtonClickEventArgs类的具体用法?VB.NET ToolBarButtonClickEventArgs怎么用?VB.NET ToolBarButtonClickEventArgs使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了ToolBarButtonClickEventArgs类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的VB.NET代码示例。
示例1: InitializeMyToolBar
Public Sub InitializeMyToolBar()
' Create and initialize the ToolBar and ToolBarButton controls.
Dim toolBar1 As New ToolBar()
Dim toolBarButton1 As New ToolBarButton()
Dim toolBarButton2 As New ToolBarButton()
Dim toolBarButton3 As New ToolBarButton()
' Set the Text properties of the ToolBarButton controls.
toolBarButton1.Text = "Open"
toolBarButton2.Text = "Save"
toolBarButton3.Text = "Print"
' Add the ToolBarButton controls to the ToolBar.
toolBar1.Buttons.Add(toolBarButton1)
toolBar1.Buttons.Add(toolBarButton2)
toolBar1.Buttons.Add(toolBarButton3)
' Add the event-handler delegate.
AddHandler toolBar1.ButtonClick, AddressOf Me.toolBar1_ButtonClick
' Add the ToolBar to the Form.
Controls.Add(toolBar1)
End Sub
Private Sub toolBar1_ButtonClick(ByVal sender As Object, _
ByVal e As ToolBarButtonClickEventArgs)
' Evaluate the Button property to determine which button was clicked.
Select Case toolBar1.Buttons.IndexOf(e.Button)
Case 0
openFileDialog1.ShowDialog()
' Insert code to open the file.
Case 1
saveFileDialog1.ShowDialog()
' Insert code to save the file.
Case 2
printDialog1.ShowDialog()
' Insert code to print the file.
End Select
End Sub