Hi,

In my windows application, I have a form and I placed an UserControl on
the form. I placed lot of edit controls on the UserControl.

Is there a way to print the entire UserControl just as it appears on
screen? This is something similar to Print Screen functionality, which
captures the whole screen as an image. But I want to capture just part
of the screen, which is usercontrol. If the usercontrol has scrollbars,
I want to include the hidden portion as well in the print
functionality.

Basically, I want to have a button on the form with a caption "Print
Page", that should capture the entire UserControl as an image including
any hidden scrollbar region and send it to the printer.

Is this possible? Any ideas..

Thanks,
Raj

Re: Printing the entire UserControl - as is.. by Bob

Bob
Tue Oct 18 02:20:14 CDT 2005

Use interop and the PrintWindow API.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Ramuseco Limited .NET consulting
http://www.ramuseco.com

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Raj" <rajmuthusamy@decadesoftware.com> wrote in message
news:1129579972.307740.169370@g14g2000cwa.googlegroups.com...
> Hi,
>
> In my windows application, I have a form and I placed an UserControl on
> the form. I placed lot of edit controls on the UserControl.
>
> Is there a way to print the entire UserControl just as it appears on
> screen? This is something similar to Print Screen functionality, which
> captures the whole screen as an image. But I want to capture just part
> of the screen, which is usercontrol. If the usercontrol has scrollbars,
> I want to include the hidden portion as well in the print
> functionality.
>
> Basically, I want to have a button on the form with a caption "Print
> Page", that should capture the entire UserControl as an image including
> any hidden scrollbar region and send it to the printer.
>
> Is this possible? Any ideas..
>
> Thanks,
> Raj
>