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.

292 Day 8<br />

Table 8.4. cont<strong>in</strong>ued<br />

Item Applies To Description<br />

Runtime Properties<br />

Modified All Indicates whether the contents of the edit<br />

control have changed s<strong>in</strong>ce the last time<br />

the Modified property was set. After<br />

sav<strong>in</strong>g the contents of a Memo or RichEdit<br />

component to a file, you should set<br />

Modified to false.<br />

SelLength All Conta<strong>in</strong>s the length of the text currently<br />

selected <strong>in</strong> the edit control.<br />

SelStart All Conta<strong>in</strong>s the start<strong>in</strong>g po<strong>in</strong>t of the selected<br />

text <strong>in</strong> the edit control. The first character<br />

<strong>in</strong> the edit control is 0.<br />

SelText All Conta<strong>in</strong>s the currently selected text <strong>in</strong> an<br />

edit control.<br />

Edit controls have many common methods; they are too numerous to list here. The<br />

CutToClipboard(), CopyToClipboard(), PasteFromClipboard(), and Clear() methods deal<br />

with Clipboard operations and text manipulation. The GetSelTextBuff() and GetTextBuff()<br />

methods retrieve the selected text <strong>in</strong> the component and the entire text <strong>in</strong> the component,<br />

respectively. See the <strong>C++</strong>Builder onl<strong>in</strong>e help topics TEdit, TMaskEdit, TMemo, and TRichEdit<br />

for a complete list of methods perta<strong>in</strong><strong>in</strong>g to each type of edit component.<br />

The edit component events that you are most likely to be <strong>in</strong>terested <strong>in</strong> are dependent on the<br />

type of edit control you are us<strong>in</strong>g. In general, though, the OnEnter, OnExit, OnChange,<br />

OnKeyDown (or OnKeyPress), and OnKeyUp events will be the most widely used.<br />

The ListBox and ComboBox Components<br />

The ListBox and ComboBox components are also widely used. The ListBox component<br />

represents a standard W<strong>in</strong>dows list box, which simply presents a list of choices that the user<br />

can choose from. If the list box conta<strong>in</strong>s more items than can be shown at one time, scrollbars<br />

appear to allow access to the rest of the items <strong>in</strong> the list box.<br />

NEW TERM<br />

Some list boxes are owner-drawn list boxes. In an owner-drawn list box, the<br />

programmer takes the responsibility for draw<strong>in</strong>g the items <strong>in</strong> the list box.

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

Saved successfully!

Ooh no, something went wrong!