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

One of TEdit's constructors takes parameters for an initial text string, maximum string length (including the terminating NULL), and a bool flag specifying whether or not it Is a multiline edit control (in addition to the parent window, resource identifier, and placement coordinates).

This TEdit constructor is declared as follows:

TEdit(TWindow *parent, int resourceId, const
char far *text, int x, int y, int w, int h, UINT textLen = 0, bool multiline =
false, TModule *module = 0);

By default, the edit control has the styles ES_LEFT (for left-aligned text), ES_AUTOHSCROLL (for automatic horizontal scrolling), and WS_BORDER (for a visible border surrounding the edit control). Multiline edit controls get the additional styles ES_MULTILINE (specifies a multiline edit control), ES_AUTOVSCROLL (automatic vertical scrolling), WS_VSCROLL (vertical scroll bar), and WS_HSCROLL (horizontal scroll bar).

The following are typical edit control constructor calls, one for a single-line control, the other multiline:

Edit1 = new TEdit(this, ID_EDIT1, "Default Text", 20, 50, 150, 30, MAX_TEXTLEN, false);
Edit2 = new TEdit(this, ID_EDIT2, "", 260, 50, 150, 30, MAX_TEXTLEN, true);

See Also