views:

472

answers:

2

I have a parent form that is set to be TopMost and then I have another form that opens when a button is clicked. This child form is also set to be TopMost. The first issue I had was that when I opened the child form, the application would basically freeze because you couldn't access anything. I decided that instead of using ShowDialog() to open the child form, I would use Show(this). This did fix the initial problem but now I have a new one. The childforms start postition is set to be CenterParent and when I use Show(this), it doesn't work. Is there any way I can make the childform open while both it and the parent form are set to topmost while having the childforms start position set to CenterParent? Thank you.

+1  A: 

You could try clearing the TopMost property of the parent form for the duration that the child form is visible.

This would solve the problem of which form should be top most, as there will only ever be one.

ChrisF
Good idea, should've thought of that myself haha.
Nate Shoffner
A: 

Hmm. I've created To forms. Then i set TopMost = true on both. The i add button to first and wrote new Form2().ShowDialog();

And all just fine. Form2 active and clickable. Form1 not since ShowDialog was called

And second variant works fine. Form2 opened in center of the screen.

May be i misunderstood something?

Trickster