Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / October 2004

Tip: Looking for answers? Try searching our database.

blinking forms

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Amil - 13 Oct 2004 16:13 GMT
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?
Stu Smith - 13 Oct 2004 16:58 GMT
> 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
Herfried K. Wagner [MVP] - 13 Oct 2004 17:16 GMT
"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?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.