Click here to Skip to main content
13,054,615 members (49,115 online)
Rate this:
Please Sign up or sign in to vote.
See more:
hello everyone.

i have a problem,i can not find the Solutions.
ZeroMemory(&pf2, sizeof(PARAFORMAT2));
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 22:10pm
Updated 25-Nov-12 22:31pm
Andrew Cherednik 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 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 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
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2017
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