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. Floating Window Z-Order....

Floating Window Z-Order....

Scheduled Pinned Locked Moved C#
csharpquestion
9 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.
  • A Offline
    A Offline
    Anders Molin
    wrote on last edited by
    #1

    I want to have a floating window in my app. One that is always on top of the main window... But, if I make a form and set the TopMost property to true, the window is also on top of every other application. I mean, when working in my app it works fine, but if i open another app in front of it, my floating window is also on top of that app... Not good... Any ideas? - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

    N 1 Reply Last reply
    0
    • A Anders Molin

      I want to have a floating window in my app. One that is always on top of the main window... But, if I make a form and set the TopMost property to true, the window is also on top of every other application. I mean, when working in my app it works fine, but if i open another app in front of it, my floating window is also on top of that app... Not good... Any ideas? - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

      N Offline
      N Offline
      Niels Penneman
      wrote on last edited by
      #2

      Isn't there some way to set the PARENT to your main window and wouldn't that solve this issue? greetz ;-) *Niels Penneman*


      Software/Dev Site
      Personal Site


      A H 2 Replies Last reply
      0
      • N Niels Penneman

        Isn't there some way to set the PARENT to your main window and wouldn't that solve this issue? greetz ;-) *Niels Penneman*


        Software/Dev Site
        Personal Site


        A Offline
        A Offline
        Anders Molin
        wrote on last edited by
        #3

        Unfortunately you can not set the parent of a form X| - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

        N 1 Reply Last reply
        0
        • A Anders Molin

          Unfortunately you can not set the parent of a form X| - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

          N Offline
          N Offline
          Niels Penneman
          wrote on last edited by
          #4

          Oh yes you can :-p Form.OwnedForms Property "When a form is owned by another form, it is minimized and closed with the owner form. For example, if Form2 is owned by form Form1, if Form1 is closed or minimized, Form2 is also closed or minimized. Owned forms are also never displayed behind their owner form. You can use owned forms for windows such as find and replace windows, which should not be displayed behind the owner form when the owner form is selected." greetz ;-) *Niels Penneman*


          Software/Dev Site
          Personal Site


          H A 2 Replies Last reply
          0
          • N Niels Penneman

            Isn't there some way to set the PARENT to your main window and wouldn't that solve this issue? greetz ;-) *Niels Penneman*


            Software/Dev Site
            Personal Site


            H Offline
            H Offline
            Heath Stewart
            wrote on last edited by
            #5

            Setting Form.Parent (inheritted from Control) won't solve this problem. Instead, set Form.Owner of the floating windows to the Form they should always overlap. See the documentation for Form.Owner in the .NET Framework SDK for more details.

            -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

            1 Reply Last reply
            0
            • N Niels Penneman

              Oh yes you can :-p Form.OwnedForms Property "When a form is owned by another form, it is minimized and closed with the owner form. For example, if Form2 is owned by form Form1, if Form1 is closed or minimized, Form2 is also closed or minimized. Owned forms are also never displayed behind their owner form. You can use owned forms for windows such as find and replace windows, which should not be displayed behind the owner form when the owner form is selected." greetz ;-) *Niels Penneman*


              Software/Dev Site
              Personal Site


              H Offline
              H Offline
              Heath Stewart
              wrote on last edited by
              #6

              The parent and the owner are too different things. Besides, to set the owner you use the Form.Owner property on the form that should be owned. The Form.OwnedForms property is a read-only property that is a Form[] array. Even replacing an element in the array won't set the Form.Owner property of the form you want owned.

              -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

              N A 2 Replies Last reply
              0
              • H Heath Stewart

                The parent and the owner are too different things. Besides, to set the owner you use the Form.Owner property on the form that should be owned. The Form.OwnedForms property is a read-only property that is a Form[] array. Even replacing an element in the array won't set the Form.Owner property of the form you want owned.

                -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                N Offline
                N Offline
                Niels Penneman
                wrote on last edited by
                #7

                Sorry, but I had never used this before so I looked it up and found the OwnedForms property and I thought, that must be it! Nice :-) greetz ;-) *Niels Penneman*


                Software/Dev Site
                Personal Site


                1 Reply Last reply
                0
                • N Niels Penneman

                  Oh yes you can :-p Form.OwnedForms Property "When a form is owned by another form, it is minimized and closed with the owner form. For example, if Form2 is owned by form Form1, if Form1 is closed or minimized, Form2 is also closed or minimized. Owned forms are also never displayed behind their owner form. You can use owned forms for windows such as find and replace windows, which should not be displayed behind the owner form when the owner form is selected." greetz ;-) *Niels Penneman*


                  Software/Dev Site
                  Personal Site


                  A Offline
                  A Offline
                  Anders Molin
                  wrote on last edited by
                  #8

                  thanks a lot :-D - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

                  1 Reply Last reply
                  0
                  • H Heath Stewart

                    The parent and the owner are too different things. Besides, to set the owner you use the Form.Owner property on the form that should be owned. The Form.OwnedForms property is a read-only property that is a Form[] array. Even replacing an element in the array won't set the Form.Owner property of the form you want owned.

                    -----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----

                    A Offline
                    A Offline
                    Anders Molin
                    wrote on last edited by
                    #9

                    SomeForm dlg = new SomeForm(); dlg.Owner = this; dlg.Show(); works just like SomeForm dlg = new SomeForm(); this.AddOwnedForm(dlg); dlg.Show(); But thanks both of you, I got my problem solved... - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)

                    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