BlaZer
asked on
Control type?
How can i at runtime deternimate what control type a object is?
for examble
For each object in me
msgbox object.type
next
ive tried alot og of things...using the typelib is one of them..but that dosnt work with calender controls....
for examble
For each object in me
msgbox object.type
next
ive tried alot og of things...using the typelib is one of them..but that dosnt work with calender controls....
Or this?
Dim I ' Declare variable.
For I = 0 To Frm.Controls.Count - 1
If Not TypeOf Frm.Controls(I) Is Menu Then
Frm.Controls(I).Enabled = State
End If
Next I
Dim I ' Declare variable.
For I = 0 To Frm.Controls.Count - 1
If Not TypeOf Frm.Controls(I) Is Menu Then
Frm.Controls(I).Enabled = State
End If
Next I
ASKER
number one comment works perfect..i dont know i could add a more question, but do u know how to deternimate the parent of the name? Like vb.commandbutton or MSComctlLib.TreeCtrl ?
if u cant/dont want to answer that ill just give u the points...
if u cant/dont want to answer that ill just give u the points...
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
'This should work fine
Dim cntl As Control
For Each cntl In Controls
Debug.Print TypeName(cntl)
Next
Dim cntl As Control
For Each cntl In Controls
Debug.Print TypeName(cntl)
Next
Option Explicit
Private Sub Command1_Click()
Dim ctl As Control
For Each ctl In Controls
Debug.Print TypeName(ctl)
Next
End Sub