How do I implement the kind of OLE functionality found in MFC (CRichEditCtrl,
CRichEditView and CRichEditDoc) in a RichTextBox?
Are there any samples available (e.g. Wordpad for C#)?
--
Arild

Re: RichTextBox with OLE functionality by MarkR

MarkR
Thu Jun 16 23:55:31 CDT 2005

I'm not sure what OLE functionality you're looking for, but RichTextBox is
actually a thin wrapper around a RichEditCtrl. I know you can send EM_*
messages to it by using the Handle property, e.g.

public class RichTextBoxEx : RichTextBox
{
// send an EM_FORMATRANGE message to set font/bold/underline
public void Reformat()
{
...
wParam = blahblahblah; // check MSDN for specifics
lParam = 22;

// Send the actual Win32 message
res = SendMessage(Handle, EM_FORMATRANGE, wParam, lParam);
}
}




"Arild" <Arild@discussions.microsoft.com> wrote in message
news:B743ACB0-7B71-43A4-8161-2F32E2706398@microsoft.com...
> How do I implement the kind of OLE functionality found in MFC
> (CRichEditCtrl,
> CRichEditView and CRichEditDoc) in a RichTextBox?
> Are there any samples available (e.g. Wordpad for C#)?
> --
> Arild