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. C#
  4. Multiple Forms Open --- Toolstrip

Multiple Forms Open --- Toolstrip

Scheduled Pinned Locked Moved C#
helpquestioncsharptutorial
6 Posts 4 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.
  • N Offline
    N Offline
    nagendra vk
    wrote on last edited by
    #1

    hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.

    M P 2 Replies Last reply
    0
    • N nagendra vk

      hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.

      M Offline
      M Offline
      musefan
      wrote on last edited by
      #2

      you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is

      Life goes very fast. Tomorrow, today is already yesterday.

      N N 2 Replies Last reply
      0
      • M musefan

        you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is

        Life goes very fast. Tomorrow, today is already yesterday.

        N Offline
        N Offline
        nagendra vk
        wrote on last edited by
        #3

        thanx musefan but i got a prob with that one is there any other way to solve it?

        1 Reply Last reply
        0
        • M musefan

          you could try keeping a reference to the master form somewhere, then you can check that to see if the form is already open or not. perhaps a static instance of the master form, then when you click button check if is null and create new one if it is

          Life goes very fast. Tomorrow, today is already yesterday.

          N Offline
          N Offline
          Nagy Vilmos
          wrote on last edited by
          #4

          Is there a reason for suggesting static? I don't see how that would help, it would be better for the caller to hold a reference that is created when null.


          Panic, Chaos, Destruction. My work here is done.

          M 1 Reply Last reply
          0
          • N nagendra vk

            hi i had a problem while using toolstrip, in C# application i have a form named 'master', which is mdi child form. i access it from menu click event of mdiparent form. i have another form 'example'. it contains toolstrip. one of the toolstrip buttons is 'master' in 'example' form. now i m clicking that master toolstrip button again n again,it opens the 'master' form multiple times. how can i avoid this problem( multiple forms opening)? hope u help me in this issue. thanx in advance, nagendra kumar.

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            You can always use the MdiChildren property on your MDI Parent to identify whether or not the relevant form was open. There's no need to create a new property when MS has provided one for you.

            "WPF has many lovers. It's a veritable porn star!" - Josh Smith

            As Braveheart once said, "You can take our freedom but you'll never take our Hobnobs!" - Martin Hughes.

            My blog | My articles | MoXAML PowerToys | Onyx

            1 Reply Last reply
            0
            • N Nagy Vilmos

              Is there a reason for suggesting static? I don't see how that would help, it would be better for the caller to hold a reference that is created when null.


              Panic, Chaos, Destruction. My work here is done.

              M Offline
              M Offline
              musefan
              wrote on last edited by
              #6

              that way if there is more than one form that can open master form it will still only open one

              Life goes very fast. Tomorrow, today is already yesterday.

              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