How dynamically move control up?

  • Thread starter Thread starter Cirene
  • Start date Start date
C

Cirene

I have a panel with certain controls in it. I have a checkbox to show/hide
the panel. Below the panel is a TabControl.

When I hide the panel, how can I get the Tab Control to grow UP (staying
anchored on the left, right and bottom)?

Thanks!
 
I have a panel with certain controls in it. I have a checkbox to show/hide
the panel. Below the panel is a TabControl.

When I hide the panel, how can I get the Tab Control to grow UP (staying
anchored on the left, right and bottom)?

Thanks!

1. Move the Tab control manually by changing its Top and Height
properties.

2. If the panel and tab control occupy the entire form, set the
panel's Dock to Top and the tab's Dock to Fill. Use BringtoFront /
SendtoBack to get the panel to dock at the top. If they don't occupy
all of the form you could put them inside another panel.

3. Put the panel and tab in a TableLayoutPanel control with one
column and two rows. Set the TableLayoutPanel row 0 to AutoSize. Set
the tab to Dock Fill. You may have to play with some of other
properties of the tab and TableLayoutPanel.

I'm sure there are other solutions too.
 
Back
Top