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

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

VCL Components<br />

Method Description<br />

Invalidate Requests that the component be redrawn. The component will be<br />

redrawn at W<strong>in</strong>dows’s earliest convenience.<br />

Perform Allows a component to send a message to itself directly rather<br />

than go<strong>in</strong>g through the W<strong>in</strong>dows messag<strong>in</strong>g system.<br />

Refresh Requests that a component be redrawn immediately and erases<br />

the component prior to repa<strong>in</strong>t<strong>in</strong>g.<br />

Repa<strong>in</strong>t Requests that a component be redrawn immediately. The<br />

component’s background is not erased prior to repa<strong>in</strong>t<strong>in</strong>g.<br />

SetBounds Allows you to set the Top, Left, Width, and Height properties all<br />

at one time. This saves time over hav<strong>in</strong>g to set them <strong>in</strong>dividually.<br />

SetFocus Sets the focus to a component and makes it the active component.<br />

Applies only to w<strong>in</strong>dowed components.<br />

Update Forces an immediate repa<strong>in</strong>t of the control. Typically, you should<br />

use Refresh or Repa<strong>in</strong>t to repa<strong>in</strong>t components.<br />

Now let’s take look at some of the events to which a component is most likely to respond.<br />

Common Events<br />

As with properties and methods, there are some events that will be responded to most often.<br />

Components cover a wide variety of possible W<strong>in</strong>dows controls, so each component will have<br />

<strong>in</strong>dividual needs. Events specific to forms are not covered here because I covered that<br />

<strong>in</strong>formation on Day 6. The most commonly used events are listed <strong>in</strong> Table 8.3.<br />

Table 8.3. Commonly handled component events.<br />

Event Description<br />

OnChange This event is triggered when a control changes <strong>in</strong> one way or another.<br />

Exact implementation depends on the component.<br />

OnClick Sent when the component is clicked with either mouse button.<br />

OnDblClick This event occurs when the user double-clicks the component.<br />

OnEnter This event occurs when a w<strong>in</strong>dowed component receives focus (is<br />

activated).<br />

OnExit This event occurs when a w<strong>in</strong>dowed component loses focus as the<br />

result of the user switch<strong>in</strong>g to a different control. It does not occur,<br />

283<br />

cont<strong>in</strong>ues<br />

8

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

Saved successfully!

Ooh no, something went wrong!