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 / December 2004

Tip: Looking for answers? Try searching our database.

Application does not terminate when clicking on 'X' in titlebar

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jo Siffert - 10 Dec 2004 15:24 GMT
Hi,

when I try to close my application using the 'X' in the Windows
titlebar, nothing happens - neither Form.Dispose() is called not the
Closing or Closed events are raised. The application just keeps running.

If I close the application using Application.Close(), everything works fine.

What does the runtime do when hitting the X button? Is there any way to
intercept this action?

Thanks a lot,
  Jo
Frank Eller - 10 Dec 2004 18:14 GMT
Hi Jo,

> Hi,
>
> when I try to close my application using the 'X' in the Windows
> titlebar, nothing happens - neither Form.Dispose() is called not the
> Closing or Closed events are raised. The application just keeps
> running.

That's very unusual ...

> If I close the application using Application.Close(), everything
> works fine.
> What does the runtime do when hitting the X button? Is there any way
> to intercept this action?

Usually, "Application.Close()" is called. Your App should terminate. Is
there anything else you might have changed? I never had that behaviour in
any application ...

Signature

Frank Eller
www.frankeller.de

Herfried K. Wagner [MVP] - 10 Dec 2004 19:44 GMT
"Jo Siffert" <jo.siffert@gmx.net> schrieb:
> when I try to close my application using the 'X' in the Windows titlebar,
> nothing happens - neither Form.Dispose() is called not the Closing or
> Closed events are raised. The application just keeps running.

Maybe this bug:

Windows Forms Bug
<URL:http://www.jelovic.com/weblog/e41.htm>

Signature

Herfried K. Wagner [MVP]
<URL:http://dotnet.mvps.org/

Jo Siffert - 10 Dec 2004 20:58 GMT
It is indeed this bug. I figured out which controls are in the
unvalidatedControls collection and forced those to be removed by calling
OnControlRemoved(...) - now the form closes properly.

Thanks a lot for this hint!

I am wondering why the problem still exists on .NET 1.1 SP1...

/Jo

> "Jo Siffert" <jo.siffert@gmx.net> schrieb:
>
[quoted text clipped - 6 lines]
> Windows Forms Bug
> <URL:http://www.jelovic.com/weblog/e41.htm

Rate this thread:







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.