473,379 Members | 1,253 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,379 software developers and data experts.

PrintSetup issues

Hi All,

I have a print preview form in my app which consists of a PrintDocument
which is tied into a Print Preview Control, a Printer Dialog component, and
a Printer Setup Dialog component. The document property has been set on all
of the latter of those 3.

I can't seem to get my Print Setup dialog to correctly update its changes on
the Print Document however. If I change from Landscape to portrait, the
document just stays at landscape, and when I got back into the settings, I
see that it's reverted back to landscape again.

The margins are also very odd, in that I initially set a margin of 42 (in
100ths of an inch) all round. The setup dialog displays this as 4.2mm
however, and when I OK that the margins then shrink on my print document. I
then go back into the Print Setup dialog to find that all margins have
dropped to 1.7!

I had thought I recalled this being a well known bug in 1.0 of the
framework, however I can't seem to find anything about a current issue.
Plus I'm on 1.1 SP1, so if it was a bug I assume it would've been fixed
anyway. What am I doing wrong?

Cheers,
Alex Clark
Nov 21 '05 #1
3 1357
Hi

I think you may try the code below to see if that works for you.
Here is a KB for your reference.
BUG: The Margin Value Decreases Every Time PageSetupDialog Is Displayed
http://support.microsoft.com/?id=814355

You may take a look at the code below that the PageSetupDialog will update
the PrintDocument's Margins setting and PageSettings.Landscape Property.
Private Sub miPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles miPrint.Click
' Initialize the dialog's PrinterSettings property to hold user
' defined printer settings.
PageSetupDialog1.PageSettings = _
New System.Drawing.Printing.PageSettings

' Initialize dialog's PrinterSettings property to hold user
' set printer settings.
PageSetupDialog1.PrinterSettings = _
New System.Drawing.Printing.PrinterSettings
'Do not show the network in the printer dialog.
PageSetupDialog1.ShowNetwork = False
Me.PageSetupDialog1.AllowMargins = True
Me.PageSetupDialog1.Document = pd

'Show the dialog storing the result.
Dim result As DialogResult = PageSetupDialog1.ShowDialog()
If (result = System.Windows.Forms.DialogResult.OK) Then
pd.Print()
End If

If you still have any concern, can you provide a reproduce sample ?
Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #2
Hi Peter,

I've got the Landscape issue sorted out now, thanks. The KB article is
exactly the issue that I'm experiencing with the margins.

In the KB article about this bug, the only workaround seems to be by
altering the system's regional settings to use US measurements. My
customers and I are entirely UK based, and if I tell them to do this in
order to solve this issue they're going to think I'm playing an early April
Fool's prank on them.

What puzzles me is that I now recall having this issue in late 2002, and
receiving a response to a newsgroup post back then identifying it as a bug.
Clearly it's still a problem even now. .NET is not cutting edge technology
any longer, I was testing early betas of it 5 years ago and we're currently
on version 1.1, SP1. How can a simple bug that's been known about for
roughly two and a half years still exist in a supposedly mature product?

Sorry for the rant, but it gets a bit tiresome having to deal with bugs in
the framework when I'd much rather be spending time debugging and improving
my own code. I only hope Whidbey is actually a stable product and doesn't
suffer from these same problems.

Regards,
Alex Clark


""Peter Huang" [MSFT]" <v-******@online.microsoft.com> wrote in message
news:LQ**************@TK2MSFTNGXA02.phx.gbl...
Hi

I think you may try the code below to see if that works for you.
Here is a KB for your reference.
BUG: The Margin Value Decreases Every Time PageSetupDialog Is Displayed
http://support.microsoft.com/?id=814355

You may take a look at the code below that the PageSetupDialog will update
the PrintDocument's Margins setting and PageSettings.Landscape Property.
Private Sub miPrint_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles miPrint.Click
' Initialize the dialog's PrinterSettings property to hold user
' defined printer settings.
PageSetupDialog1.PageSettings = _
New System.Drawing.Printing.PageSettings

' Initialize dialog's PrinterSettings property to hold user
' set printer settings.
PageSetupDialog1.PrinterSettings = _
New System.Drawing.Printing.PrinterSettings
'Do not show the network in the printer dialog.
PageSetupDialog1.ShowNetwork = False
Me.PageSetupDialog1.AllowMargins = True
Me.PageSetupDialog1.Document = pd

'Show the dialog storing the result.
Dim result As DialogResult = PageSetupDialog1.ShowDialog()
If (result = System.Windows.Forms.DialogResult.OK) Then
pd.Print()
End If

If you still have any concern, can you provide a reproduce sample ?
Thanks!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no
rights.

Nov 21 '05 #3
Hi

Thanks for your feedback.
So far I am not sure the exact fixed date, but you may try to submit your
feedback to mswish.
http://register.microsoft.com/mswish/suggestion.asp

If you are urgent with the issue, I think you may need to contact MSPSS to
ask for a hotfix for the problem and tell them that the workaround is not
fit for you.
http://support.microsoft.com

Thanks for your understanding!

Best regards,

Peter Huang
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security
This posting is provided "AS IS" with no warranties, and confers no rights.

Nov 21 '05 #4

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

Similar topics

2
by: Tom Loredo | last post by:
Hi folks- I'm about to move from a Solaris 8/SPARC environment to a Dell running RedHat 9. Are there any issues I need to be aware of in bringing my Python code over (mostly scientific...
28
by: grahamd | last post by:
Who are the appropriate people to report security problems to in respect of a module included with the Python distribution? I don't feel it appropriate to be reporting it on general mailing lists.
5
by: sandy | last post by:
Hi All, I am a newbie to MySQL and Python. At the first place, I would like to know what are the general performance issues (if any) of using MySQL with Python. By performance, I wanted to...
2
by: malcolm | last post by:
Hello, We have a robust (.NET 1.1 c# winforms) client-server application that utilizes many typed DataSets, typed DataTables and typed DataRows. Our application is a series of windows and popup...
1
by: Aliandro | last post by:
Hi Does any one know where I can find information regarding any issues with SQL and IIS being run under windows XP SP2? as I am in the process of programmning in Dot net and neet some way of...
7
by: David Laub | last post by:
I have stumbled across various Netscape issues, none of which appear to be solvable by tweaking the clientTarget or targetSchema properties. At this point, I'm not even interested in "solving"...
2
by: G2 | last post by:
Hi We are dealing with significant browser compatibility issues with Netscape 5.x+ browsers and Mac IE. I am sure most web developers have faced similar issues in the past. Can anyone give me their...
1
by: GaryDean | last post by:
We have been developing all of our .net applications on 32 bit windows using 32 bit SQL Server. We are being asked to now deploy to servers running 64bit windows and 64bit SQL Server. Are there...
3
by: eschneider | last post by:
Just some common issues with WS: Using custom objects: When objects change, seems you are always fixing some issue. Update references, which sometimes does not work. Deployment: Weird errors...
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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.