Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why is the PrintDialog not displaying (in 64 bit)?

Tags:

.net

winforms

This code, when built in .Net for Any CPU platform and running on a 64-bit machine, simply returns a DialogResult of Cancel without showing the expected dialog box.

Dim dlg As New System.Windows.Forms.PrintDialog

If dlg.ShowDialog() = Windows.Forms.DialogResult.OK Then
    '... print the document '
End If

However, it works fine when the application is built for the x86 platform, and run on a 64-bit machine. How can you display the dialog with a 64-bit compile?

like image 258
Bill Avatar asked May 25 '10 04:05

Bill


1 Answers

You need to set the additional property...

dlg.UseEXDialog = True

The documentation(*) makes brief mention of this needing to be done for AMD64 processors under Remarks.

  • ms-help://MS.VSCC.v90/MS.MSDNQTR.v90.en/fxref_system.windows.forms/html/43eb054b-8985-16ae-1738-ad9b97a8e8cc.htm
like image 64
Bill Avatar answered Nov 15 '22 06:11

Bill