controls and properties

a) how do I get the names of the controls on a form?

b) how do I get the names of the properties of each control?
dcsorilliaAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
fduahConnect With a Mentor Commented:
here are your answers:
(a)
   dim ctrl as control
   for each ctrl in form.controls
      msgbox ctr.name
   next

b(b)
  dim pr as property
    for each pr in control
       msgbox  pr.name
    next



0
 
JiaHCommented:
For (a) , you can use the controls collection to get each item in it such as "For each ctrX in me.controls" , the control's name is ctrX.name.

For (b) Vb don't support this.
0
 
EyalCommented:
For part a JiaH is correct but for part b of your question he is wrong. You can get all the properties and methods From the IDE in add-ins component or from microsoft unsuported dll
0
 
MirkwoodCommented:
Jiah are wrong
Eyal is making life to difficult, there is an easier answer.

0
 
dcsorilliaAuthor Commented:
fduah,

The first part of your answer works correctly.  I knoew that was the easy part.  

As for the second part:

Dim pr as property  <-- vb reports that property is an undefined user type.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.