Page 1 of 1

wxTextCtrl::SetSelection(0, 1) didn't work

Posted: Wed Jul 30, 2008 6:30 am
by 00061205
Why SetSelection(0,1) didn't work in my app?

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);
}
Windows XP+C::B 8.02+wxWidgets 2.8.8
By the way, in ubuntu SetSelection(0,1) works great.

Posted: Wed Jul 30, 2008 11:34 am
by 00061205
I figured it out. The wxTE_NOHIDESEL style must be set in MSW to show the selection when it doesn't have focus.