Welcome to Dream.In.Code
Getting VB.NET Help is Easy!

Join 136,538 VB.NET Programmers for FREE! Get instant access to thousands of VB.NET experts, tutorials, code snippets, and more! There are 1,757 people online right now. Registration is fast and FREE... Join Now!




Print a form in VB 2008

 
Reply to this topicStart new topic

Print a form in VB 2008

ibsen19
17 Aug, 2008 - 07:14 AM
Post #1

New D.I.C Head
*

Joined: 17 Aug, 2008
Posts: 1

hi can somebody help me to print a specific form on visual studio 2008?
User is offlineProfile CardPM
+Quote Post

PsychoCoder
RE: Print A Form In VB 2008
17 Aug, 2008 - 07:22 AM
Post #2

using DIC.Core;
Group Icon

Joined: 26 Jul, 2007
Posts: 8,997



Thanked: 125 times
Dream Kudos: 8625
Expert In: VB, VB.Net, C#, SQL, ASP, ASP.Net, Web Development, HTML, CSS, Win32 API, Javascript, mySQL, J#, Boo.Net

My Contributions
Moved to VB.NET smile.gif
User is online!Profile CardPM
+Quote Post

Bort
RE: Print A Form In VB 2008
18 Aug, 2008 - 02:07 AM
Post #3

D.I.C Regular
Group Icon

Joined: 18 Sep, 2006
Posts: 419



Thanked: 4 times
Dream Kudos: 350
My Contributions
When I tried to do this, I needed to download the Visual Basic PowerPacks 2.0 and install that. This was with VB 2005 Express though, I think 2008 already has it built in.

You need to use the PrintForm function.

Hope this help,
Bort
User is offlineProfile CardPM
+Quote Post

dineeshd
RE: Print A Form In VB 2008
18 Aug, 2008 - 02:15 AM
Post #4

D.I.C Addict
Group Icon

Joined: 30 Jun, 2008
Posts: 578



Thanked: 16 times
Dream Kudos: 575
My Contributions
PrintForm method of vb6 no longer seems to be supported by VB.Net. Anyway there are some work arounds to do so. Check the below article... smile.gif
Printing a Windows Form
User is offlineProfile CardPM
+Quote Post

shunnoo
RE: Print A Form In VB 2008
18 Aug, 2008 - 02:49 AM
Post #5

New D.I.C Head
*

Joined: 18 Aug, 2008
Posts: 1

QUOTE(dineeshd @ 18 Aug, 2008 - 03:15 AM) *

PrintForm method of vb6 no longer seems to be supported by VB.Net. Anyway there are some work arounds to do so. Check the below article... smile.gif
Printing a Windows Form

PrintForm is builtin in Visual Studio 2008.
To print the complete client area of a scrollable form
In the Toolbox, click the Visual Basic PowerPacks tab and then drag the PrintForm component onto the form.

The PrintForm component will be added to the component tray.
In the Properties window, set the PrintAction property to PrintToPrinter.
Add the following code in the appropriate event handler (for example, in the Click event handler for a PrintButton).

PrintForm1.Print(Me, PowerPacks.Printing.PrintForm.PrintOption.Scrollable)

By default, only the currently visible part of the form is printed; if a user has resized the form at run time, the image may not print as intended So if you used Print Option Scrolllable It will print complete form


User is offlineProfile CardPM
+Quote Post

Bort
RE: Print A Form In VB 2008
18 Aug, 2008 - 03:02 AM
Post #6

D.I.C Regular
Group Icon

Joined: 18 Sep, 2006
Posts: 419



Thanked: 4 times
Dream Kudos: 350
My Contributions
Nice Shunnoo, well explained smile.gif

Welcome to DIC.
User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 10:28PM

Live VB.NET Help!

VB.NET Tutorials

Reference Sheets

VB.NET Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month