Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / March 2006

Tip: Looking for answers? Try searching our database.

How can I print a Form?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Maxwell2006 - 17 Mar 2006 19:56 GMT
Hi,

What would be the best way to print all contents of a Form?

Thanks,
Max
Cerebrus - 19 Mar 2006 07:14 GMT
Hi,

Assuming this is a Windows Form, take a screenshot of the form
(Alt+PrintScreen), and then paste it into any Image editor application
(even MS PaintBrush). Then save or print it out.

HTH,

Regards,

Cerebrus.
Maxwell2006 - 20 Mar 2006 19:17 GMT
Sorry I didn't clearly explain the question.

How can I print a WinForms by using C# code.

I am looking to have a button in my form and after pressing the button, the
form and it's data get printed. The form might contain scrollable ritch text
boxes.

Thank you,
Max

> Hi,
>
[quoted text clipped - 7 lines]
>
> Cerebrus.
"Jeffrey Tan[MSFT]" - 21 Mar 2006 03:44 GMT
Hi Max,

Thanks for your feedback.

To programmatically capture a screen shoot of the form, we can p/invoke
Win32 BitBlt API. Please refer to "How do I capture a bitmap of a form?"
topic from the link below:
http://msdn.microsoft.com/smartclient/community/wffaq/default.aspx

Below is a VB.net sample:
"Code: Printing a Windows Form (Visual Basic)"
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dv_vbcode/h
tml/vbtskCodeExamplePrintingForm.asp

Hope this helps!

Best regards,
Jeffrey Tan
Microsoft Online Partner Support
Signature

Get Secure! - www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.


Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.