|
-
August 3rd, 2004, 09:13 PM
#1
How to dynamic create a Rich Edit control on the Client Area ?
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.
-
August 4th, 2004, 12:27 AM
#2
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.
I am inviting you to join GreenZap. It is just like PAYPAL but it is more rewarding! You get $25 when you join (FREE to sign up) AND you get rewarded also when someone opened an account using your GreenZap promo code! GreenZap is launching June 1st.
Click here and PREREGISTER
Have a break. Visit JonelsPlace
-
August 5th, 2004, 01:01 AM
#3
 Originally Posted by jbp2004
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.
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.
-
August 7th, 2004, 09:28 AM
#4
Code:
HFONT hFont = (HFONT)GetStockObject(ANSI_FIXED_FONT);
SendMessage(hWndRich, WM_SETFONT, (WPARAM)hFont, TRUE);
-
August 12th, 2004, 04:27 AM
#5
 Originally Posted by ovidiucucu
Code:
HFONT hFont = (HFONT)GetStockObject(ANSI_FIXED_FONT);
SendMessage(hWndRich, WM_SETFONT, (WPARAM)hFont, TRUE);
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.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|