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 / Languages / VB.NET / November 2006

Tip: Looking for answers? Try searching our database.

Wrong Margins - How To ?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Antonio Paglia - 22 Nov 2006 14:38 GMT
On VS2005:

I define my own print document class like this

Class MyPrintDocument
   Inherits PrintDocument

   Private Sub PrintDocumentPrinter_PrintPage(ByVal sender As Object, ByVal
e As System.Drawing.Printing.PrintPageEventArgs) Handles Me.PrintPage
       e.Graphics.DrawRectangle(Pens.Black,
Me.DefaultPageSettings.Margins.Left, Me.DefaultPageSettings.Margins.Top,
200, 200)
       e.HasMorePages = False
   End Sub

End Class

Then, I want to print at top/upper corner an square of 2x2 inchs. Margins
have been configured to 1 inch

       Dim pd As New MyPrintDocument
       pd.DefaultPageSettings.PaperSize = New PaperSize("CustomSize", 827,
1169)
       pd.DefaultPageSettings.Margins = New Margins(100, 100, 100, 100)
       pd.Print()

I have notice that the rectangle is not at 1 inch from the left and top
edge, but 1.1 inch to left and 1.2 inch at top margin. I can't print exactly
at 1 inch or any other margin. Is There a way to do this ??

Please, help me
TIA

Antonio
lord.zoltar@gmail.com - 22 Nov 2006 16:03 GMT
> On VS2005:
>
[quoted text clipped - 30 lines]
>
> Antonio

In my experience, it never prints EXACTLY the way it's told. I usually
find the printing is off by  +/- 2 cm. Maybe it's the printer (I only
have 1 to experiment with). What happens when you print on a different
printer?

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.