PrintSetup issues

A

Alex Clark

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
 
P

Peter Huang [MSFT]

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.
 
A

Alex Clark

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
 
P

Peter Huang [MSFT]

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top