vb.net - how do I control the order of child controls when adding to my parent control? -
i have panel (call main_box) , add 20 more panels inside of it. each of child panels placed right under 1 above it. when resize form, child panels change size (like want them to), don't reposition inside parent box, need manually.
i trying:
dim vert_pos integer = 0 each o object in main_box.controls o.location = new point(0, vert_pos) vert_pos += o.height next
but child boxes positioned out of order. not appear in same order added them parent box.
how can ensure repositioned in order?
what ended doing creating array; , each time added child panel main_box, added array. iterate through array instead of main_box.controls , order stays correct.
Comments
Post a Comment