Click here to Skip to main content
Rate this: bad
Please Sign up or sign in to vote.
See more: C++ MFC WTL
hello everyone.

i have a problem,i can not find the Solutions.
	ZeroMemory(&pf2, sizeof(PARAFORMAT2));
	pf2.dwMask = PFM_LINESPACING;
	pf2.bLineSpacingRule = 4;
	pf2.dyLineSpacing = 300;
when i expand the line spacing by the code.
but the text is not centered vertically,and the text is close to the next line,the linespace Appears above.
i want to make the text be centered vertically in the line, what can i do?
i do not sure it can be achieved in the richedit,but i see that the text be centered vertically in a line,when i expand the line spacing in the officeword.
Posted 25-Nov-12 23:10pm
Edited 25-Nov-12 23:31pm
Andrew Cherednik at 26-Nov-12 17:04pm
do you set pf2.cbSize = sizeof(PARAFORMAT2) somewhere in your code after ZeroMemory call? Have you tried using dySpaceBefore and dySpaceAfter instead?
lin98666521 at 26-Nov-12 20:35pm
oh,i do not set pf2.cbSize = sizeof(PARAFORMAT2),but i have tried using dyspacebefore,it do not work.
lin98666521 at 26-Nov-12 20:49pm
hi,thank you very much,it is my oversight, i set pf2.cbSize = sizeof(PARAFORMAT2),it work well.
you shall submit your solution,i will take it.

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

pf2.cbSize = sizeof(PARAFORMAT2)
after you ZeroMemory the pf2 and it should all work

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Maciej Los 470
1 Sergey Alexandrovich Kryukov 424
2 OriginalGriff 360
3 Abhinav S 250
4 CHill60 240
0 Sergey Alexandrovich Kryukov 10,102
1 OriginalGriff 9,495
2 Peter Leow 5,241
3 Kornfeld Eliyahu Peter 3,373
4 Maciej Los 3,076

Advertise | Privacy | Mobile
Web01 | 2.8.150327.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100