OK, this is driving me a bit nuts at this point. Time to ask the crowd:
I have a form that consists of: two vertical "halves" created by a SplitContainer. Inside the bottom "half" / SplitContainer panel... I have:
A set of fields/controls for the user to fill out, contained within a panel.
Below that, a panel containing buttons for "submit", "cancel"...and one that's "show/hide". This "show/hide" is intended to show/hide the panel I just described in point 1 above.
What I want to happen is: when the user clicks to "hide" the panel of controls, not only do those controls vanish, but also:
I have no problem getting the panel of controls/fields to show/hide. But I can't seem to figure out how to accomplish the other two tasks. I've tried various combinations of AutoSize
, AutoSizeMode
, and Dock
options.
Any suggestions?
By default, the controls on an Access form stay anchored to the upper-left corner of the form, and do not resize when you resize the form. To change this behavior, you can use the Anchoring command.
To resize multiple controls on a form In Visual Studio, hold down the Ctrl or Shift key and select the controls you want to resize. The size of the first control you select is used for the other controls.
DockPanel defines an area to arrange child elements relative to each other, either horizontally or vertically. With DockPanel you can easily dock child elements to top, bottom, right, left and center using the Dock property.
The TableLayoutPanel control arranges its contents in a grid. Because the layout is done both at design time and run time, it can change dynamically as the application environment changes.
If you put all your controls into a FlowLayoutPanel where the children are arranged vertically, then hiding some controls should cause the "lower" controls to move up the page.
You might still need to write some code to resize the form itself once the optional content has been hidden or before it's shown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With