Íàêðàÿ,
êîãàòî ñòàíå 1 (100%), òàéìåðúò ñïèðà è ñâîéñòâîòî ìó Enabled ñòàâà False, èçâèêâà ñå beep çà äà èçäàäå çâóê è âèå äà çíàåòå, ÷å òàéìåðúò å ïðèâúðøèë. Ëèñòèíã 3 ïîêàçâà öåëèÿ êîä.
|
Ôèãóðà 39 Îïðåäåëÿíå íà òàáóëàöèîííèÿ
ðåä ( tab order).
|
Listing
3 Âàøàòà
âòîðà VB.NET Àïëèêàöèÿ ñ öåëèÿ êîä,
êîéòî äèñêóòèðàõìå äîñåãà
Public
Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form Designer generated code "
Public Sub New()
MyBase.New()
`This call is required by the Windows Form Designer.
InitializeComponent()
`Add any initialization after the InitializeComponent()
call
Me.Opacity = 0
End Sub
`Form overrides dispose to clean up the component list.
Public Overrides Sub Dispose()
MyBase.Dispose()
If Not (components Is Nothing) Then
components.Dispose()
End If
End Sub
Private WithEvents button1 As
System.Windows.Forms.Button
Private
WithEvents label1 As System.Windows.Forms.Label
Private WithEvents menuItem1 As
System.Windows.Forms.MenuItem
Private
WithEvents menuItem2 As System.Windows.Forms.MenuItem
Private WithEvents menuItem3 As
System.Windows.Forms.MenuItem
Private
WithEvents mainMenu1 As System.Windows.Forms.MainMenu
Private WithEvents menuItem4 As
System.Windows.Forms.MenuItem
Private
WithEvents button2 As System.Windows.Forms.Button
Private WithEvents button3 As
System.Windows.Forms.Button
Private
WithEvents button4 As System.Windows.Forms.Button
Private WithEvents timer1 As System.Windows.Forms.Timer
Private components As System.ComponentModel.IContainer
`Required by the Windows Form Designer
`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.menuItem1 = New System.Windows.Forms.MenuItem()
Me.menuItem2 = New System.Windows.Forms.MenuItem()
Me.menuItem3 = New System.Windows.Forms.MenuItem()
Me.timer1 = New System.Windows.Forms.Timer(Me.components)
Me.button2 = New System.Windows.Forms.Button()
Me.button3 = New System.Windows.Forms.Button()
Me.button4 = New System.Windows.Forms.Button()
Me.button1 = New System.Windows.Forms.Button()
Me.mainMenu1 = New System.Windows.Forms.MainMenu()
Me.menuItem4 = New System.Windows.Forms.MenuItem()
Me.menuItem1.Index = 0
Me.menuItem1.MenuItems.AddRange(New
System.Windows.Forms.MenuItem() _
{Me.menuItem2, Me.menuItem3})
Me.menuItem1.Text = "&File"
Me.menuItem2.Index = 0
Me.menuItem2.Shortcut =
System.Windows.Forms.Shortcut.CtrlO
Me.menuItem2.Text = "&Open"
Me.menuItem3.Index = 1
Me.menuItem3.Text = "&Close"
Me.timer1.Enabled = True
Me.button2.Location = New System.Drawing.Point(96, 72)
Me.button2.TabIndex = 0
Me.button2.Text = "button2"
Me.button3.Location = New System.Drawing.Point(96, 104)
Me.button3.TabIndex = 2
Me.button3.Text = "button3"
Me.button4.Location = New System.Drawing.Point(176, 72)
Me.button4.TabIndex = 1
Me.button4.Text = "button4"
Me.button1.Location = New System.Drawing.Point(176, 104)
Me.button1.TabIndex = 3
Me.button1.Text = "button1"
Me.mainMenu1.MenuItems.AddRange(New
System.Windows.Forms.MenuItem() _
{Me.menuItem1, Me.menuItem4})
Me.menuItem4.Index = 1
Me.menuItem4.Text = "&Edit"
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(259, 134)
Me.Controls.AddRange(New System.Windows.Forms.Control()
_
{Me.button4, Me.button3, Me.button2, Me.button1})
Me.Menu = Me.mainMenu1
Me.Opacity = 0.5
Me.Text = "Form1"
End Sub