关于wxTextCtrl::SetSelection()的问题。 Topic is solved

这是wxWidgets论坛的中文版本。在这里,您可以用您的母语汉语讨论上面任一子论坛所涉及的所有关于wxWidgets的话题。欢迎大家参与到对有价值的帖子的中英互译工作中来!
Post Reply
00061205
Knows some wx things
Knows some wx things
Posts: 41
Joined: Mon Jun 16, 2008 3:43 am
Location: Beijing, China

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

Post by 00061205 » Sun Jul 27, 2008 4:43 am

为什么这函数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);
}
Regards,

00061205

liuqi5521
Earned some good credits
Earned some good credits
Posts: 103
Joined: Thu Apr 03, 2008 5:35 am
Location: China
Contact:

Post by liuqi5521 » Wed Jul 30, 2008 10:00 am

Code: Select all

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

00061205
Knows some wx things
Knows some wx things
Posts: 41
Joined: Mon Jun 16, 2008 3:43 am
Location: Beijing, China

Post by 00061205 » Wed Jul 30, 2008 11:31 am

liuqi5521 wrote:TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, wxT("TextCtrl1"), wxPoint(30,470), wxSize(461,21), wxTE_NOHIDESEL, wxDefaultValidator, wxT("TextCtrl1"));
太感谢了,困扰我好久。
Regards,

00061205

Post Reply