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 Basic
  4. how to keep a form always active

how to keep a form always active

Scheduled Pinned Locked Moved Visual Basic
tutorialquestion
8 Posts 5 Posters 0 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.
  • E Offline
    E Offline
    eyes2007
    wrote on last edited by
    #1

    hi all i have 2 form form1 and form2 i m trying to keep the form2 always active how can i do it

    C F 2 Replies Last reply
    0
    • E eyes2007

      hi all i have 2 form form1 and form2 i m trying to keep the form2 always active how can i do it

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      I'm assuming that form2 is a child of form1 and is being shown modelessly ? You could put focus back onto form2 whenever it loses it, but if you do that, what's the point of it being modeless ? A form cannot be active if you're interacting with another one.

      Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

      E 1 Reply Last reply
      0
      • C Christian Graus

        I'm assuming that form2 is a child of form1 and is being shown modelessly ? You could put focus back onto form2 whenever it loses it, but if you do that, what's the point of it being modeless ? A form cannot be active if you're interacting with another one.

        Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

        E Offline
        E Offline
        eyes2007
        wrote on last edited by
        #3

        my use of that form is as a toolbar that's why i need to keep the form always active because without that i need to click twice first to activate the form and second to use the control on the form

        C D D 3 Replies Last reply
        0
        • E eyes2007

          my use of that form is as a toolbar that's why i need to keep the form always active because without that i need to click twice first to activate the form and second to use the control on the form

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          That sounds odd to me, you should be able to click on a control in your form, and it should select the form and the control.

          Christian Graus - Microsoft MVP - C++ "I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )

          1 Reply Last reply
          0
          • E eyes2007

            my use of that form is as a toolbar that's why i need to keep the form always active because without that i need to click twice first to activate the form and second to use the control on the form

            D Offline
            D Offline
            DA_Loring
            wrote on last edited by
            #5

            Have you tried setting it always on top?

            David Loring !! Keep Music Live !!

            E 1 Reply Last reply
            0
            • D DA_Loring

              Have you tried setting it always on top?

              David Loring !! Keep Music Live !!

              E Offline
              E Offline
              eyes2007
              wrote on last edited by
              #6

              ya i have tryed i need some code to be executed on a click event now when the form lost its focus i need to click twice first to activate the form and the second to click on that button and i need only to click once to activate the form as well as to click the button.

              1 Reply Last reply
              0
              • E eyes2007

                hi all i have 2 form form1 and form2 i m trying to keep the form2 always active how can i do it

                F Offline
                F Offline
                Froz3n
                wrote on last edited by
                #7

                set form2 property IsMdiContainer = true then on form2 load procedure.. Dim newform As New Form1 Form1.MdiParent = Me Form1.Show() this will put form1 into form2 and make form2 show the whole time. Not sure if that answers your question or not.

                1 Reply Last reply
                0
                • E eyes2007

                  my use of that form is as a toolbar that's why i need to keep the form always active because without that i need to click twice first to activate the form and second to use the control on the form

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  You may want to try setting the "ToolBox" form's TopLevel property to False, then add an instance of that form to the Controls collection of the main form.

                  A guide to posting questions on CodeProject[^]
                  Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
                       2006, 2007

                  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