|
-
May 15th, 2006, 04:13 PM
#1
Thread Starter
Frenzied Member
is there a way to make another form, that is created by the main form, to be topmost?
I tried setting ".topmost" property to true, but it becomes top most for all the application in windows. I just want the "secondary" form to be topmost on the main form.
-
May 15th, 2006, 04:30 PM
#2
Re: is there a way to make another form, that is created by the main form, to be topmost?
Try setting the "StartupPosition" property to center parent
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
May 15th, 2006, 04:51 PM
#3
-
May 15th, 2006, 04:54 PM
#4
Re: is there a way to make another form, that is created by the main form, to be topmost?
Or you could use ShowDialog(ParentForm);
this will disable (and move back) the parent form until the child form is closed
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
May 15th, 2006, 06:21 PM
#5
Re: is there a way to make another form, that is created by the main form, to be topm
Do you want this child form to be modal (prevent access to the parent while it's open) like a MessageBox or modeless (allow access to the parent but remain on top) like the Visual Studio Find and Replace dialogue?
If you want it modal then you can simply call ShowDialog. There is no need, or point, to passing the parent form as an argument unless you want to be able to access the parent in code from the child.
If you want it to be modeless then you call Show but you pass the parent form as an argument. This makes the child an owned form of the parent. Owned forms will always appear on top of their owner without prevent access to it. They will also be minimised, restored and closed along with their owner. You can also create an owned form by setting the child form's Owner property or calling the parent form's AddOwnedForm method.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|