RichTextBox with OLE functionality

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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#)?
 
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);
}
}
 
Back
Top