Dear All,
I encounted a problem with using Rich Edit control.
After I dynamic create the control on the Client Area, I can't use SetWindowText(..) to change the text. Can anyone show me the sample ?
Wallace.
Dear All,
I encounted a problem with using Rich Edit control.
After I dynamic create the control on the Client Area, I can't use SetWindowText(..) to change the text. Can anyone show me the sample ?
Wallace.
Wallace@Kuo,
SetWindowText() does not work for richedit control. You may want to take at look at the work of PlanetCPP-Chris(Hound)/Micheal(xix)
I have downloaded the CPP project from that site and it is working perfectly.
Thanks for jbp2004 reply. I'll try to download the sample for studing.Quote:
Originally Posted by jbp2004
Another question, I have the sample code for changing the font of Rich Edit control, and its written by MFC as below:
CFont font;
font.CreateStockObject(ANSI_FIXED_FONT);
m_wndEditCtrl.SetFont(&font);
....
How do I implement the code with API ? In API, the CreateStockObject() and SetFont() are delivered from which function call ?
Wallace.
Code:HFONT hFont = (HFONT)GetStockObject(ANSI_FIXED_FONT);
SendMessage(hWndRich, WM_SETFONT, (WPARAM)hFont, TRUE);
Quote:
Originally Posted by ovidiucucu
thanks for Ovidiucucu reply.
I use the way listed below to change the font style; I think they are the same.
hf = CreateFont(
16, 0, 0, 0,
FW_NORMAL, FALSE, FALSE, FALSE,
ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, DEFAULT_PITCH | FF_SWISS,
"Courier New");
Wallace.