Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
|
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 16th, 2005, 10:06 AM
Authorized User
 
Join Date: Aug 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Chris Beach Send a message via AIM to Chris Beach Send a message via MSN to Chris Beach Send a message via Yahoo to Chris Beach
Default Overriding Form Close event

I have a form that's shown via a tray icon, I would like to override the forms 'x' close event so that it doesn't close the form and the application, and just minimizes the form.

Is it just a case of code in the closing event? or do I have override something?

 
Old January 16th, 2005, 10:20 AM
Authorized User
 
Join Date: Aug 2003
Posts: 26
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to Chris Beach Send a message via AIM to Chris Beach Send a message via MSN to Chris Beach Send a message via Yahoo to Chris Beach
Default

doh it was very easy:

        private void frmMain_FormClosing(object sender, FormClosingEventArgs e)
        {
            e.Cancel = true;
            WindowState = FormWindowState.Minimized;
        }






Similar Threads
Thread Thread Starter Forum Replies Last Post
Close all MdiChield form from open one form/Button salman .NET Framework 2.0 6 December 10th, 2007 03:21 AM
Close all MdiChield form from open one form salman .NET Framework 1.x 0 November 8th, 2007 12:32 AM
Handling IE Close Event mahulda General .NET 5 May 22nd, 2006 12:48 AM
Interrupting DoCmd.Close & Form Unload Event SerranoG Access 2 November 19th, 2005 03:41 PM
Close in the load event on child form gvozden VB.NET 0 October 22nd, 2003 10:48 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.