Home > Mobile >  How to add the READONLY style to a wxTextCtrl text box in C
How to add the READONLY style to a wxTextCtrl text box in C

Time:05-19

was wondering how to add the REARONLY style to a TextCtrl in C for the wxWidgets framework. Im a complete noob to C and wxWidgets and couldn't find an comprehensible answer online. All I want to do is have a basic on screen text box holding a label text for an input text box below it. So, if im just ignorant to a better method, please let me know.

m_txt_box = new wxTextCtrl (this, wxID_ANY, "Test", wxPoint(100, 500), wxSize(30, 30));

CodePudding user response:

m_txt_box = new wxTextCtrl (this, wxID_ANY, "Test", wxPoint(100, 500), wxSize(30, 30), 
    wxTE_READONLY);

long style = 0 is wxTextCtrl constructor parameter after wxSize size. Required style is wxTE_READONLY.

CodePudding user response:

You could also use wxStaticText.

Thank you.

  • Related