473,440 Members | 2,004 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,440 software developers and data experts.

VB Creating A Program Questions

Objective: To create a program that will allow the end user to input a number in terms of minutes and then click start. Once start has been selected a timer will start counting down from the the number they put into the textbox and once that number reaches zero it will delay for 5 seconds and then power down the computer.
Comments: The last half of that is not as important as getting it to count down from a preselected number. I tried messing around with timers and threads and i just cant seem to get it... I would appreciate your help with this... also dont give me all of the answers, just point me in the right direction plz.

http://i67.photobucket.com/albums/h303/recruitor/ShutdownTimer.jpg

p.s. i attached a link to a pic of the form i made for the is program...
Mar 2 '07 #1
4 1357
willakawill
1,646 1GB
Objective: To create a program that will allow the end user to input a number in terms of minutes and then click start. Once start has been selected a timer will start counting down from the the number they put into the textbox and once that number reaches zero it will delay for 5 seconds and then power down the computer.
Comments: The last half of that is not as important as getting it to count down from a preselected number. I tried messing around with timers and threads and i just cant seem to get it... I would appreciate your help with this... also dont give me all of the answers, just point me in the right direction plz.

http://i67.photobucket.com/albums/h303/recruitor/ShutdownTimer.jpg

p.s. i attached a link to a pic of the form i made for the is program...
Interesting. Is this a college assignment?
Mar 2 '07 #2
vijaydiwakar
579 512MB
Objective: To create a program that will allow the end user to input a number in terms of minutes and then click start. Once start has been selected a timer will start counting down from the the number they put into the textbox and once that number reaches zero it will delay for 5 seconds and then power down the computer.
Comments: The last half of that is not as important as getting it to count down from a preselected number. I tried messing around with timers and threads and i just cant seem to get it... I would appreciate your help with this... also dont give me all of the answers, just point me in the right direction plz.

http://i67.photobucket.com/albums/h303/recruitor/ShutdownTimer.jpg

p.s. i attached a link to a pic of the form i made for the is program...
dear for that use timer with interval of 1000 = 1 sec then decrement the no by one once its reached to 0 enable another timer in that timer after 5 seconds use following code
Expand|Select|Wrap|Line Numbers
  1. 'In general section
  2. Const EWX_LOGOFF = 0
  3. Const EWX_SHUTDOWN = 1
  4. Const EWX_REBOOT = 2
  5. Const EWX_FORCE = 4
  6. Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
  7. Private Sub Form_Load()
  8.     msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)
  9.     If msg = vbCancel Then End
  10.     'reboot the computer
  11.     ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
  12. End Sub
  13.  
  14.  
Mar 2 '07 #3
Interesting. Is this a college assignment?
No, just a personal project.
Mar 22 '07 #4
dear for that use timer with interval of 1000 = 1 sec then decrement the no by one once its reached to 0 enable another timer in that timer after 5 seconds use following code
Expand|Select|Wrap|Line Numbers
  1. 'In general section
  2. Const EWX_LOGOFF = 0
  3. Const EWX_SHUTDOWN = 1
  4. Const EWX_REBOOT = 2
  5. Const EWX_FORCE = 4
  6. Private Declare Function ExitWindowsEx Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long) As Long
  7. Private Sub Form_Load()
  8.     msg = MsgBox("This program is going to reboot your computer. Press OK to continue or Cancel to stop.", vbCritical + vbOKCancel + 256, App.Title)
  9.     If msg = vbCancel Then End
  10.     'reboot the computer
  11.     ret& = ExitWindowsEx(EWX_FORCE Or EWX_REBOOT, 0)
  12. End Sub
  13.  
  14.  
Ummm, I dont know exactly what you were trying to say, if you could type it all out in code, I would appreciate it.
Mar 22 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Paul | last post by:
I am creating a Program for college, in which the Program will read a Folder and create a HTML page from the pictures that are storrd in that folder. . What would be the best way to do...
6
by: Dim St Thomas | last post by:
I am a developer working on a database client program. I am testing this program on a Windows XP machine (1.5 GHz AMD chip, 480 Mb RAM, 60 Gb disk) This machine has Oracle 9.2.0.1.0 and RedBrick...
8
by: PHP2 | last post by:
I am pretty new at this so forgive me if this is a stupid question, but is there a simple way to create a window with C++... Maybe a library or something with simple window commands?
7
by: FC | last post by:
Hi all: I am a Computer Engineering student, as part of my curriculum I have taken quite a few programming classes. Most of them were given in C++. I am almost done with my studies and I have yet...
3
by: EnglishMan69 | last post by:
Hello All, I am using VB2005 Beta 2 in VS 2005 and am running into a small problem. I need to be able to add a picture box to the main form from within a thread. The program goes to a web...
3
by: lars.uffmann | last post by:
Hi everyone! I am debugging a big piece of code on the search for memory leaks, using g++ under suse 9.3. Since I'm trying to eliminate ALL memory leaks, I now stumbled upon a class foo that is...
24
by: Kosmos | last post by:
Hey guys I'm a newbie and in fact I'm not even a programmer but decided to take up the task of learning access and creating a database. And I've gotten pretty far in terms of importing from excel and...
1
by: kixter1108 | last post by:
Hi guys! I'm seeking help in creating a quiz that would allow the user to change the questions/answers as an option on the interface itself. Is it possible? What database interconnection would be...
6
by: William Foster | last post by:
Good evening all, I have written a single file program in Microsoft Visual Basic 2008 Express Edition that I need to build with a Trial Period. I have built in a simple check the date...
0
MrMancunian
by: MrMancunian | last post by:
How to create a database connection without using wizards Introduction I've seen a lot of questions on the net about getting data from, and saving data to databases. Here's a little insight how...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.