## 27.3 Adding a Text Control to the Frame

- Again, we use inheritance to define our own, more interesting, type of frame.
- This frame contains a text area into which users can type any text.

  >     class TextFrame : public wxFrame
  >     {
  >     public:
  >        TextFrame();
  >     private:
  >        wxTextCtrl* text;
  >     };

- The constructor initializes the base class and the text control:

  >     TextFrame::TextFrame()
  >        : wxFrame(NULL, -1, "TextFrame")
  >     {
  >        text = new wxTextCtrl(this, -1, "Type some text here!",
  >           wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE);
  >     }

- Note that first parameter (`this`) indicates that the parent of the text control is this frame.
- The next two parameters indicate a default window ID and initial contents of the text control.
- The next two parameters indicate default size and position.
- The final parameter turns on the "multiline" style, which allows the text control to hold multiple lines of text.

prev |top |next