> Hi all,
>
> Why is it that when I close a form that is displayed using ShowDialog(), my
> main application form refreshes or "blinks" but when I use Show() and close
> the form, the refresh does not occur?
How are you closing the form? I've found that if you try to use Hide() or
Close(), the parent is moved in the Z-order, whereas the correct method is
to set the DialogResult property (which I believe is a horrible way of
causing a form to close, but there you have it).
Stu
"Amil" <Amil@discussions.microsoft.com> schrieb:
> Why is it that when I close a form that is displayed
> using ShowDialog(), my main application form refreshes
> or "blinks" but when I use Show() and close
> the form, the refresh does not occur?
I am not able to reproduce this behavior. How do you show your form, what's
the parent forms's window state, and how do you close the dialog?

Signature
Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/
Amil - 13 Oct 2004 19:09 GMT
I have a main MDI form. I have a base form that all MDI children inherits
from. I have another form, confirmationform, that has two buttons: OK and
Cancel. These buttons have a code that says: base.Hide(). These properties
are set:
TopMost = true
ShowInTaskbar = false
StartPosition = CenterScreen
From a MDI child form, I create an instance of the confirmationform by
clicking on a button and use the ShowDialog() method to display it. Clicking
on either OK or Cancel button causes my main form to "refresh" or flicker.
> "Amil" <Amil@discussions.microsoft.com> schrieb:
> > Why is it that when I close a form that is displayed
[quoted text clipped - 4 lines]
> I am not able to reproduce this behavior. How do you show your form, what's
> the parent forms's window state, and how do you close the dialog?