Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsVB SyntaxEnterprise DevelopmentDatabase AccessControlsCOMWin APICrystal ReportDeploymentGeneralGeneral 2
Related Topics
VB.NET / ASP.NETMS SQL ServerMS AccessOther Database ProductsMore Topics ...

VB Forum / Controls / July 2008



Tip: Looking for answers? Try searching our database.

List all the properties of a control

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
David DB - 11 Jul 2008 10:12 GMT
I want to dump all the properties of a control in the debug window.

How can I list the properties without naming them ? (example:
text1.backcolor)

VB6

David
Jeff Johnson - 11 Jul 2008 14:34 GMT
>I want to dump all the properties of a control in the debug window.
>
> How can I list the properties without naming them ? (example:
> text1.backcolor)

(Can't resist giving props to .NET here: Reflection sure is cool.)

You would need to use a library called TLBINF32.DLL to enumerate the
properties of your control. Search for it on Google. The help file has some
pretty good examples.
RDub - 11 Jul 2008 15:40 GMT
assuming there is a text box "Text0" and a cmd button "Command2" on the form

Private Sub Command2_Click()

   Dim prp As Object

   For Each prp In Text0.Properties
       Debug.Print prp.Name
   Next

End Sub

>I want to dump all the properties of a control in the debug window.
>
[quoted text clipped - 4 lines]
>
> David
RDub - 11 Jul 2008 15:48 GMT
OOOPS - Disregard last post.

Looking in the wrong group!  I thought I was in an access.formscoding Group.

The code I posted works in Access VBA, I don't think this works with VB6,
controls do not have a Properites collection to iterate.  Really sorry about
that :-(

Rdub

> assuming there is a text box "Text0" and a cmd button "Command2" on the
> form
[quoted text clipped - 17 lines]
>>
>> David
Bob Butler - 11 Jul 2008 15:50 GMT
> assuming there is a text box "Text0" and a cmd button "Command2" on the
> form
[quoted text clipped - 5 lines]
>    Next
> End Sub

In VBA in Access, yes.  In VB 6 or other flavors of VBA, no.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.