Results 1 to 3 of 3

Thread: time

  1. #1

    Thread Starter
    New Member
    Join Date
    Aug 2000
    Location
    india
    Posts
    13

    Post

    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.

  2. #2
    Frenzied Member
    Join Date
    Jun 2000
    Location
    East Providence, RI
    Posts
    1,715
    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

  3. #3
    Fanatic Member Dim's Avatar
    Join Date
    Jul 2000
    Posts
    620
    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
    Dim

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width