|
Public Class MainForm
#Region " Constructors "
Public Sub New()
InitializeComponent()
TimeLabel.Text = DateTime.Now.ToString
TimerMenu.Text = TimeLabel.Text
Timer1.Interval = 1000
Timer1.Start()
End Sub
#End Region
#Region " Event handlers "
Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) _
Handles Me.FormClosing
If e.CloseReason = CloseReason.UserClosing Then
e.Cancel = True
CloseApp()
End If
End Sub
Private Sub mnuFormClose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuFormClose.Click
CloseApp()
End Sub
Private Sub mnuFormExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuFormExit.Click
ExitApp()
End Sub
Private Sub mnuFormMinimize_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) _
Handles mnuFormMinimize.Click
MinimizeApp()
End Sub
#End Region
Private Sub Timer1_Tick(ByVal sender As Object, ByVal e As System.EventArgs) Handles Timer1.Tick
TimeLabel.Text = DateTime.Now.ToString
TimerMenu.Text = TimeLabel.Text
End Sub
End Class
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
Gregory Gadow recently graduated from Central Washington University with a B.S. that combined economics and statistical analysis, and currently works for the Washington Department of Fish & Wildlife as an IT developer. He has been writing code for 30 years in more than a dozen programming languages, including Visual Basic, VB.Net, C++, C#, ASP, HTML, XML, SQL, and R.