|
-
May 3rd, 2001, 07:52 PM
#1
Building Frame names using strings
HI, I have 90 Frames that I want to check to see if the option box has been checked. I can make 90 if statements, ie Frame1, Frame2, ...Frame90, or use one loop as the only thing that changes is the number of the Frame, which is sequential ie 1,2,3,4,5,..90. See how much code I would save. When I build the frame name with a string & number etc... ie Frame1.value as "Frame" & number & "Value" I get an error! is there a way to do this? Visual BAsic sees it as a string, not as the name of an object etc... thanks very much
-
May 3rd, 2001, 09:13 PM
#2
Re: Building Frame names using strings
you can loop through each control in a form like this
dim formctrl
for each formctrl in Form1 'assume Form1 is the form name
if typeof formctrl is Frame then
'check the option box for this frame
end if
next formctrl
HTH
cksiow
http://vblib.virtualave.net - share our codes
-
May 4th, 2001, 05:54 AM
#3
Re: Building Frame names using strings
cksiow is right. and if you want to do different things with name of frame, you can use:
dim formctrl
for each formctrl in Form1 'assume Form1 is the form name
if typeof formctrl is Frame then 'check the option box
if formctrl.name = "Frame" & number then 'this do works: you're matching strings
end if
end if
next formctrl
Special thanks to Lothar "the Great" Haensler, Tom Archer, Bruno Paris and all the other wonderful people who made and make Codeguru a great place. Come back soon, you Gurus.
...at present time, using mainly Net 4.0, Vs 2010
Special thanks to Lothar "the Great" Haensler, Chris Eastwood , dr_Michael, ClearCode, Iouri and
all the other wonderful people who made and make Codeguru a great place.
Come back soon, you Gurus.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|