I want to print the controls on a form. For that I have a panel on my form that have all necessary controls in the container. For this panel and for the controls in the controls collection I call recursive a print method in that I print the control to a bitmap.
-- definition static MethodInfo invokePaintInfo = typeof(Control).GetMethod("InvokePaint", BindingFlags.Instance | BindingFlags.NonPublic);
-- th callinvokePaintInfo.Invoke(control, paintArgs); It works and it paints the control to the bitmap and I can print the bitmap. On Windows 7 I have the problem that with ‘Performance Options: Smooth edges of screen fonts’ the printed fonts are very bad. I found out that when I change UseOsThemes from Default to False
ctrl..UseOsThemes = DefaultableBoolean.False;
it works better. But now I have the problem that the border is not printed on the TextEditor Controls. For UltraLabel it’s works.
Is their a better way to solve the problem?
Thanks
Hi,
I just wanted to know if you were able to solve your issue based on my suggestions or you still need help?
Just let me know.
Thank you.
Thanks for your sample,
it does not realy work for me, but it's possible that I make something wrong.
I think the problem is that I have a panel that I wan't to print -> Important panel with autoscroll=true and childcontrols that are not in the visible area.
The size to print I get with panel.GetPreferedSize.
Joachim