Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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:

 

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:

 

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

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...