Click to See Complete Forum and Search --> : Double Space Richtextbox with EM_SETPARAFORMAT?


krainey
May 25th, 1999, 04:04 PM
I have been attempting to set a richtextbox to double spaced line spacing using EM_SETPARAFORMAT with the PARAFORMAT2 structure. I'm no C/C++ wizard, so I suspect my translation into VB terms may be part (or all) of my problem. Any insight to this would be immensely appreciated.

Keith


public Const MAX_TAB_STOPS = 32
public PARAFORM as paraformat2


Type paraformat2
cbSize as Integer '
'WPAD as Integer
dwMask as Long '
wNumbering as Integer
wReserved as Integer '; // redefined as wEffects in PARAFORMAT2
dxStartIndent as Long
dxRightIndent as Long
dxOffset as Long
wAlignment as Integer '
cTabCount as Integer
rgxTabs(MAX_TAB_STOPS) as Long
dySpaceBefore as Long '; // vertical spacing before para
dySpaceAfter as Long '; // vertical spacing after para
dyLineSpacing as Long '; // line spacing depending on Rule
sStyle as Integer ' // style handle
bLineSpacingRule as Integer '; // rule for line spacing (see tom.doc)
bCRC as Integer '; // reserved for CRC for rapid searching
wShadingWeight as Integer ' // shading in hundredths of a per cent
wShadingStyle as Integer '; // nibble 0: style, 1: cfpat, 2: cbpat
wNumberingStart as Integer ' ; // starting value for numbering
wNumberingStyle as Integer '; // alignment, roman/arabic, (), ), ., etc.
wNumberingTab as Integer ' ; // space bet 1st indent and 1st-line text
wBorderSpace as Integer '; // space between border and text (twips)
wBorderWidth as Integer '; // border pen width (twips)
wBorders as Integer ' ; // byte 0: bits specify which borders
' // nibble 2: border style, 3: color index

End Type



private Sub Command1_Click()
Dim x as Long
Const PFM_LINESPACING = &H800

PARAFORM.bLineSpacingRule = 2
PARAFORM.wReserved = 0
PARAFORM.dwMask = PFM_LINESPACING
PARAFORM.cbSize = len(PARAFORM)
x = SendMessage(RichTextBox1.hwnd, EM_SETPARAFORMAT, 0&, PARAFORM)
Debug.print x
End Sub