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. Main form with always-on-top flag + dialog

Main form with always-on-top flag + dialog

Scheduled Pinned Locked Moved C#
helpquestion
4 Posts 2 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.
  • D Offline
    D Offline
    Dominik Reichl
    wrote on last edited by
    #1

    Hello! I got a main form, which can set to be always-on-top (this is achieved using the TopMost property of the main form). The problem now is that when opening a modal dialog box, the dialog appears behind the main window. The brute-force solution would be to disable the always-on-top mode while displaying the dialog. A better solution would be to tell the dialog somehow that its parent is the main form and therefore to appear in front of it. I tried setting the Owner, Parent and ParentForm properties of the dialog, but nothing worked (Owner: doesn't do anything, Parent: not allowed for top-level controls, ParentForm: read-only property). Any solution? How can the dialog displayed in front of the main window? Thanks and best regards Dominik


    Too many passwords to remember? Try KeePass Password Safe!

    S 1 Reply Last reply
    0
    • D Dominik Reichl

      Hello! I got a main form, which can set to be always-on-top (this is achieved using the TopMost property of the main form). The problem now is that when opening a modal dialog box, the dialog appears behind the main window. The brute-force solution would be to disable the always-on-top mode while displaying the dialog. A better solution would be to tell the dialog somehow that its parent is the main form and therefore to appear in front of it. I tried setting the Owner, Parent and ParentForm properties of the dialog, but nothing worked (Owner: doesn't do anything, Parent: not allowed for top-level controls, ParentForm: read-only property). Any solution? How can the dialog displayed in front of the main window? Thanks and best regards Dominik


      Too many passwords to remember? Try KeePass Password Safe!

      S Offline
      S Offline
      Stefan Troschuetz
      wrote on last edited by
      #2

      Did you try also enabling the TopMost property of the dialog.


      "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

      www.troschuetz.de

      D 1 Reply Last reply
      0
      • S Stefan Troschuetz

        Did you try also enabling the TopMost property of the dialog.


        "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

        www.troschuetz.de

        D Offline
        D Offline
        Dominik Reichl
        wrote on last edited by
        #3

        No, didn't try that :-O Works great, thank you!


        Too many passwords to remember? Try KeePass Password Safe!

        S 1 Reply Last reply
        0
        • D Dominik Reichl

          No, didn't try that :-O Works great, thank you!


          Too many passwords to remember? Try KeePass Password Safe!

          S Offline
          S Offline
          Stefan Troschuetz
          wrote on last edited by
          #4

          Glad to hear my guess was right :)


          "Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook

          www.troschuetz.de

          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