Olympus
asked on
RichEdit border problem (using API, not MFC)
I would like to increase the borders (more specifically, the spacing between text and the sides) of my dynamically created richedit control, much like the TRichEdit.BorderWidth property in Delphi. I have tried, according to the API docs, sending the EM_SETPARAFORMAT message with the wBorder and wBorderWidth fields filled out in the PARAFORMAT2 structure to no avail. As a matter of fact, no matter what values I plug in, nothing seems to happen. Anyone else run into this sort of thing?
g_hRichEdit = CreateWindowEx(WS_EX_CLIEN TEDGE, RICHEDIT_CLASS, 0, WS_VISIBLE | ES_MULTILINE |
ES_READONLY | WS_CHILD | WS_VSCROLL | ES_AUTOVSCROLL | ES_NOHIDESEL, 0, 0, 0, 0, g_wMain, 0, g_hInstance, 0);
SendMessage(g_hRichEdit, WM_SETFONT, (WPARAM)hFont, TRUE);
PARAFORMAT2 pf2;
memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_BORDER;
pf2.wBorderSpace = 0;
pf2.wBorderWidth = 5000;
pf2.wBorders = 0x20 | 0x400 | 0x5000; //
SendMessage(g_hRichEdit, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
g_hRichEdit = CreateWindowEx(WS_EX_CLIEN
ES_READONLY | WS_CHILD | WS_VSCROLL | ES_AUTOVSCROLL | ES_NOHIDESEL, 0, 0, 0, 0, g_wMain, 0, g_hInstance, 0);
SendMessage(g_hRichEdit, WM_SETFONT, (WPARAM)hFont, TRUE);
PARAFORMAT2 pf2;
memset(&pf2, 0, sizeof(pf2));
pf2.cbSize = sizeof(pf2);
pf2.dwMask = PFM_BORDER;
pf2.wBorderSpace = 0;
pf2.wBorderWidth = 5000;
pf2.wBorders = 0x20 | 0x400 | 0x5000; //
SendMessage(g_hRichEdit, EM_SETPARAFORMAT, 0, (LPARAM)&pf2);
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER