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. Prevent user from opening >1 subform

Prevent user from opening >1 subform

Scheduled Pinned Locked Moved C#
csharpwinformsquestion
4 Posts 3 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.
  • L Offline
    L Offline
    livez
    wrote on last edited by
    #1

    Hi! I have a form with a ListView. When the user dbl clicks a row in the listview, a new window with data regarding this row pops up. I want to prevent the user from being able to open more than one window like this at a time. A nice solution would be to replace the already opened window should the user try and open a second. How would I go about doing this? I'm kind of new working with winforms... /regards

    N T 2 Replies Last reply
    0
    • L livez

      Hi! I have a form with a ListView. When the user dbl clicks a row in the listview, a new window with data regarding this row pops up. I want to prevent the user from being able to open more than one window like this at a time. A nice solution would be to replace the already opened window should the user try and open a second. How would I go about doing this? I'm kind of new working with winforms... /regards

      N Offline
      N Offline
      Naveed Kamboh
      wrote on last edited by
      #2

      Hi Friend, Instead of using Form.show() method use Form.showDialouge() method, It will show your form as a dialouge box and without any action on it no one can open other form. This may solve ur problem. Enjoy:-D Naveed Kamboh -- modified at 7:36 Monday 24th April, 2006

      L 1 Reply Last reply
      0
      • N Naveed Kamboh

        Hi Friend, Instead of using Form.show() method use Form.showDialouge() method, It will show your form as a dialouge box and without any action on it no one can open other form. This may solve ur problem. Enjoy:-D Naveed Kamboh -- modified at 7:36 Monday 24th April, 2006

        L Offline
        L Offline
        livez
        wrote on last edited by
        #3

        thanks for the tip! Though not applicable in my particular case as it's not up to me which method to use, it's good to know for future use.

        1 Reply Last reply
        0
        • L livez

          Hi! I have a form with a ListView. When the user dbl clicks a row in the listview, a new window with data regarding this row pops up. I want to prevent the user from being able to open more than one window like this at a time. A nice solution would be to replace the already opened window should the user try and open a second. How would I go about doing this? I'm kind of new working with winforms... /regards

          T Offline
          T Offline
          The Nemesis
          wrote on last edited by
          #4

          one option can be to make the new window a modal dialog...but in that case you'll be able to access the listbox only when the new dialog is closed... if you don't want that you can disable the listbox before the new window opens (after the user selects to open the window)...and then you can enable it again when the user closes the window... there should be some more ways to do it...

          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