NO

Author Topic: Add text to RichEdit control  (Read 3951 times)

Offline TimoVJL

  • Global Moderator
  • Member
  • *****
  • Posts: 1896
Add text to RichEdit control
« on: June 14, 2010, 03:19:05 pm »
Is there another/better way to add text to RichEdit-control ?

Code: [Select]
void Add2REdit(HWND hEdit, char *szText)
{
SETTEXTEX st = {ST_SELECTION, CP_ACP};

SendMessage(hEdit, EM_SETTEXTEX, (WPARAM)&st, (LPARAM)szText);
}
An example:
Code: [Select]
Add2REdit(hEdit, "{\\rtf\\ansi\\deff0{\\fonttbl{\\f0 New Courier;}}Text1\\par \\b Text2\\par ");
Add2REdit(hEdit, "{\\rtf\\ansi\\deff0{\\fonttbl{\\f0 New Courier;}}Text3\\par \\b Text4\\par ");
« Last Edit: June 14, 2010, 07:08:50 pm by timovjl »
May the source be with you