Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Visual Studio 2015 & .NET 4.6
  4. Loading a Start up Dialog does not get focus

Loading a Start up Dialog does not get focus

Scheduled Pinned Locked Moved Visual Studio 2015 & .NET 4.6
question
6 Posts 3 Posters 18 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • G Offline
    G Offline
    gwittlock
    wrote on last edited by
    #1

    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?

    T 1 Reply Last reply
    0
    • G gwittlock

      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?

      T Offline
      T Offline
      taylor oakes
      wrote on last edited by
      #2

      frmStatup.Focus() I did test YOUR code to work as you intend it to. What does it do when executing the compiled code?

      G 1 Reply Last reply
      0
      • T taylor oakes

        frmStatup.Focus() I did test YOUR code to work as you intend it to. What does it do when executing the compiled code?

        G Offline
        G Offline
        gwittlock
        wrote on last edited by
        #3

        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.

        L 1 Reply Last reply
        0
        • G gwittlock

          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.

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          Have you checked the tab order for your dialog form in the designer? That should show you which control gets the focus.

          T 1 Reply Last reply
          0
          • L Lost User

            Have you checked the tab order for your dialog form in the designer? That should show you which control gets the focus.

            T Offline
            T Offline
            taylor oakes
            wrote on last edited by
            #5

            I think it may need a control to focus too like suggested, I cannot reproduce your issue with focus. With or without controls.

            L 1 Reply Last reply
            0
            • T taylor oakes

              I think it may need a control to focus too like suggested, I cannot reproduce your issue with focus. With or without controls.

              L Offline
              L Offline
              Lost User
              wrote on last edited by
              #6

              I don't think you meant this message for me.

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups