Visual Studio Development Bookmark and Share   
 index > Visual Basic Express Edition > Specify where to print textbox using printform
 

Specify where to print textbox using printform

I made a form that has controls and some textboxs.
The form is the same size as the paper i am using 4.24" x 5.5"

I can print it using printform.

However I want the textboxes to printout at same location on the paper as I placed them on the form.

They seem to printout centered in the form.

I dont seem to see if its a margin issue or some technique to speciify actual print location on the paper of the textboxes.
Have done search on microsoft and web forums.

any ideas?

thx
CharlieRussell  Wednesday, October 14, 2009 3:10 AM


This fixed it, was a margin issue.


PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Left = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Right = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Top = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Bottom = 0



I am setting the printer for a custom size, my form is 4.25" x 5.5"

I would like to just specifify paper size using printform, but cant find if this is a parameter that can set, am experimenting.

CharlieRussell  Friday, October 16, 2009 2:08 AM
Hmm I have tried printform helpercomponent which says can use bounding rectangle to specify where on page the richtextbox prints, but doesnts eem to work.

Have tried various coding things like 3graphics drawstring



any ideas appreciated


I am going try something different an make it an image and then print the image, see if I cna control where the text appears on the page that way.
CharlieRussell  Thursday, October 15, 2009 2:45 AM
Hi CharlieRussell,

Welcome to MSDN forums!
I think you can look into the following links for some information, they all talk about how to print a form.
http://social.msdn.microsoft.com/forums/en-US/Vsexpressvb/thread/9ed0755f-b4ac-4850-8645-06e4a528e8ed/
http://social.msdn.microsoft.com/Forums/en-US/vbpowerpacks/thread/fe6580a2-ea66-48c5-b9cd-da51bdeb801a
http://social.msdn.microsoft.com/forums/en-US/vbgeneral/thread/9e25f8a0-fcbc-4a8a-9134-55ad2b718887

Regards
Jeff Shan
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Jeff Shan  Thursday, October 15, 2009 7:54 AM


This fixed it, was a margin issue.


PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Left = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Right = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Top = 0

PrintForm1.PrinterSettings.DefaultPageSettings.Margins.Bottom = 0



I am setting the printer for a custom size, my form is 4.25" x 5.5"

I would like to just specifify paper size using printform, but cant find if this is a parameter that can set, am experimenting.

CharlieRussell  Friday, October 16, 2009 2:08 AM

You can use google to search for other answers

Custom Search

More Threads

• Run code from application
• .ToString() Function
• Answer:Building a OS in VB.Net
• Index Property ... was removed ????
• Using Double Buffering on Panels in VB
• VB express connect string to SQL 2005 express issue.
• Find text everywhere from screen
• how to get css data from site in vb
• More Application Settings Headaches
• Shutdown through code?