Loading a Start up Dialog does not get focus
-
I what to be able to show a start page to the user when they fire up the application. I have a sub Main that looks like this:
Public Sub Main() frmMain.Location = Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location frmMain.Show() frmStartUp.ShowDialog(frmMain) End Sub
The frmStartUp does show on top of frmMain but it does not have focus. It appears frmMain has focus. I can click in the dialog and life is good but I think it just does not look right that the frmStartUp does not have focus. Can anyone tell me why it would not have the foucs?
-
I what to be able to show a start page to the user when they fire up the application. I have a sub Main that looks like this:
Public Sub Main() frmMain.Location = Screen.AllScreens(UBound(Screen.AllScreens)).Bounds.Location frmMain.Show() frmStartUp.ShowDialog(frmMain) End Sub
The frmStartUp does show on top of frmMain but it does not have focus. It appears frmMain has focus. I can click in the dialog and life is good but I think it just does not look right that the frmStartUp does not have focus. Can anyone tell me why it would not have the foucs?
frmStatup.Focus() I did test YOUR code to work as you intend it to. What does it do when executing the compiled code?
-
frmStatup.Focus() I did test YOUR code to work as you intend it to. What does it do when executing the compiled code?
-
It shows the dialog on top of the main form and it allows me to click in the dialog and everything. It just does not have focus when the app starts. adding the frmStartup.Focus() had no effect.
-
Have you checked the tab order for your dialog form in the designer? That should show you which control gets the focus.
I think it may need a control to focus too like suggested, I cannot reproduce your issue with focus. With or without controls.
-
I think it may need a control to focus too like suggested, I cannot reproduce your issue with focus. With or without controls.