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

4.7. Preferred Size

Except for instances of class Shell,[9] when a control is created, its location and size are zero. It is your job to place controls where you want them and give them sizes that are appropriate for your application. Layouts (see the chapter Layout) use the concepts described in this section to position and resize their controls.

[9] Recall that the operating system chooses the initial position and size of a Shell.

The preferred size of a control is the smallest possible size that best displays its content. For example, the preferred size of a button is large enough to show the label of the button but may be larger, according to the user interface design guidelines for the operating system. The preferred size of a composite that does not contain a layout is the smallest size that encloses its children. When a composite contains a layout, the layout computes the preferred size of the composite.


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


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