|
-
Jun 19th, 2003, 05:29 PM
#1
Thread Starter
Frenzied Member
Stupid bugs still there!
There is a well known bug in PageSetupDialog in Framework 1.0 when using metric measurment system:
For example show the pagesetupdialog and set the left margin to 25.4 mm (1 inch) and press ok. Now show it again and the value is now 10 (divided by 2.54 to be converted to inch and set the print document margin which is measured by 0.01 of inch, but not converted back to mm at subsequent ShowDialog).
It is known for a long time now and there is a work arond for it but I hoped that it will be fixed in 1.1, but it's still there. I wonder why!
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Mar 29th, 2004, 10:34 AM
#2
Fanatic Member
The bug is still there in Framework 1.1.
I have just spent an afternoon trying to figure out what is going on and how to get round it.
It is a right pain.
How do you change the measurement system from metric to imperial?
What is the work around? I hope its not a case of faffing around doing *10 here and there to the margins.
Last edited by davidrobin; Mar 29th, 2004 at 10:39 AM.
-
Apr 1st, 2004, 03:09 AM
#3
Thread Starter
Frenzied Member
First you have to decide about the measurment system of the client machine:
VB Code:
' Decide if the measurement system of the current user is Metric (millimiter in PageSetupDialog or inches.
' There is a dotnet way to read the measurement system of the current culture-for example US culture is associated
' with US measurments (inch)-but that way wont reflect the user override of regional seetings in control panel.
' So read the registry value that shows the measurement system. If the value is not present at all, as in Win98SE
' or the value is 1 then its inches, and if 0 then its Metric.
Dim rgkey As RegistryKey, s As Integer
Try
rgkey = Registry.CurrentUser.OpenSubKey("Control Panel").OpenSubKey("International")
If rgkey.GetValue("iMeasure") = Nothing Then
s = 1
Else
s = CByte(rgkey.GetValue("iMeasure"))
End If
Catch ex As System.Exception
s = 1
Finally
rgkey.Close()
End Try
Then if the system is metric you have to multiply the document margins by 2.54 to convert it to mm.
'Heading for the automatic overload'
Marillion, Brave, The Great Escape, 1994
'How will WE stand the FIRE TOMORROW?'
Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979
-
Apr 1st, 2004, 04:17 AM
#4
Fanatic Member
Thanks Lunatic3, thats brilliant.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|