Page 1 of 1

关于wxTextCtrl::SetSelection()的问题。

Posted: Sun Jul 27, 2008 4:43 am
by 00061205
为什么这函数SetSelection(0,1)在我的程序里没效果?

Code: Select all

ctrlaFrame::ctrlaFrame(wxWindow* parent,wxWindowID id)
{
   ......
    TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxSize(268,260), wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1"));
    ......
    TextCtrl1->SetValue(L"a;dlfkasfd\na;slfsa;fd\naslkdfas;f");
    TextCtrl1->SetSelection(0, 1);
}

Posted: Wed Jul 30, 2008 10:00 am
by liuqi5521

Code: Select all

TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxT("TextCtrl1"), wxPoint(30,470), wxSize(461,21), wxTE_NOHIDESEL, wxDefaultValidator, wxT("TextCtrl1"));

Posted: Wed Jul 30, 2008 11:31 am
by 00061205
liuqi5521 wrote:TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxT("TextCtrl1"), wxPoint(30,470), wxSize(461,21), wxTE_NOHIDESEL, wxDefaultValidator, wxT("TextCtrl1"));
太感谢了,困扰我好久。