• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 15. Layout > Class GridLayout

15.6. Class GridLayout

GridLayout uses a powerful and complex algorithm to position controls within a grid of rectangular cells. Many user interfaces can be described as grids. This makes GridLayout appropriate for a wider range of applications than either FillLayout or RowLayout. In particular, GridLayout provides a good way to position every control within a window without resorting to nested composites. The average “Find/Replace” dialog can be defined using a single GridLayout. For an example of this sort of dialog, see Using GridLayout to Implement a Find Dialog.

GridLayout works by allowing you to configure explicitly the number of columns in the grid. Controls are assigned to columns in the order they are created, wrapping when the number of columns is exceeded. In this manner, the number of columns and the number of controls implicitly define the number of rows and the total number of cells. Within each cell, a control can be aligned to any side of the cell. For even more flexibility, controls can span cells horizontally or vertically.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint