Avatar of conceptdata
conceptdata
Flag 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

Visual Basic.NET

Avatar of undefined
Last Comment
conceptdata

8/22/2022 - Mon
Nasir Razzaq

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

ASKER
Yes - The print dialog box disapears to the "back".
All other programs is in front of the dialog box.
ASKER CERTIFIED SOLUTION
Nasir Razzaq

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
conceptdata

ASKER
I can see how it works, but how to put in into my printerdialog code, It's not a form
Your help has saved me hundreds of hours of internet surfing.
fblack61
conceptdata

ASKER
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 .. :)