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.

6<br />

194 Day 6<br />

m<strong>in</strong>imized, its icon is conta<strong>in</strong>ed with<strong>in</strong> the MDI parent’s frame. When a regular (non-MDI)<br />

child w<strong>in</strong>dow is m<strong>in</strong>imized, its icon is placed on the W<strong>in</strong>dows desktop.<br />

To create an MDI application <strong>in</strong> <strong>C++</strong>Builder, you must set the ma<strong>in</strong> form’s FormStyle<br />

property to fsMDIForm. Each of the MDI child w<strong>in</strong>dows must have the FormStyle property<br />

set to fsMDIChild. Aside from that restriction, there is very little to creat<strong>in</strong>g an MDI<br />

application <strong>in</strong> <strong>C++</strong>Builder. You simply create the ma<strong>in</strong> w<strong>in</strong>dow form and one or more forms<br />

to be used as child w<strong>in</strong>dows, and you’re off and runn<strong>in</strong>g.<br />

Key Properties for Forms<br />

The TForm class has a lot of properties. Some of these properties are obscure and rarely used;<br />

others are widely used. I’ll touch on the most widely used properties here. I won’t <strong>in</strong>clude<br />

obvious properties like Color, Left, Top, Width, and Height unless they have a particular<br />

feature you should be aware of.<br />

Runtime and Design-Time Properties<br />

The properties outl<strong>in</strong>ed <strong>in</strong> this section can be set at design time and also at runtime. Almost<br />

all of these properties can be read at runtime as well.<br />

ActiveControl<br />

The ActiveControl property is used to set the control that will have focus when the form is<br />

activated. For <strong>in</strong>stance, you may want a particular edit control to have focus when a dialog<br />

box form is displayed. At design time the Value column for the ActiveControl property<br />

conta<strong>in</strong>s a list of components on the form. You can choose one of the components from this<br />

list to make that component the active control when the form is first displayed.<br />

AutoScroll, HorzScrollBar, and VertScrollBar<br />

Together, the AutoScroll, HorzScrollBar, and VertScrollBar properties control the scrollbars<br />

for a form. If AutoScroll is set to true (the default), scrollbars automatically appear when the<br />

form is too small to display all of its components. The HorzScrollBar and VertScrollBar<br />

properties each have several properties of their own that control the scrollbar operations.<br />

BorderStyle<br />

The BorderStyle property <strong>in</strong>dicates what type of border the form will have. The default value<br />

is bsSizeable, which creates a w<strong>in</strong>dow that can be sized. Nonsizable styles <strong>in</strong>clude bsDialog<br />

and bsNone.

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

Saved successfully!

Ooh no, something went wrong!