Link to home
Start Free TrialLog in
Avatar of conceptdata
conceptdataFlag for Denmark

asked on

.Net PrintDialog Focus/Ontop

Hi

I have the attached code in my program

But I losses focus on the print dialog box.

My program runs minimized n the process bar.
Dim printDlg As New PrintDialog()
                        printDlg.PrinterSettings.PrinterName = My.Settings.PrinterName
                        printDlg.AllowSelection = True
                        printDlg.AllowSomePages = True
                        printDlg.AllowCurrentPage = True
                        printDlg.ShowNetwork = True
                        'printDlg.UseEXDialog = True

                        If (printDlg.ShowDialog() = DialogResult.OK) Then
                            printer_name = printDlg.PrinterSettings.PrinterName()
                            My.Settings.PrinterName = printDlg.PrinterSettings.PrinterName()
                        Else
                            printer_name = ""
                        End If

Open in new window

Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Do you mean the dialog box does not have focus when its shown?
Avatar of conceptdata

ASKER

Yes - The print dialog box disapears to the "back".
All other programs is in front of the dialog box.
ASKER CERTIFIED SOLUTION
Avatar of Nasir Razzaq
Nasir Razzaq
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I can see how it works, but how to put in into my printerdialog code, It's not a form
I have solved it myself with this code before the ShowDialog

Me.TopMost = True

But the other suggested solutions, maybe they could work to, so you get the point .. :)