简体   繁体   English

C++中如何给wxTextCtrl文本框添加READONLY样式

[英]How to add the READONLY style to a wxTextCtrl text box in C++

was wondering how to add the REARONLY style to a TextCtrl in C++ for the wxWidgets framework.想知道如何为 wxWidgets 框架将 REARONLY 样式添加到 C++ 中的 TextCtrl。 Im a complete noob to C++ and wxWidgets and couldn't find an comprehensible answer online.我是 C++ 和 wxWidgets 的完全菜鸟,无法在线找到可理解的答案。 All I want to do is have a basic on screen text box holding a label text for an input text box below it.我想要做的就是有一个基本的屏幕文本框,其中包含一个 label 文本作为其下方的输入文本框。 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));

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 . long style = 0wxTextCtrl wxSize size之后的 wxTextCtrl 构造函数参数。 Required style is wxTE_READONLY .所需的样式是wxTE_READONLY

You could also use wxStaticText .您也可以使用wxStaticText

Thank you.谢谢你。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM