Click here to Skip to main content
15,672,471 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I use PageSetupDialog with EnableMetric.
Description my problem.
I open PageSetupDialog and set margins on 10 millimeters.
I press 'OK', and reopen dialog. Margins have new value equals 9.91.

I know that problem is with conversion from millimeters to inch.
If is any way to resolve this isue?

It's a bug, a known one to be sure.

The Metric/Imperial conversion is one of those things where you can tell it was written in The States, they sure love their Imperial System.

Here[^] is a M$ page with explanations and support.
Share this answer
Krzysztof T. Lasek 20-Dec-11 4:15am    
This bug I know, but I think my problem is some different.
The change from 10 millimetres to 9.91 millimetres is disposable, and dialog will be remember this value until the next change.
I have been struggling with the blasted millimetres in the PageSetupDialog
All of my computers are Region CANADA with US Keyboard, it defaults to metric units.
I hate the rounding errors.

I prefer INCHES, so instead of manually reconfiguring ALL the computers, I just add these lines of code to tell ALL PROGRAMS on the computer that I prefer inches.

Imports IWshRuntimeLibrary

Dim oShell As IWshShell_Class
oShell = New IWshShell_Class
oShell.RegWrite("HKEY_CURRENT_USER\Control Panel\International\iMeasure", 1)

Imeasure =0=Metric
Imeasure =1=Inches

You can read this setting in your program with
Bool System.Globalization.RegionInfo.CurrentRegion.IsMetric
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900