Prev | Current Page 219 | Next

Matthew MacDonald

"Pro WPF with VB 2008: Windows Presentation Foundation with .NET 3.5"

If you make even a minor addition to
this window, you??™ll probably be forced to create a new set of columns.
As this shows, when you choose the layout containers for a window, you aren??™t simply
interested in getting the correct layout behavior??”you also want to build a layout structure
that??™s easy to maintain and enhance in the future. A good rule of thumb is to use smaller layout
containers such as the StackPanel for one-off layout tasks, such as arranging a group of
buttons. On the other hand, if you need to apply a consistent structure to more than one area
of your window (as with the text box column shown later in Figure 4-20), the Grid is an indispensable
tool for standardizing your layout.
Split Windows
Every Windows user has seen splitter bars??”draggable dividers that separate one section of a
window from another. For example, when you use Windows Explorer, you??™re presented with a
list of folders (on the left) and a list of files (on the right). You can drag the splitter bar in
between to determine what proportion of the window is given to each pane.
In WPF, splitter bars are represented by the GridSplitter class and are a feature of the Grid.
By adding a GridSplitter to a Grid, you give the user the ability to resize rows or columns.
Figure 4-13 shows a window where a GridSplitter sits between two columns.


Pages:
207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231