473,587 Members | 2,516 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Left & Right Margin Setting - System.Drawing. Printing.PrintP ageEventArgs

I'm a newby and I'm writing my first VB.NET print program!

I need to change the default left and right margins for my printed output

"e" is my "System.Drawing .Printing.Print PageEventArgs

By Default: e.PageSettings. Margins.Left = 100 and
e.PageSettings. Margins.Right=7 50

I have written code to set the values however
e.PageSettings. MarginBounds.Le ft = 20 and is ignored, when I read from it I
get the original values.

The interesting thing is that if I use the values in my write operation:
e.drawings.grap hics.drawstring it works!

So there might not be a problem - however I want to be sure since this
program will be used with many different windows drivers.

Any help would be appreciated

Thanks,

Fred

Nov 20 '05 #1
1 4904
* "Fred Nelson" <fr**@smartybir d.com> scripsit:
I need to change the default left and right margins for my printed output

"e" is my "System.Drawing .Printing.Print PageEventArgs

By Default: e.PageSettings. Margins.Left = 100 and
e.PageSettings. Margins.Right=7 50

I have written code to set the values however
e.PageSettings. MarginBounds.Le ft = 20 and is ignored, when I read from it I
get the original values.
Even if you assign the value and read it directly after assigning it?
The interesting thing is that if I use the values in my write operation:
e.drawings.grap hics.drawstring it works!


What does 'DrawString' have to do with margins?

--
Herfried K. Wagner [MVP]
<http://www.mvps.org/dotnet>
Nov 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
5689
by: sylvian stone | last post by:
Hi, I'm trying to do something that has always been easy with tables - namely use a three column layout, and above the main layout, show three images - one on the absolute left, one on the absolute right, and one in the middle. The one in the middle needs to be centered, as various browsers display slightly differently. However, using the...
0
1638
by: DotNetDummy | last post by:
Hi all, I am trying to set the printing setting e.g duplex mode etc. on a default printer when I.E object started printing a particular html doc. Here's the partial code, any help would be appreciated. I have been using system.drawing.printing method but not much help since drawing.printing required printDocument() object which...
1
2517
by: Rainbow | last post by:
Hi, I tried to change the print setting by PrintDialog dlg = new PrintDialog(); dlg.AllowSomePages = true; dlg.AllowSelection = true; dlg.Document = pd; dlg.PrinterSettings.MinimumPage = 1; dlg.PrinterSettings.MaximumPage = 1;
2
13604
by: John Smith | last post by:
Hey folks, I'm trying to print from a c# windows application using System.Drawing.Printing. My problem is that it doesn't matter what I put in for papersize, it always ignores what I tell it and always prints out the same thing. Landscape works though. Does anyone see any problems with this code? printDoc.PrinterSettings.PrinterName =...
19
11466
by: ashkaan57 | last post by:
Hi, I have a page in a right-to-left language and I am trying to make some bulleted lists using <ul>, but it puts the bullets to the left. Is there any way I can set the bullets to be on the right: ..lists { margin:2em 0 0 2em; } ..lists ul {
0
1180
by: > Adrian | last post by:
Ho can I move the margin to the left by adding which code below? Many thanks, Adrian. ************************** using System; using System.ComponentModel;
1
3797
by: jake | last post by:
When I draw (using DrawString() and other Draw...() methods) directly to the PrintDocument using the PrintDocument's PrintPageEventArgs e, the print-out comes out nice and sharp. But when I direct my graphics to memory first then using PrintDocument's PrintPageEventArgs e.DrawImage(), I get the image printed with the right scale and...
5
2705
by: Timeri | last post by:
This is a bit confusing until you actually see what I'm talking about but the main content of my page is not growing with the right column. I want the main content (left/larger column) to take into account the right deck (right column) so that both end at the same place. *********************************************************** Here's the...
3
5509
by: Noorain | last post by:
I designed a site. i want to header,footer,left & right column fixed but body information only scrolling. this site screen to be 800/600 px. i designed this way but when i used position fixed all information to show as displace. please help me. my coding are as below: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"...
0
7923
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7852
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8216
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8349
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
0
8221
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6629
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5395
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3882
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2364
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.