473,395 Members | 1,938 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,395 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 1356
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
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,...

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.