本文整理匯總了VB.NET中System.Windows.Forms.ToolStripButton類的典型用法代碼示例。如果您正苦於以下問題:VB.NET ToolStripButton類的具體用法?VB.NET ToolStripButton怎麽用?VB.NET ToolStripButton使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了ToolStripButton類的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的VB.NET代碼示例。
示例1: Form1
' 導入命名空間
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Windows.Forms
Public Class Form1
Inherits Form
Private WithEvents toolStripButton1 As ToolStripButton
Private WithEvents toolStripButton2 As ToolStripButton
Private toolStrip1 As ToolStrip
Public Sub New()
InitializeComponent()
End Sub
<STAThread()> _
Shared Sub Main()
Application.EnableVisualStyles()
Application.Run(New Form1())
End Sub
Private Sub InitializeComponent()
Me.toolStrip1 = New System.Windows.Forms.ToolStrip()
Me.toolStripButton1 = New System.Windows.Forms.ToolStripButton()
Me.toolStripButton2 = New System.Windows.Forms.ToolStripButton()
Me.toolStrip1.SuspendLayout()
Me.SuspendLayout()
'
' toolStrip1
'
Me.toolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripButton1, Me.toolStripButton2})
Me.toolStrip1.Location = New System.Drawing.Point(0, 0)
Me.toolStrip1.Name = "toolStrip1"
Me.toolStrip1.TabIndex = 0
Me.toolStrip1.Text = "toolStrip1"
'
' toolStripButton1
Me.toolStripButton1.Image = Bitmap.FromFile("c:\NewItem.bmp")
Me.toolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText
Me.toolStripButton1.ImageAlign = System.Drawing.ContentAlignment.MiddleLeft
Me.toolStripButton1.Name = "toolStripButton1"
Me.toolStripButton1.Text = "&New"
Me.toolStripButton1.TextAlign = System.Drawing.ContentAlignment.MiddleRight
' toolStripButton2
'
Me.toolStripButton2.Image = Bitmap.FromFile("c:\OpenItem.bmp")
Me.toolStripButton2.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.ImageAndText
Me.toolStripButton2.Name = "toolStripButton2"
Me.toolStripButton2.Text = "&Open"
'
' Form1
'
Me.ClientSize = New System.Drawing.Size(292, 273)
Me.Controls.Add(toolStrip1)
Me.Name = "Form1"
Me.toolStrip1.ResumeLayout(False)
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Private Sub toolStripButton1_Click(sender As Object, e As EventArgs) Handles toolStripButton1.Click
MessageBox.Show("You have mail.")
End Sub
Private Sub toolStripButton2_Click(sender As Object, e As EventArgs) Handles toolStripButton2.Click
' Add the response to the Click event here.
End Sub
End Class