BUG: The margin value decreases every time PageSetupDialog is displayed (814355)



The information in this article applies to:

  • Microsoft Visual Studio .NET (2003), Professional Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2003), Academic Edition
  • Microsoft Visual Studio .NET (2002), Professional Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Architect Edition
  • Microsoft Visual Studio .NET (2002), Enterprise Developer Edition
  • Microsoft Visual Studio .NET (2002), Academic Edition

SYMPTOMS

The PageSetupDialog control reduces the margin every time it is displayed when you do the following things:
  • Set the Measurement System property of the Regional and Language Options of your computer to Metric.

-and-

  • Use the PageSetupDialog control.

CAUSE

If the default measurement system is U.S., the PageSetupDialog box uses thousandths of inches as the default unit of measurement. If the default measurement system is Metric, the dialog box uses hundredths of millimeters as the default unit of measurement. By default, U.S. is the measurement system. If the measurement system is Metric, the margins are converted from U.S. system to Metric system. When the PageSetupDialog is closed, the computer saves information about the page size. When the PageSetupDialog is reopened, the computer incorrectly assumes the margin as if it was a U.S. system margin instead of a Metric system margin. The computer converts the margin to the Metric system again. Therefore, the margin reduces every time the PageSetupDialog is displayed.

WORKAROUND

To work around this bug, you can use the U.S. settings for the Measurement system property of the Regional and Language Options. To do this, follow these steps:
  1. On the taskbar, click Start. Point to Settings, and then click Control Panel.
  2. Click Regional and Language Options.
  3. On the Regional Options tab, click Customize.
  4. Set U.S. as the Measurement System property.
  5. Click OK to save the settings.
  6. Click OK in the Regional and Language Options window.

STATUS

Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the "Applies to" section.

MORE INFORMATION

Steps to reproduce the behavior

  1. On the taskbar, click Start. Point to Settings, and then click Control Panel.
  2. Click Regional and Language Options.
  3. On the Regional Options tab, click Customize.
  4. Set the Measurement System property to Metric.
  5. Click OK in the Customize Regional Options window.
  6. Click OK in the Regional and Language Options window.
  7. Create a new Windows application by using Microsoft Visual C# .NET or Microsoft Visual Basic .NET.
  8. From the toolbox, drag a Button control to the form.
  9. From the toolbox, drag a PrintDocument control to the form.
  10. From the toolbox, drag a PageSetupDialog control to the form.
  11. Right-click PageSetUpDialog, and then click Properties.
  12. Set the Document property to PrintDocument1.
  13. Double-click Button, and then add the following code in the Button1_Click event:

    Visual Basic .NET Code
    PageSetupDialog1.ShowDialog()

    Visual C# .NET Code
    pageSetupDialog1.ShowDialog();
  14. On the Debug menu, click Start to run the application.
  15. Click Button.

    PageSetUpDialog is displayed.
  16. All the margins are set to 10.
  17. Click OK.
  18. Click Button again.

    All the margins are set to 3.9.

REFERENCES

For more information, visit the following MSDN Web site:

Modification Type:MinorLast Reviewed:4/5/2006
Keywords:kbvs2005swept kbvs2005doesnotapply kbvs2002sp1sweep kbWindowsForms kbControl kbprint kbbug KB814355 kbAudDeveloper