jaado
March 30th, 2010, 07:08 AM
Hi everyone,
After googling the web and trying different approaches to this problem I now turn to you.
My problem is this: I am in the early stage of developing a specialized word processor and I am using RichTextBox as editor. I would like to display the RichTextBox as wide as writable area of paper - that is, paperwidth excluding margins. And I would like to display a dotted line at the position where the writable area of the paper ends. And this is where my problems start.
I've tried to set the WYSIWIG mode as described i numerous articles but when I calculate number of lines that fit in my RichTextBox the result will never be the same as displayed in print preview.
To calculate numer of lines that fit in RichTextBox I fetch graphics object from default printer settings and divide it's printable area with GetHeight(printerGraphics) of current font.
When comparing layout of text in RichTextBox with text rendered by RichtTextBox in print preview it looks like line spacing in print preview is lower than line spacing displayed in RichTextBox.
If anybody has a solution for this, an implementation of their own or other hints that will point me in right direction I would be so happy.
/
Jan Adolfsson
After googling the web and trying different approaches to this problem I now turn to you.
My problem is this: I am in the early stage of developing a specialized word processor and I am using RichTextBox as editor. I would like to display the RichTextBox as wide as writable area of paper - that is, paperwidth excluding margins. And I would like to display a dotted line at the position where the writable area of the paper ends. And this is where my problems start.
I've tried to set the WYSIWIG mode as described i numerous articles but when I calculate number of lines that fit in my RichTextBox the result will never be the same as displayed in print preview.
To calculate numer of lines that fit in RichTextBox I fetch graphics object from default printer settings and divide it's printable area with GetHeight(printerGraphics) of current font.
When comparing layout of text in RichTextBox with text rendered by RichtTextBox in print preview it looks like line spacing in print preview is lower than line spacing displayed in RichTextBox.
If anybody has a solution for this, an implementation of their own or other hints that will point me in right direction I would be so happy.
/
Jan Adolfsson