Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有这个 textctrl
FTextCtrl = new wxTextCtrl(parent, wxID_ANY, _("Text"), wxPoint(20, 20), wxDefaultSize, wxTE_CENTRE | wxTE_PROCESS_ENTER, wxDefaultValidator, _T("ID_TC"));
对于这个基于编程逻辑的控件,我想在文本字段中插入一个可编辑的字符。我们怎么能这样做呢?
要在给定位置插入文本,您应该使用SetSelection()设置插入点(通过在所需位置创建一个空选择),然后WriteText(). 当然,如果你只是想附加文本,你可以AppendText()直接使用。
SetSelection()
WriteText()
AppendText()
最后,您可能决定只使用ChangeValue()来替换整个值,而不是摆弄这些函数。
ChangeValue()