.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

How to close my C# + Windows application safely...

Posted By: susant     Posted Date: December 26, 2008    Points:2   Category :C#
Hi All

In Exit Menu i am writting code like..
-----------------------------------------

private void ExitToolsStripMenuItem_Click(object sender, EventArgs e)
{
Application.Exit();
close_childForm();
}

public void close_childForm()
{
foreach (Form childForm in MdiChildren)
{
childForm.Close();
}
}

so when the user click File->Exit it will safely close the application... but that NoticyIcon is not cleared from task bar..

Requirement
-----------------
1: how to cler that notify Icon from task bar when the user click file->Exit

2nd problem
---------------
But when the user click 'X'(MinimizeBox,MaximaizeBox,Close) Close Button of MDI some instance remain... as well as NoticyIcon is not cleared from task bar..

so how to close my application safely....


susant
Bombay

Responses
Author: Praveen             
Posted Date: December 26, 2008     Points: 5   

Hi,
You can track the "FormClosing" event on the parent form there you can write the code to close all the form safely.



Post Reply

You must Sign In To post reply
 
 
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery
JavaScript/VBScriptBiztalkWPFPatten/PracticesWCFOthers
www.DotNetSpark.comUnAnsweredAll

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend