|
-
Jan 30th, 2008, 09:53 AM
#1
Thread Starter
Banned
-
Jan 30th, 2008, 10:11 AM
#2
Re: MSGBOX at Time?
Are you familiar with using the Timer control?
What happens after the messagebox is clicked on?
-
Jan 30th, 2008, 10:17 AM
#3
Re: MSGBOX at Time?
As said you will a Timer control on your form and perhaps DateTimePicker (can be found in MS Windows Common Controls 2 6.0).
So, add those to your form as well as textbox and copy/paste/run this sample code:
Code:
Option Explicit
Dim myTime As String
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000 '1 second <<< 60000 = 1 minute
DTPicker1.Format = dtpTime
DTPicker1.Value = Now
End Sub
Private Sub Command1_Click()
myTime = DTPicker1.Value
Timer1.Enabled = True
End Sub
Private Sub DTPicker1_Change()
If DTPicker1.Value < Now Then DTPicker1.Value = Now
End Sub
Private Sub Timer1_Timer()
If CDate(myTime) = Now Then
MsgBox Text1.Text
'you may need to call some function here
Timer1.Enabled = False
End If
End Sub
-
Jan 30th, 2008, 10:30 AM
#4
Thread Starter
Banned
Re: MSGBOX at Time?
 Originally Posted by RhinoBull
As said you will a Timer control on your form and perhaps DateTimePicker (can be found in MS Windows Common Controls 2 6.0).
So, add those to your form as well as textbox and copy/paste/run this sample code:
Code:
Option Explicit
Dim myTime As String
Private Sub Form_Load()
Timer1.Enabled = False
Timer1.Interval = 1000 '1 second <<< 60000 = 1 minute
DTPicker1.Format = dtpTime
DTPicker1.Value = Now
End Sub
Private Sub Command1_Click()
myTime = DTPicker1.Value
Timer1.Enabled = True
End Sub
Private Sub DTPicker1_Change()
If DTPicker1.Value < Now Then DTPicker1.Value = Now
End Sub
Private Sub Timer1_Timer()
If CDate(myTime) = Now Then
MsgBox Text1.Text
'you may need to call some function here
Timer1.Enabled = False
End If
End Sub
Thanx alot! but 1 problem! i press CTRL + T and i dont find
MS Windows Common Controls 2 6.0
or
Microsoft Windows Common Controls 2 6.0
Do i need to download it somewere!? :S i only find other versions,
[EDIT]]]
Oh i found now! but cannot i take another thing then that Date picker!? also, its hard to change it, when i change it, also click on it, then 2 numbers going too be marked blue you know,
then when i press like 40 its going crazy :S also test yourselves to change times sometimes and you will see whats happends :S
[EDIT #2]]]
Ehm, whatever , it wrks if i press them so they get marked, then press arrow up or down,,,
But the biggest problem i got now, is when the time is over and the popup will become up, then i only hear sound, and nothing come, but when i open the program, also click on it there down, then i see the MSGBOx!
I must fix it, but how? ;S
Last edited by SwedeNpro; Jan 30th, 2008 at 11:02 AM.
-
Jan 30th, 2008, 11:11 AM
#5
Re: MSGBOX at Time?
You have to have the form displayed on the screen, not minimized.
-
Jan 30th, 2008, 11:21 AM
#6
Thread Starter
Banned
Re: MSGBOX at Time?
 Originally Posted by Hack
You have to have the form displayed on the screen, not minimized.
I know!!!
But does it not work to do something? also when the time is over, then my program can maximaze or something and then the popup will show? ;S
Or just a program with "TopOnly" will bee showing?
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
|