AndiOliver Posted December 11, 2003 Posted December 11, 2003 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 Quote
Moderators Robby Posted December 11, 2003 Moderators Posted December 11, 2003 Are the labels and textboxes in a container like groupbox or panel? If so, you need to iterate those containers. Quote Visit...Bassic Software
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.