Problem with PARAFORMAT2 with PFM_BORDER [modified]
-
hi I want to get an outside border in a Rich Edit Control using PARAFORMAT2 structure with PFM_BORDER set at the click of a button. The code is written as: OnBorder() { CRichEditCtrl& RCtrl=GetRichEditCtrl(); PARAFORMAT2 PF; ZeroMemory(&PF,sizeof(PF)); ::SendMessage(RCtrl.m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM) &PF); PF.dwMask=PFM_BORDER; PF.wBorderSpace=2000; PF.wBorderWidth=5000; PF.wBorders=32|0|0; PF.cbSize=sizeof(PF); ::SendMessage(RCtrl.m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&PF); } But I dont get the border. Please Suggest. Barna -- modified at 4:38 Wednesday 2nd May, 2007 Barna
-
hi I want to get an outside border in a Rich Edit Control using PARAFORMAT2 structure with PFM_BORDER set at the click of a button. The code is written as: OnBorder() { CRichEditCtrl& RCtrl=GetRichEditCtrl(); PARAFORMAT2 PF; ZeroMemory(&PF,sizeof(PF)); ::SendMessage(RCtrl.m_hWnd, EM_GETPARAFORMAT, 0, (LPARAM) &PF); PF.dwMask=PFM_BORDER; PF.wBorderSpace=2000; PF.wBorderWidth=5000; PF.wBorders=32|0|0; PF.cbSize=sizeof(PF); ::SendMessage(RCtrl.m_hWnd, EM_SETPARAFORMAT, 0, (LPARAM)&PF); } But I dont get the border. Please Suggest. Barna -- modified at 4:38 Wednesday 2nd May, 2007 Barna
I haven't tried this, but what happens if you specify a border style instead of "none"; // Outside borders, 3/4 point style PF.wBorders=32|(1<<8)|0;
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
-
I haven't tried this, but what happens if you specify a border style instead of "none"; // Outside borders, 3/4 point style PF.wBorders=32|(1<<8)|0;
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
-
Thanks for your response. Tried with your solution. But the problem still remais. The border does not appear. Thanks Barna Barna
I tested this a bit. Seems the RichEdit control (2.0+) supports the paragraph borders but doesn't/can't display them. If you copy text from your control into Word, you'll see the borders. That's as much as I know at this point :) Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
-
I tested this a bit. Seems the RichEdit control (2.0+) supports the paragraph borders but doesn't/can't display them. If you copy text from your control into Word, you'll see the borders. That's as much as I know at this point :) Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder
Thanks again for your response. Yes I tested this too and found what you wrote. If you look at PARAFORMAT2 structure in MSDN it is written "The wBorderSpace, wBorderWidth, and wBorders members are included for compatibility with Microsoft Word; the rich edit control stores the values but does not use them to display text. To use this member, set the PFM_BORDER flag in the dwMask member." But how do I display this border. The thing is that then should I have to write sepearte code to draw a border? Another thing is that if it (PARAFORMAT2) does support wBorderSpace, wBorderWidth, and wBorders but does not display, then how do programmers use this feature or in what context does wBorderSpace, wBorderWidth, and wBorders helps programmers. Barna
-
Thanks again for your response. Yes I tested this too and found what you wrote. If you look at PARAFORMAT2 structure in MSDN it is written "The wBorderSpace, wBorderWidth, and wBorders members are included for compatibility with Microsoft Word; the rich edit control stores the values but does not use them to display text. To use this member, set the PFM_BORDER flag in the dwMask member." But how do I display this border. The thing is that then should I have to write sepearte code to draw a border? Another thing is that if it (PARAFORMAT2) does support wBorderSpace, wBorderWidth, and wBorders but does not display, then how do programmers use this feature or in what context does wBorderSpace, wBorderWidth, and wBorders helps programmers. Barna
BarnaKol wrote:
But how do I display this border. The thing is that then should I have to write sepearte code to draw a border?
When I searched for answers on this, I got the impression that it was added for version 2 of the RichEdit control but not implemented. The paragraph border settings are in the text but the control doesn't draw them. Somehow I assumed they would be drawn in later versions of the control but that is not the case, as you've seen. I'm on XP SP2 so my RichEdit control should be version 4+. I guess the control has all the features of Word these days, but we can't use them. We have to use Word :^) Mark
"Posting a VB.NET question in the C++ forum will end in tears." Chris Maunder