ToolStrip Control Demo 3
Imports System
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports System.Drawing
Imports System.Data.SqlClient
public class MainClass
Shared Sub Main()
Dim form1 As Form = New Form1
Application.Run(form1)
End Sub
End Class
Public Class Form1
Private Sub radGood_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radGood.CheckedChanged
slStatus.Image = New Bitmap("figure2.bmp")
End Sub
Private Sub radBad_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles radBad.CheckedChanged
slStatus.Image = New Bitmap("test.ico")
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
slTime.Text = Now.ToString("h:mm:ss tt")
End Sub
End Class
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Public Class Form1
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.TestStatusStripPanel1 = New System.Windows.Forms.ToolStripDropDownButton
Me.Option1ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.Option2ToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.ProgStatusStripPanel = New System.Windows.Forms.ToolStripProgressBar
Me.radBad = New System.Windows.Forms.RadioButton
Me.radGood = New System.Windows.Forms.RadioButton
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.StatusStrip1 = New System.Windows.Forms.StatusStrip
Me.slTime = New System.Windows.Forms.ToolStripStatusLabel
Me.pbStatus = New System.Windows.Forms.ToolStripProgressBar
Me.slStatus = New System.Windows.Forms.ToolStripStatusLabel
Me.sbOptions = New System.Windows.Forms.ToolStripSplitButton
Me.BlueToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.GreenToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.RedToolStripMenuItem = New System.Windows.Forms.ToolStripMenuItem
Me.StatusStrip1.SuspendLayout()
Me.SuspendLayout()
'
'TestStatusStripPanel1
'
Me.TestStatusStripPanel1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.Option1ToolStripMenuItem, Me.Option2ToolStripMenuItem})
Me.TestStatusStripPanel1.Name = "TestStatusStripPanel1"
Me.TestStatusStripPanel1.Size = New System.Drawing.Size(23, 23)
Me.TestStatusStripPanel1.Text = "Options"
'
'Option1ToolStripMenuItem
'
Me.Option1ToolStripMenuItem.Name = "Option1ToolStripMenuItem"
Me.Option1ToolStripMenuItem.Size = New System.Drawing.Size(139, 22)
Me.Option1ToolStripMenuItem.Text = "Option 1"
'
'Option2ToolStripMenuItem
'
Me.Option2ToolStripMenuItem.Name = "Option2ToolStripMenuItem"
Me.Option2ToolStripMenuItem.Size = New System.Drawing.Size(139, 22)
Me.Option2ToolStripMenuItem.Text = "Option 2"
'
'ProgStatusStripPanel
'
Me.ProgStatusStripPanel.AutoSize = False
Me.ProgStatusStripPanel.Name = "ProgStatusStripPanel"
Me.ProgStatusStripPanel.Size = New System.Drawing.Size(150, 20)
Me.ProgStatusStripPanel.Value = 70
'
'radBad
'
Me.radBad.AutoSize = True
Me.radBad.Location = New System.Drawing.Point(8, 28)
Me.radBad.Name = "radBad"
Me.radBad.Size = New System.Drawing.Size(44, 17)
Me.radBad.TabIndex = 8
Me.radBad.Text = "Bad"
'
'radGood
'
Me.radGood.AutoSize = True
Me.radGood.Location = New System.Drawing.Point(8, 4)
Me.radGood.Name = "radGood"
Me.radGood.Size = New System.Drawing.Size(51, 17)
Me.radGood.TabIndex = 7
Me.radGood.Text = "Good"
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 500
'
'StatusStrip1
'
Me.StatusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.slStatus, Me.slTime, Me.sbOptions, Me.pbStatus})
Me.StatusStrip1.Location = New System.Drawing.Point(0, 65)
Me.StatusStrip1.Name = "StatusStrip1"
Me.StatusStrip1.Size = New System.Drawing.Size(405, 27)
Me.StatusStrip1.TabIndex = 9
Me.StatusStrip1.Text = "StatusStrip1"
'
'slTime
'
Me.slTime.Name = "slTime"
Me.slTime.Size = New System.Drawing.Size(82, 22)
Me.slTime.Text = "12:34:56 PM"
'
'pbStatus
'
Me.pbStatus.ForeColor = System.Drawing.SystemColors.ControlDarkDark
Me.pbStatus.Name = "pbStatus"
Me.pbStatus.Size = New System.Drawing.Size(100, 20)
Me.pbStatus.Value = 69
'
'slStatus
'
Me.slStatus.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.slStatus.Image = New Bitmap("test.ico")
Me.slStatus.Name = "slStatus"
Me.slStatus.Size = New System.Drawing.Size(16, 22)
'
'sbOptions
'
Me.sbOptions.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Text
Me.sbOptions.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.BlueToolStripMenuItem, Me.GreenToolStripMenuItem, Me.RedToolStripMenuItem})
Me.sbOptions.Image = New Bitmap("figure2.bmp")
Me.sbOptions.ImageTransparentColor = System.Drawing.Color.Magenta
Me.sbOptions.Name = "sbOptions"
Me.sbOptions.Size = New System.Drawing.Size(72, 20)
Me.sbOptions.Text = "Options"
'
'BlueToolStripMenuItem
'
Me.BlueToolStripMenuItem.Name = "BlueToolStripMenuItem"
Me.BlueToolStripMenuItem.Size = New System.Drawing.Size(125, 22)
Me.BlueToolStripMenuItem.Text = "Blue"
'
'GreenToolStripMenuItem
'
Me.GreenToolStripMenuItem.Name = "GreenToolStripMenuItem"
Me.GreenToolStripMenuItem.Size = New System.Drawing.Size(125, 22)
Me.GreenToolStripMenuItem.Text = "Green"
'
'RedToolStripMenuItem
'
Me.RedToolStripMenuItem.Name = "RedToolStripMenuItem"
Me.RedToolStripMenuItem.Size = New System.Drawing.Size(125, 22)
Me.RedToolStripMenuItem.Text = "Red"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(405, 92)
Me.Controls.Add(Me.StatusStrip1)
Me.Controls.Add(Me.radBad)
Me.Controls.Add(Me.radGood)
Me.Name = "Form1"
Me.Text = "UseStatusStrip"
Me.StatusStrip1.ResumeLayout(False)
Me.StatusStrip1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents TestStatusStripPanel1 As System.Windows.Forms.ToolStripDropDownButton
Friend WithEvents Option1ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents Option2ToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ProgStatusStripPanel As System.Windows.Forms.ToolStripProgressBar
Friend WithEvents radBad As System.Windows.Forms.RadioButton
Friend WithEvents radGood As System.Windows.Forms.RadioButton
Friend WithEvents Timer1 As System.Windows.Forms.Timer
Friend WithEvents StatusStrip1 As System.Windows.Forms.StatusStrip
Friend WithEvents slStatus As System.Windows.Forms.ToolStripStatusLabel
Friend WithEvents slTime As System.Windows.Forms.ToolStripStatusLabel
Friend WithEvents sbOptions As System.Windows.Forms.ToolStripSplitButton
Friend WithEvents BlueToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents GreenToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents RedToolStripMenuItem As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents pbStatus As System.Windows.Forms.ToolStripProgressBar
End Class
Related examples in the same category