Win Form in front of parent form
I have a form containing a button to create a new derived class form. In
the callback for this button, I have the code
AnotherFormClass newForm= new AnotherFormClass();
newForm.Show();
When the button is clicked and this runs, the newForm momentarily flashes
up in front of the original form on my screen, but then the original form
comes back to the front. I don't want to use brute force TopMost() it to
force newForm to always be in front. Plus, I'm not sure why I'm seeing
this behaviour. Could anyone help please? I see there is an article
mentioning a slightly similar problem here - Parent form is bringing to
front when the menu strip of a child form is clicked but this is for .NET
4.5 and I've encountered this behaviour in 4.0 before too.
Thanks, Chris
No comments:
Post a Comment