12.12.2012 Views

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

Teach Yourself Borland C++ in 14 Days - portal

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

306 Day 8<br />

Table 8.8. Properties for the Label component.<br />

Property Description<br />

AutoSize When set to true, the label will size itself accord<strong>in</strong>g to the text<br />

conta<strong>in</strong>ed <strong>in</strong> the Caption property. When set to false, text will<br />

be clipped at the right edge of the label.<br />

FocusControl A label is a non-w<strong>in</strong>dowed component, so it cannot receive <strong>in</strong>put<br />

focus and it cannot be tabbed to. Sometimes, however, a label<br />

serves as the text for a control such as an edit control. In those<br />

cases you could assign an accelerator key to the label (us<strong>in</strong>g the<br />

ampersand) and then change the FocusControl property to the<br />

name of the control you want to receive focus when the label’s<br />

accelerator key is pressed.<br />

ShowAccelChar Set this property to true if you want an actual ampersand to<br />

show up <strong>in</strong> the label rather than the ampersand serv<strong>in</strong>g as the<br />

accelerator key.<br />

Transparent When this property is set to true, the Color property is ignored<br />

and anyth<strong>in</strong>g beneath the label shows through. This is useful for<br />

plac<strong>in</strong>g labels on bitmap backgrounds, for <strong>in</strong>stance.<br />

WordWrap When set to true, text <strong>in</strong> the label will wrap around to a new l<strong>in</strong>e<br />

when it reaches the right edge of the label.<br />

The ScrollBar Component<br />

The ScrollBar component represents a standalone scrollbar. It’s standalone <strong>in</strong> the sense that<br />

it is not connected to an edit control, a list box, a form, or anyth<strong>in</strong>g else. I have not found<br />

that the scrollbar is a control I use very frequently. Certa<strong>in</strong> types of applications use scrollbars<br />

heavily, of course, but for day-<strong>in</strong>, day-out applications its use is fairly uncommon. The<br />

scrollbar’s performance is set by sett<strong>in</strong>g the M<strong>in</strong>, Max, LargeChange, and SmallChange<br />

properties. The scrollbar’s position can be set or obta<strong>in</strong>ed via the Position property. The K<strong>in</strong>d<br />

property allows you to specify a horizontal or vertical scrollbar.<br />

The Panel Component<br />

The Panel component is sort of a workhorse <strong>in</strong> <strong>C++</strong>Builder. There is almost no limit to what<br />

you can use panels for. Panels can be used to hold speedbar buttons, to display text labels such<br />

as a title for a form, display graphics, and to hold regular buttons as well. One of the<br />

advantages to a panel is that components placed on the panel become children of the panel.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!