创建一个wxTextAttr类的对象,在里面设定字体和颜色wxTextAttr::SetTextColour
();wxTextAttr::SetFont()。然后用wxTextCtrl::SetStyle()设定。
其实用smith或wxformbuilder的话都是可以设定的。字体是font,字体颜色是foreground。
Search found 41 matches
- Fri Aug 01, 2008 4:32 am
- Forum: wxWidgets Development (Chinese)
- Topic: 如何更改wxStaticText 和wxTextCtrl的字体和颜色?
- Replies: 4
- Views: 5075
- Fri Aug 01, 2008 4:22 am
- Forum: wxWidgets Development (Chinese)
- Topic: 应用程序句柄
- Replies: 1
- Views: 2747
- Wed Jul 30, 2008 11:34 am
- Forum: C++ Development
- Topic: wxTextCtrl::SetSelection(0, 1) didn't work
- Replies: 1
- Views: 1046
- Wed Jul 30, 2008 11:31 am
- Forum: wxWidgets Development (Chinese)
- Topic: 关于wxTextCtrl::SetSelection()的问题。
- Replies: 2
- Views: 2830
- Wed Jul 30, 2008 6:30 am
- Forum: C++ Development
- Topic: wxTextCtrl::SetSelection(0, 1) didn't work
- Replies: 1
- Views: 1046
wxTextCtrl::SetSelection(0, 1) didn't work
Why SetSelection(0,1) didn't work in my app? ctrlaFrame::ctrlaFrame(wxWindow* parent,wxWindowID id) { ...... TextCtrl1 = new wxTextCtrl(this, ID_TEXTCTRL1, _("Text"), wxDefaultPosition, wxSize(268,260), wxTE_MULTILINE, wxDefaultValidator, _T("ID_TEXTCTRL1")); ...... TextCtrl1->Se...
- Mon Jul 28, 2008 3:17 am
- Forum: wxWidgets Development (Chinese)
- Topic: 请问哪里可以下载cross-Platform GUI Programming的...
- Replies: 1
- Views: 2078
- Sun Jul 27, 2008 4:43 am
- Forum: wxWidgets Development (Chinese)
- Topic: 关于wxTextCtrl::SetSelection()的问题。
- Replies: 2
- Views: 2830
关于wxTextCtrl::SetSelection()的问题。
为什么这函数SetSelection(0,1)在我的程序里没效果? 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&qu...
- Sun Jul 27, 2008 2:59 am
- Forum: C++ Development
- Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
- Replies: 4
- Views: 2749
- Fri Jul 25, 2008 1:29 pm
- Forum: C++ Development
- Topic: Question about using wxSocketBase::Peek()
- Replies: 5
- Views: 2370
- Fri Jul 25, 2008 7:15 am
- Forum: C++ Development
- Topic: How to know wether there are more data in socket to be read?
- Replies: 2
- Views: 1117
Thanks, Max. I tried wxSocketBase::IsData(). It didn't work as I want.mc2r wrote:Not sure if this helps but wxSocketBase::IsData() might be what you are looking for. I don't use wx for networking stuff, so i've not tried it.
-Max
- Fri Jul 25, 2008 3:03 am
- Forum: C++ Development
- Topic: How to know wether there are more data in socket to be read?
- Replies: 2
- Views: 1117
How to know wether there are more data in socket to be read?
void netdbgFrame::OnSocketEvent(wxSocketEvent& event) { wxString s = _(""); char cBuf [257]; wxString wxstrBuf=wxT(""); wxSocketBase *sock = event.GetSocket(); strtemp=""; memset( cBuf, 0, 257 ); switch (event.GetSocketEvent()) { case wxSOCKET_INPUT : sock->Read(cB...
- Fri Jul 25, 2008 2:52 am
- Forum: C++ Development
- Topic: wxYield called recursively
- Replies: 6
- Views: 2625
ok found the solution with wxBook :) Will split up my application into several threads now. If you need more information why this happened, write me a msg and i will tell ya :) I got the same problem when i use wxSocketClient. How did you solve this problem? here http://forums.wxwidgets.org/viewtop...
- Fri Jul 25, 2008 1:25 am
- Forum: C++ Development
- Topic: Question about using wxSocketBase::Peek()
- Replies: 5
- Views: 2370
wow,mc2r wrote:FireMail had a similiar error with wxSocketClient and wxSocketServer in this thread. FireMail mentions you can message him and he will provide more details.
-Max
- Fri Jul 25, 2008 1:21 am
- Forum: C++ Development
- Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
- Replies: 4
- Views: 2749
Thanks, I'll try.SteveDowd wrote:Check out wxKeyEvent:
http://docs.wxwidgets.org/stable/wx_wxk ... wxkeyevent
then handle the event by checking to see if event.CmdDown + "a" keyCode was pressed, then call wxTextCtrl::SetSelection(0, LastCharPos);
- Thu Jul 24, 2008 1:54 pm
- Forum: C++ Development
- Topic: How to let the wxTextCtrl can select all by "ctrl+a&quo
- Replies: 4
- Views: 2749
How to let the wxTextCtrl can select all by "ctrl+a&quo
How let wxTextCtrl can select all by "ctrl+a"