|
-
Sep 14th, 2000, 09:23 PM
#1
Thread Starter
New Member
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.
-
Sep 14th, 2000, 09:39 PM
#2
Frenzied Member
the hour text box is refred to as txtHour
the minute text box is refred to as txtMinute
the timer is refred as Tmr1
Code:
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
I hope that this is what you wanted and that it works
NXSupport - Your one-stop source for computer help
-
Sep 14th, 2000, 10:48 PM
#3
Fanatic Member
Just in case:
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
Gl,
D!m
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|