473,385 Members | 1,569 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to print a form

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
5 1581
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
* "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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Pat | last post by:
I would like to send the Print Preview of a MS Access form to a Snapshot file. The form contains an OLE graph. BACKGROUND A snapshot of a report is possible. If I could I would use a report to...
0
by: Malcolm Cook | last post by:
I've discovered: Using "File > Print Preview" in a form's datasheet view with a server Filter crashes access after previewing... ....that is, unless ServerFilterByForm has been turned off...
2
by: Paul Mendez | last post by:
I have a form that consists of 150 records and is still growing. there are times when I want to print a certain record of the form, say record 12. I go to file --> print and choose the page number...
5
by: Darren DeCoste | last post by:
I have an access project with a Form that has a Command button to print the current record. I would like to Print the record 3 times, changing a text field on each print. The standard code of...
3
by: sea | last post by:
I need to be able to print the current form because the form has an embedded object of a .gif file, so report will not work -- does anyone know the way to do this? I tried some code, not sure what...
5
by: Raman | last post by:
Hello friends, I want to print an ID card. I have one Windows Form that contains front and back side. The printer is printing both front and back side at a time. I am trying to send both sides...
2
by: Rodo | last post by:
Hi all, We have a "testing report" form at work that we fill with data (typing for now). The form has a table, other lines and a company logo. I can make a windows form that will get the data...
6
tdw
by: tdw | last post by:
the View Orders form in my Access database has a Print button on it. It has other buttons too, like Edit etc. These buttons used to be at the bottom of the form laid out horizontally, but this was...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
11
by: JWest46088 | last post by:
I'm having difficulty trying to figure out how to print a text file from a hash table one line at a time. I have the text file read into the hash table and can print the text file all at once, but I...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.