I have a vb.net Application and I need to make my Application to go sleep if not used 10 minutes or 15 minutes? I am trying to use Stopwatch and Timer
//Here is the Main form load
Private Sub frmMain_Load(sender As Object, e As EventArgs) Handles MyBase.Load
StopWatch.Start()
Tmr.Start()
End Sub
When the Main Form loads Stopwatch was Starting
//here is the Timer Tick
Private Sub Timer2_Tick(sender As Object, e As EventArgs) Handles Timer2.Tick
Try
Label2.Text = StopWatch.Elapsed.ToString
If StopWatch.Elapsed.Minutes = 4 Then
Sleep.Show()
End If
Catch ex As Exception
MessageBox.Show(ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Stop)
End Try
End Sub
I need when the Time reaches 10 Min to show the user another Form called Sleep and enter his username and password after that come back to his work and continue
can any body help me?
Sorry for my bad English.