Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Gérer l’événement ‘ThreadExit’

Utilitaire,Plateforme:,non,edité
{filelink=17884}

using System;
using System.Windows.Forms;
using System.Threading;
 
namespace Exemple3
{
    public class EvenementThreadExit : Form
    {
        public EvenementThreadExit()
        {
            Text = "Exemple de l'événement 'ThreadExit'";
        }
        public static void Main()
        {
            EvenementThreadExit FormObject = new EvenementThreadExit();
            ApplicationEventHandlerClass AppEvents = new ApplicationEventHandlerClass();
 
            Application.ThreadExit += new EventHandler(AppEvents.OnThreadExit);
            Application.Run(FormObject);
        }
    }
 
    public class ApplicationEventHandlerClass
    {
 
        public void OnThreadExit(object sender, EventArgs e)
        {
            MessageBox.Show("Le thread de l'application a été arrêté");
        }
    }
 
}

No comments yet.

Leave a Comment