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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C#
  4. modal dialog to rest of application but want to interact with a second window simultaneously with that window

modal dialog to rest of application but want to interact with a second window simultaneously with that window

Scheduled Pinned Locked Moved C#
questionjsonhelp
5 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.
  • M Offline
    M Offline
    misterbear
    wrote on last edited by
    #1

    Sorry for the lengthy title. My problem is that I have a dialog in my application that I want to open in a modal fashion. But I want to be able to open another window from that modal dialog and interact between only these two windows, nothing else in the application (for doing some drag drop things between lists in these two windows). How can I do this? thankful for your suggestion, Bjorn

    D T E M 4 Replies Last reply
    0
    • M misterbear

      Sorry for the lengthy title. My problem is that I have a dialog in my application that I want to open in a modal fashion. But I want to be able to open another window from that modal dialog and interact between only these two windows, nothing else in the application (for doing some drag drop things between lists in these two windows). How can I do this? thankful for your suggestion, Bjorn

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

      No going to happen like this. THe modal window is either going to be System Modal or Application Modal. Meaning that is System Modal, the user can't switch to any other window in the system until this window is closed. Application Modal means that you can't switch to any other form owned by the application that opened the modal window. You'll have to implement this using some other scheme other than using Modal forms. Off the top of my head, you could possibly host both of your forms that you want to display inside another, modal, form. This way, you can do anything you want between the two forms while they sit inside a parent form. I know, you think I smoking something illegal. But, the Form class inherits from Control, just any any other forms based control. The Form class also has a hidden property called .TopLevel. It won't show up in Intellisense, but it does work. You can read more about the technique here[^]. Warning! This article contains nothing but VB code! ;) RageInTheMachine9532 "...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome

      1 Reply Last reply
      0
      • M misterbear

        Sorry for the lengthy title. My problem is that I have a dialog in my application that I want to open in a modal fashion. But I want to be able to open another window from that modal dialog and interact between only these two windows, nothing else in the application (for doing some drag drop things between lists in these two windows). How can I do this? thankful for your suggestion, Bjorn

        T Offline
        T Offline
        Tom Larsen
        wrote on last edited by
        #3

        To do this would either require listening to the Window's message pump and syphonining off the message to your exception window or doing a special object that derives from Form that has this behavior. Neither or which are appealing at all and I highly recommend you do not go down this road. Instead you should rethink your UI design. Having a modal dialog for all except one dialog means you should consider doing something else with either if not both dialogs since they both seem to violate UI design expectations.

        1 Reply Last reply
        0
        • M misterbear

          Sorry for the lengthy title. My problem is that I have a dialog in my application that I want to open in a modal fashion. But I want to be able to open another window from that modal dialog and interact between only these two windows, nothing else in the application (for doing some drag drop things between lists in these two windows). How can I do this? thankful for your suggestion, Bjorn

          E Offline
          E Offline
          ehuysamer
          wrote on last edited by
          #4

          One bit of a messy way of solving this is to trap the 'Activated' event in all the non-"modal" forms. Whenever the event is received, call one of the "modal" forms' BringToFront method.

          1 Reply Last reply
          0
          • M misterbear

            Sorry for the lengthy title. My problem is that I have a dialog in my application that I want to open in a modal fashion. But I want to be able to open another window from that modal dialog and interact between only these two windows, nothing else in the application (for doing some drag drop things between lists in these two windows). How can I do this? thankful for your suggestion, Bjorn

            M Offline
            M Offline
            misterbear
            wrote on last edited by
            #5

            what do you guys think about creating another standalone application which I start and hide at startup of my application, and then send a message to it telling it to display and go topmost when i open my modal dialog box? And then define some custom messages to handle the interaction? All I want to drag and drop is some simple text strings so should not be a problem between different applications... please give an opinion of you think its a stupid /hard to realize/other idea.

            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