Programming C++Builder How to Use the Grouping Controls to Group your Components in C Builder or Delphi?
Notice: Undefined variable: relatedArticlesCount in /home/wwwroot/ on line 149

How to use Grouping controls in C Builder or Delphi?

A graphical user interface is easier to use when related controls and information are presented in groups. C++Builder and Delphi provides several components for grouping components: 

Use this component: When you want this:
TGroupBox A standard group box with a title
TRadioGroup A simple group of radio buttons
TPanel A more visually flexible group of controls
TScrollBox A scrollable region containing controls
TTabControl A set of mutually exclusive notebook-style tabs 
TPageControl A set of mutually exclusive notebook-style tabs with corresponding pages, each of which may contain other controls
THeaderControl Resizable column headers

How to use Group boxes and radio groups?

A group box (TGroupBox) arranges related controls on a form. The most commonly grouped controls are radio buttons. After placing a group box on a form, select components from the Component palette and place them in the group box. The Caption property contains text that labels the group box at runtime.

The radio group component (TRadioGroup) simplifies the task of assembling radio buttons and making them work together. To add radio buttons to a radio group, edit the Items property in the Object Inspector; each string in Items makes a radio button appear in the group box with the string as its caption.

The value of the ItemIndex property determines which radio button is currently selected. Display the radio buttons in a single column or in multiple columns by setting the value of the Columns property. To respace the buttons, resize the radio group component.

How to use Scroll Boxes?

Scroll boxes (TScrollBox) create scrolling areas within a form. Applications often need to display more information than will fit in a particular area. Some controls--such as list boxes, memos, and forms themselves--can automatically scroll their contents (they have been put a scrollbar inner themselves).

Another use of scroll boxes is to create multiple scrolling areas (views) in a window. Views are common in commercial word-processor, spreadsheet, and project management applications. Scroll boxes give you the additional flexibility to define arbitrary scrolling subregions of a form.

Like panels and group boxes, scroll boxes contain other controls, such as TButton and TCheckBox objects. But a scroll box is normally invisible. If the controls in the scroll box cannot fit in its visible area, the scroll box automatically displays scroll bars.

Another use of a scroll box is to restrict scrolling in areas of a window, such as a toolbar or status bar (TPanel components). To prevent a toolbar and status bar from scrolling, hide the scroll bars, and then position a scroll box in the client area of the window between the toolbar and status bar. The scroll bars associated with the scroll box will appear to belong to the window, but will scroll only the area inside the scroll box.

Add comment

Security code

Programming - C++Builder