For formatting in .Net Windows Forms I have found the System.Windows.Forms.Panel to be especially helpful. Users expect to be able to resize their forms however they want. Panels and the docking of Controls in Windows.Forms make this task simple.
Usually my first step when creating a new Form is to add docked Panels to frame the separate areas of the form. Then I dock each Control within each Panel and Windows.Forms handles all the resizing for me.
In the example below I use a Panel docked at the top of the form to make it seem like the Client ComboBox is part of the ToolBar. In fact the Client Label and ComboBox are docked to the left in the top Panel and then the ToolBar is docked to the left of the ComboBox (because there is not a ComboBox ToolBar control yet).
Also in the Edit TabPage I use Panels to frame the expanding TextBox Controls and their Labels. Each Label is docked to the left of the panel and each TextBox is docked to Fill the remaining space. As the Form sizes or the text in the TextBox changes I resize the Panel and the TextBox automatically expands to Fill the space.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment