Floating Window Z-Order....
-
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 ;)
-
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 ;)
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
-
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
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 ;)
-
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 ;)
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
-
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
Setting
Form.Parent
(inheritted fromControl
) won't solve this problem. Instead, setForm.Owner
of the floating windows to theForm
they should always overlap. See the documentation forForm.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-----
-
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
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. TheForm.OwnedForms
property is a read-only property that is aForm[]
array. Even replacing an element in the array won't set theForm.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-----
-
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. TheForm.OwnedForms
property is a read-only property that is aForm[]
array. Even replacing an element in the array won't set theForm.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-----
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
-
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
thanks a lot :-D - Anders Money talks, but all mine ever says is "Goodbye!" My Photos[^] nsms@spyf.dk <- Spam Collecting ;)
-
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. TheForm.OwnedForms
property is a read-only property that is aForm[]
array. Even replacing an element in the array won't set theForm.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-----
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 ;)