Solved

PrintDialog Issue

Posted on 2013-01-09
2
415 Views
Last Modified: 2013-01-09
So I have this simple piece of code that I have used many times but for some reason has stopped working. I recently upgraded my project from a VS 2008 solution to VS 2010 solution.

The issue is it just passes over the showdialog. The printdialog never comes up

Dim LabelPrint As New PrintDialog()

        Cursor.Current = Cursors.WaitCursor

        Dim result As DialogResult

        If Label_Printer = "" Then
            result = LabelPrint.ShowDialog()

            If (result = DialogResult.OK) Then
                Label_Printer = LabelPrint.PrinterSettings.PrinterName
            Else
                Exit Sub
            End If
        Else
            LabelPrint.PrinterSettings.PrinterName = Label_Printer
        End If

Open in new window

0
Comment
Question by:aothomas42
  • 2
2 Comments
 

Accepted Solution

by:
aothomas42 earned 0 total points
ID: 38761121
found my issue on another site

The PrintDialog class may not work on AMD64(x64 or Any CPU is belong to AMD64 technical, including intel x64cpu) microprocessors unless you set the UseEXDialog property to true.

This is a known issue.

And this limitation has been supported in .net framework4, so if you want use this class with windows7 style dialog, then you will need to use .net framework4, otherwise you will need to use the xp style dialog with set the UseEXDialog property to true, or using x86 target platform.

Switched my solution to Framework 4 and everything worked
0
 

Author Closing Comment

by:aothomas42
ID: 38761122
Found this solution on another site
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question