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 />

196 Day 6<br />

algorithm. (Z-order<strong>in</strong>g is what W<strong>in</strong>dows uses to decide where it displays a new w<strong>in</strong>dow on<br />

the screen. If the new w<strong>in</strong>dow does not have specific placement <strong>in</strong>formation, it will be<br />

displayed just below and to the right of the last w<strong>in</strong>dow displayed on the screen.) The<br />

poScreenCenter option causes the form to be displayed <strong>in</strong> the center of the screen each time<br />

it is shown.<br />

Visible<br />

The Visible property controls whether the form is <strong>in</strong>itially visible. This property is not<br />

particularly useful at design time, but at runtime it can be read to determ<strong>in</strong>e whether the form<br />

is currently visible. It can also be used to hide or display the form.<br />

W<strong>in</strong>dowState<br />

The W<strong>in</strong>dowState property can be read to determ<strong>in</strong>e the form’s current state (maximized,<br />

m<strong>in</strong>imized, or normal). It can also be used to <strong>in</strong>dicate how the form should <strong>in</strong>itially be<br />

displayed. Choices are wsM<strong>in</strong>imized, wsMaximized, and wsNormal.<br />

Runtime-Only Properties<br />

Some properties can be accessed only at runtime through code. The follow<strong>in</strong>g are the most<br />

commonly used runtime properties.<br />

ActiveMDIChild<br />

When read, the ActiveMDIChild property returns a po<strong>in</strong>ter to the currently active MDI child<br />

w<strong>in</strong>dow. This property is read-only.<br />

Canvas<br />

The form’s canvas represents the draw<strong>in</strong>g surface of the form. The Canvas property gives you<br />

access to the form’s canvas. By us<strong>in</strong>g the Canvas property you can draw bitmaps, l<strong>in</strong>es, shapes,<br />

or text on the form at runtime. Most of the time you will use a Label component to draw text<br />

on a form, an Image component to display graphics, and a Shape component to draw shapes.<br />

However, there are times when you need to draw on the canvas at runtime and the Canvas<br />

property allows you to do that. The Canvas property can also be used to save an image of the<br />

form to disk.<br />

ClientRect<br />

The ClientRect property conta<strong>in</strong>s the top, left, right, and bottom coord<strong>in</strong>ates of the client<br />

area of the form. This is useful <strong>in</strong> a variety of programm<strong>in</strong>g situations. For <strong>in</strong>stance, you may<br />

need to know the client area’s width and height <strong>in</strong> order to place a bitmap on the center of<br />

the form.

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

Saved successfully!

Ooh no, something went wrong!