Justifying Text in a RichText control

  • Thread starter Thread starter FinallyInSeattle
  • Start date Start date
F

FinallyInSeattle

I'm attempting to format rich text with C# by sending messages to the
underlying richedit control.

The text can be formatted by sending an EM_SETPARAFORMAT message.
However, when I set the wAlignment to be PFA_JUSTIFY, it doesn't work.
I know that this option only works with Rich Edit 2.0 or later
version. Wouldn't VS .Net 2003 be using at least that version of the
control (or newer)? Has anyone gotten this to work?

Thanks in advance!
 
This works best by using the ITextDocument interface of the richtextbox. You
can check www.vbaccelerator.com , there is a richtextbox control there which
would answer all your concerns, unfornately the code is in vb so you will
have to translate to c#. Of note you should be using the Paraformat2
structure with the sendmessage api to get the justification done.
 
Back
Top