i want to make a project in VB which will accept a number as minute (like if a user enter 30 it will under stand 30 minute) and after that perticular time the machine will shutdown.
plese send suggestion.
thank you in advanced.
Printable View
i want to make a project in VB which will accept a number as minute (like if a user enter 30 it will under stand 30 minute) and after that perticular time the machine will shutdown.
plese send suggestion.
thank you in advanced.
the hour text box is refred to as txtHour
the minute text box is refred to as txtMinute
the timer is refred as Tmr1
I hope that this is what you wanted and that it worksCode:Private Sub CmdOK_Click()
intHour = txthour.Text
intMinute = txtminute.txt
txtminute = txtminute + txthour * 60
txthour.Text = ""
txthour.enable = False
txtminute.Enabled = False
intHour = txtminute.Text
End Sub
Private Sub Form_Load()
Dim intTimer As Integer
Dim intHour As Integer
Dim intMinute As Integer
Tmr1.Interval = 60000
End Sub
Private Sub Tmr1_Timer()
intTimer = intTimer + 1
If intTimer = intHour Then
'code for rebooting computer
End If
End Sub
Just in case:
Gl,Code:Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
'place this to shut it down.
ExitWindowsEx 15, 0
D!m