You won't find a solution. The two layout systems are different and you'll
All new articles provide code in C# and VB.NET.
"Damien" <damien.noonan@gmail.com> wrote in message
news:020c78b1-ca61-448f-b1ea-62cda3ff79f3@e23g2000prf.googlegroups.com...
> Hi,
>
> I really hope someone can help me with this.
> I'm developing a windows application (c#, .NET 2.0).
> In my solution I have created a custom control that extends the
> RichTextBox control.
> The reason for this is because I need to perform certain funtions that
> are not directly available through the RichTextBox control. i.e. set
> transparent control, load specific dll and ClassName based on OS
> (RichEd20, msftedit), etc. Another of the benefits was that I could
> use the documented WYSIWYG printing using the method outlined here
>
http://msdn2.microsoft.com/en-us/library/ms996492.aspx. >
> My problem is with the WYSIWYG printing and the slight differences
> between GDI and GDI+ coordinates and rendering. When I print preview
> the control text the font is very slightly in the wrong position and
> also a different size. This would normally not be noticable except
> that I am using graphics.DrawLine() based on EXACT COORDINATES AND
> LETTER SIZE from the extended richtextbox. So the result is that I am
> drawing lines that are almost in the correct positionbut not quite.
> Unfortuneatly, in this case close is very wrong.
>
> I know that I am mixing GDI and GDI+. And I don't want to loop through
> each line in the textbox and use graphics.DrawString() for printing
> because there could be images in the control.
>
> Does anybody have any solutions/suggestions for this?
>
> I hope I've been clear enough with my problem.
> Thanks,
> Damien