|
-
Jul 7th, 2000, 06:32 AM
#1
Thread Starter
Hyperactive Member
Hello
I'm not very good about this control-collection stuff.
I'm trying to make 2 sub's that takes a form as argument and then checkes if there is any timer in that form.
Sub1 disables the timer & Sub2 Enables the timer.
I tried with
Code:
Publc sub DisAbleTimer(Frm as Form)
Dim Ctrl as Control
For Each Ctrl in Frm
if Ctrl=Timer then
Ctrl.Enable=False 'make it disabled
end if
next Ctrl
End Sub
But it didn't work. Any ideas about how to do this??
I'm using VB5 SP3 on this project.
Thank you
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
-
Jul 7th, 2000, 06:43 AM
#2
Fanatic Member
You need to use the typeName function to return what type of contorl it is.
Code:
Publc sub DisAbleTimer(Frm as Form)
Dim Ctrl as Control
For Each Ctrl in Frm
if typeName(Ctrl) = Timer then
Ctrl.Enable=False 'make it disabled
end if
next Ctrl
End Sub
Iain, thats with an i by the way!
-
Jul 7th, 2000, 06:43 AM
#3
transcendental analytic
Use the Typename function:
Code:
Publc sub DisAbleTimer(Frm as Form)
Dim Ctrl as Control
For Each Ctrl in Frm
if TypeName(Ctrl) = "Timer"
then
Ctrl.Enable=False 'make it disabled
end if
next Ctrl
End Sub
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.
-
Jul 7th, 2000, 06:59 AM
#4
Thread Starter
Hyperactive Member
Typename in VB5
Thank you both the speedy reply :0)
a few additional Q's for this topic.
Is Typename avaible in VB 5??
Is it TypeOf that is a VB6-function?
Can I use VB6-functions in VB5 if I have the Msvbvm60.dll in my machine?
If so do I have to deliver the Msvbvm50.dll with my setup if I deliver the Msvbvm60.dll-file??
just qurious
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
-
Jul 7th, 2000, 07:40 AM
#5
transcendental analytic
1. Typename and TypeOf are both in VB5 Enterprise Edition
2. You can only use Msvbvm60.dll for compiled vb6 code
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.
-
Jul 7th, 2000, 07:56 AM
#6
Thread Starter
Hyperactive Member
Good
Thank you Kedaman
Then I can saftly use TapeName or TypeOf within my app.
Onerrorgoto
Dont be to optimistic, the light at the end of the tunnel might be a train
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
|