By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,963 Members | 1,815 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,963 IT Pros & Developers. It's quick & easy.

How to print a form

P: n/a
I'd like to be able to print my form or some controls on it. I have found
lots of references for this but they all talk about printing a text document
from a form.

Any help will be appreciated
Dino

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com

Nov 20 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Capture an image of the form as outlined in the GDI+ FAQ then use the Print
system to send this bitmap to the printer.

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

The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm

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

Read my Blog at http://bobpowelldotnet.blogspot.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:HNvpb.114846$EO3.73241@clgrps13...
I'd like to be able to print my form or some controls on it. I have found
lots of references for this but they all talk about printing a text document from a form.

Any help will be appreciated
Dino

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com

Nov 20 '05 #2

P: n/a
* "Dino M. Buljubasic" <di*************@rivusglobal.com> scripsit:
I'd like to be able to print my form or some controls on it. I have found
lots of references for this but they all talk about printing a text document
from a form.


Screenshot:

<http://www.mvps.org/dotnet/dotnet/samples/windowsandforms/downloads/Screenshot.zip>

Printing:

<http://msdn.microsoft.com/library/en-us/dnvssamp/html/vbcs_SimplePrinting.asp>

--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #3

P: n/a
I am doing that but it has poor quality. When image is captured and sent to
a printer, the images look bloored, I need to have sharp printout since it
is a form.

Thanks for your help
Dino

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Capture an image of the form as outlined in the GDI+ FAQ then use the Print system to send this bitmap to the printer.

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

The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm

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

Read my Blog at http://bobpowelldotnet.blogspot.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:HNvpb.114846$EO3.73241@clgrps13...
I'd like to be able to print my form or some controls on it. I have found lots of references for this but they all talk about printing a text

document
from a form.

Any help will be appreciated
Dino

--


-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com


Nov 20 '05 #4

P: n/a
HI Bob,

I do capture the image of my form, but the quality is very poor.

I am doing the same other way, by looping trough the controls of my form and
painting them directly to the printer, ... works fine, but forms are to
complex, so I would have to write different printing procedure for each
form.

I noticed that when I use Alt + PrintScr on my form, then paste it on a word
document, the image has just perfect quality and the printout, too. So I am
wondering how can I do Alt+PrintScr programatically on an active form and
then paste the image in a word document and send that document to the
printer.

Any help will be gratefully appreciated,
Dino

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com
"Bob Powell [MVP]" <bob@_spamkiller_bobpowell.net> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Capture an image of the form as outlined in the GDI+ FAQ then use the Print system to send this bitmap to the printer.

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

The October edition of Well Formed is now available.
Find out how to use DirectX in a Windows Forms control
http://www.bobpowell.net/currentissue.htm

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

Read my Blog at http://bobpowelldotnet.blogspot.com

"Dino M. Buljubasic" <di*************@rivusglobal.com> wrote in message
news:HNvpb.114846$EO3.73241@clgrps13...
I'd like to be able to print my form or some controls on it. I have found lots of references for this but they all talk about printing a text

document
from a form.

Any help will be appreciated
Dino

--


-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com


Nov 20 '05 #5

P: n/a
Hi Herfried,

Screenshots application you sent to me seams to be exacltly what I am trying
to do but it works fine for capturing whole desctop. I played little bit
with it and it seams to me that it does not do the job when I want to
capture only active form on the desctop.

All I changed to achieve this is inside the event:

Private Sub btnCapture_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnCapture.Click
m_ssgen.Window = Me.Handle // I added this line

Me.picScreenshot.Image = m_ssgen.Capture()
End Sub

Any help will be appreciated,

Thank you, Dino

--
-------------------------------------------------------------------------
FIGHT BACK AGAINST SPAM!
Download Spam Inspector, the Award Winning Anti-Spam Filter
http://mail.giantcompany.com
"Herfried K. Wagner [MVP]" <hi***************@gmx.at> wrote in message
news:bo*************@ID-208219.news.uni-berlin.de...
* "Dino M. Buljubasic" <di*************@rivusglobal.com> scripsit:
I'd like to be able to print my form or some controls on it. I have found lots of references for this but they all talk about printing a text document from a form.
Screenshot:

<http://www.mvps.org/dotnet/dotnet/sa...nloads/Screens
hot.zip>
Printing:

<http://msdn.microsoft.com/library/en...mplePrinting.a
sp>
--
Herfried K. Wagner
MVP VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>

Nov 20 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.