Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Arrange controls programatically

Status
Not open for further replies.

vietnam97

Programmer
Sep 18, 2000
48
0
0
I have about a dozen of checkboxes in a frame, and depend on the choice selected only some of the checkboxes will be visible to the users? This would create some spaces between them and the screen wouldn't present nicely.

So, is there a method to line them up automatically without having to program for the new position on each of the visible checkbox?

Thanks,
Bao
 
you could do something like

dim ypos as integer
dim c as control
ypos = 10 'arbitary number

for each c in me.controls
'maybe check here for checkbox type

if c.visible then
c.top = ypos
ypos = ypos + 30 'arbitrary number
end if
next
 
Jeff, thanks for your help. Although it doesn't work out exactly, because I have 2 columns of checkboxes, so I want to make sure the rows are lining up correctly. But I think I got your idea.

Thanks,
Bao
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top