|
-
Jun 5th, 2000, 03:07 AM
#1
How do i unload a form after it has loaded and visible for 10 seconds.
-
Jun 5th, 2000, 03:15 AM
#2
Addicted Member
Code:
Private Sub Form_Load()
Form1.Visible = True
OpenedAt = Now
Do Until DateDiff("s", OpenedAt, Now) >= 10
DoEvents
Loop
Unload Form1
End Sub
-
Jun 5th, 2000, 03:20 AM
#3
Or you can use a Timer with the Interval set to 1000. (1 second)
[code]
Private Sub Timer1_Timer()
Static tCount
tCount = tCount + 1
If tCount = 10 Then Unload Me
End Sub
-
Jun 5th, 2000, 03:20 AM
#4
Hyperactive Member
Hope it helpz
Im sure there are better ways, but im new and untill then maybe this will help.
First create a timer and form and module.
in module put
Global hours, mins, seconds as integer
then in form1_load put
hours = 0
mins = 0
seconds = 10
form1.timer1.enabled = true
(set interval on timer to 1000)
This will count down the timer in 10 seconds....now
in timer1 put
if seconds = 0 then
seconds = 59
if mins = 0 then
mins = 59
if hours = 0 then
form1.unload
else
hours = hours - 1
end if
else
mins = mins -1
end if
else seconds = seconds - 1
end if
if len(mins) < 2 then mins = "0" & mins
if len(seconds) <2 then seconds = "0" & seconds
label2.caption = hours & ":" & mins & ":" & seconds
end sub
Hope that works....kind of slopy, be sure to check for typo's if get a error...see ya
-RaY
VB .Net 2010 (Ultimate)
-
Jun 5th, 2000, 03:21 AM
#5
Hyperactive Member
PS I FORGOT
Create a label2 as well, this way you can see the 10 seconds count down to make sure its working.
-RaY
VB .Net 2010 (Ultimate)
-
Jun 5th, 2000, 03:23 AM
#6
Hyperactive Member
ROFL
Thats y my programs are so buggy, look at there code and look at mind, geesh all that extra work I do.... I can probably make opening up a text file 4 megz of source...hehe....oh well i tried.
-RaY
VB .Net 2010 (Ultimate)
-
Jun 5th, 2000, 05:53 AM
#7
transcendental analytic
Two other ways:
The first is accurate to 1ms, the second to 60ms
Code:
'In declarations
Declare Function GetTickCount Lib "kernel32" Alias "GetTickCount" () As Long
'In code
t=gettickcount+10000
Do while t>gettickcount
doevents
loop
Code:
t=timer+10
Do while t>timer
doevents
loop
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
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
|