Enumerate Controls problem...

AndiOliver

Newcomer
Joined
Nov 14, 2003
Messages
2
Location
Romania - Giurgiu
I have some rough time trying to pass visual basic 6.0 to visual basic .net 7 and the problem I have now is that I want to enumerate all the objects in a form, with a single cicle 'for'.
The code I wrote so far is like:

Code:
Dim MyObj as control
for each myobj in frmtest.controls
  msgbox myobj.name
next

the problem is that my code will enumerate only command buttons and few control like listbox, grid but not labels and textboxes.
In visual basic 6.0 my code was like:

Code:
dim myobj as object
for each myobj in frmtest
  msgbox myobj.name
next

this code in 6.0 will work with any controls I have inserted into the form no matter labels, command buttons, textboxex etc

can anyone help me with a code that will enumerate all my objects into my form with visual basic dot net 7.0?

thanks for evaluating
 
Back
Top