Click here to Skip to main content
Rate this: bad
good
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.
	PARAFORMAT2 pf2;
	ZeroMemory(&pf2, sizeof(PARAFORMAT2));
	pf2.dwMask = PFM_LINESPACING;
	pf2.bLineSpacingRule = 4;
	pf2.dyLineSpacing = 300;
	SetSel(iBPos,iEPos);
        SetParaFormat(pf2);
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
Edited 25-Nov-12 22:31pm
v2
Comments
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
good
Please Sign up or sign in to vote.

Solution 1

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

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

  Print Answers RSS
0 OriginalGriff 205
1 Sergey Alexandrovich Kryukov 185
2 jlopez788 144
3 Rob Philpott 100
4 Prakriti Goyal 97
0 OriginalGriff 6,837
1 Sergey Alexandrovich Kryukov 5,589
2 Maciej Los 3,479
3 Peter Leow 3,323
4 DamithSL 2,505


Advertise | Privacy | Mobile
Web03 | 2.8.140721.1 | Last Updated 26 Nov 2012
Copyright © CodeProject, 1999-2014
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