Why is the PrintDialog not displaying (in 64 bit)?
This code, when built in .Net for Any CPU platfor开发者_C百科m 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?
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
If you don't use the MSDN Help in VS.Net, you can find the same remark here: http://msdn.microsoft.com/en-us/library/system.windows.forms.printdialog(v=vs.80).aspx
精彩评论