OWLNext    7.0
Borland's Object Windows Library for the modern age
Loading...
Searching...
No Matches
Querying Edit Controls

Often, you want to query an edit control to store the entry for later use.

TEdit has a number of querying member functions. Many of the edit control query and modification member functions return, or require you to specify, a line number or a character's position in a line. All of these indexes start at zero. In other words, the first line is line zero and the first character of a line is character zero.

The following table summarizes TEdit's query member functions.

Member functionDescription
TEdit::IsModifiedFind out if text has changed.
TEdit::GetTextRetrieve all text.
TEdit::GetLineRetrieve a line.
TEdit::GetNumLinesGet number of lines.
TEdit::GetLineLengthGet length of a given line.
TEdit::GetSelectionGet index of selected text.
TEdit::GetSubTextGet a range of characters.
TEdit::GetLineIndexCount characters before a line.
TEdit::GetLineFromPosFind the line containing an index.
TEdit::GetRectGet formatting rectangle.
TEdit::GetHandleGet memory handle.
TEdit::GetFirstVisibleLineGet index of first visible line.
TEdit::GetPasswordCharGet character used in passwords.
TEdit::GetWordBreakProcGet word-breaking procedure.
TEdit::CanUndoFind out if edit can be undone.

Text that spans lines in a multiline edit control contains two extra characters for each line break: a carriage return ('\r') and a line feed ('\n'). TEdit's member functions retain the text's formatting when they return text from a multiline edit control. When you insert this text back into an edit control, paste it from the Clipboard, write it to a file, or print it to a printer, the line breaks appear as they did in the edit control. When you use query member functions to get a specified number of characters, be sure to account for the two extra characters in a line break.

See Also