To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Nov 28th, 2009, 11:33 AM   #1
JamieWarren09
Addicted Member
 
Join Date: May 09
Posts: 226
JamieWarren09 is an unknown quantity at this point (<10)
Make form show at certain time?

Hi there, Does anybody know of a way to make a form show if it is a certain time ?


For example if my computers clock his 17:30 then form2.show?


I basically want it so that a user puts the time they want in text1.text and then when they press the command button then it will wait for the time they enterd and then form 2 will show!


Thanks,
JamieWarren09 is offline   Reply With Quote
Old Nov 28th, 2009, 12:00 PM   #2
LaVolpe
VBaholic & Loving It
 
LaVolpe's Avatar
 
Join Date: Oct 07
Location: GetWindowRect()
Posts: 6,224
LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)LaVolpe is a splendid one to behold (700+)
Re: Make form show at certain time?

Add a timer to your form and set its interval for something like 10-20 secs.
In the timer's event, check the system time to see if: Time => TimeSerial(17,30,0).
If so, disable the timer and show the form.

Edited: You'd probably keep the timer disabled by default. When the button is clicked and you validated the user input is a valid time, then you'd enable the timer.
__________________
Insomnia is just a byproduct of, "It can't be done"
Newbie? Novice? Bored? Spend a few minutes browsing the FAQ section of the forum.

{Memory Leak FAQ} {GDI+ Classes/Samples} {Unicode Open/Save Dialog} {Icon Organizer/Extractor}
HitchHiker's Guide to Getting Help on the Forums

Last edited by LaVolpe; Nov 28th, 2009 at 12:11 PM.
LaVolpe is offline   Reply With Quote
Old Nov 28th, 2009, 12:36 PM   #3
Charlie Stallings
Lively Member
 
Charlie Stallings's Avatar
 
Join Date: Nov 09
Location: Virginia
Posts: 104
Charlie Stallings is an unknown quantity at this point (<10)
Re: Make form show at certain time?

put this in the timer and just set it to the time you want the second form to show up

Code:
Private Sub Timer1_Timer()
Label1.Caption = Time
If Label1.Caption = "12:35:00 PM" Then
Form2.Show
Timer1.Enabled = False
End If
End Sub
Charlie Stallings is offline   Reply With Quote
Old Nov 29th, 2009, 02:08 AM   #4
JamieWarren09
Addicted Member
 
Join Date: May 09
Posts: 226
JamieWarren09 is an unknown quantity at this point (<10)
Re: Make form show at certain time?

Thankyou!

I have gone with
Code:
Label3.Caption = Time
If Label3.Caption = "07:06:01" Then
Form2.Show
Timer1.Enabled = False
End If

But how can i make it so the time the form pops up will be what the user puts in.

I Have 3 comboBox and one called hour (which has 1 - 24) Minutes (0 - 59) and seconds.

How can i make it like


if label3.caption ="" the hour a user selects , the seconds the user selects and the minutes?


Thanks
JamieWarren09 is offline   Reply With Quote
Old Nov 29th, 2009, 03:16 AM   #5
westconn1
PowerPoster
 
Join Date: Dec 04
Posts: 11,791
westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)westconn1 is a splendid one to behold (700+)
Re: Make form show at certain time?

If time = timeserial(combohour.text, combomin.text, combosec.text) Then
but if the timer misses the exact second in the seconds combo the event won't fire, you would need your timer interval to be under ½ second if you want to be that accurate, or use if time >
__________________
i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

come back and mark your original post as resolved if your problem is fixed
pete
westconn1 is online now   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic 6 and Earlier


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 02:53 PM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.