hi, im trying to get a progress bar to countdown a specified time in minutes from a textbox. what ive got is a mainmenu form, which has an options button opening an options form, and setting the work shift timer is one of the options, which leads to a another form requesting the shift time in minutes which should then be used to handle the progress bar on the mainmenu form. (hopefully thats not too confusing)
Main Menu Code
Shift Timer Set Code
That's what i've got at the moment, i tried making this code referring to an online example, however it's not working, this bit in the shift forms code comes underlined blue
am i not allowed to do that? if so what do i do to make this work! im very confused
Main Menu Code
VB.NET:
Public Class MainMenu
Private Sub MainMenu_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.Clock.Interval = 1 * 1000 ' this = 1 second
Me.Clock.Enabled = False
End Sub
Private Sub btnOption_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnOption.Click
Options.Show()
End Sub
End Class
Shift Timer Set Code
VB.NET:
Public Class ShiftTimerSet
Dim timCount As Integer
Private Sub Clock_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MainMenu.Clock.Tick
On Error Resume Next
timCount = timCount + 1
MainMenu.ProgressBar1.Value = MainMenu.ProgressBar1.Value + 1
If timCount >= MaskedTextBox1.Text * 60 Then
MainMenu.ProgressBar1.Value = MainMenu.ProgressBar1.Maximum
MsgBox("Your Shift Is Over")
MainMenu.Clock.Enabled = False
timCount = 0
MainMenu.ProgressBar1.Value = 0
End If
End Sub
Private Sub btnStart_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnStart.Click
MainMenu.ProgressBar1.Minimum = 0
MainMenu.ProgressBar1.Maximum = MaskedTextBox1.Text * 60
MainMenu.ProgressBar1.Value = 0
MainMenu.Clock.Enabled = True
End Sub
End Class
That's what i've got at the moment, i tried making this code referring to an online example, however it's not working, this bit in the shift forms code comes underlined blue
VB.NET:
'Handles MainMenu.Clock.Tick'