Bonjour,

J'ai un probleme pour bloquer la fermeture de mon application avec visual studio 2005.

Voici mon code :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
 
 
 
public FormEFB()

{
InitializeComponent();
this. += newCancelEventHandler(this.FormEFB_FormClosed); activer_menu();
} privatevoid FormEFB_FormClosed(object sender, CancelEventArgs e) {
if (MessageBox.Show("Vous allez quitter le logiciel.\r\n Voulez vous continuer ?", "Deconnection", MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.No)
{ e.Cancel =
true; this.Hide(); }
else {
if (Program.utilisateur) {
Program.Public_ogj_moteur.Maj_presence(dataSetEFBS1.utilisateur.Rows[0]["utilisateur"].ToString(), 0);
}
}
}


Voici le message d'erreur :

Error 1 Cannot implicitly convert type 'System.ComponentModel.CancelEventHandler' to 'System.Windows.Forms.FormClosedEventHandler' D:\EFB\DEV\DATA ACCES\EFB\EFB\FormEFB.cs 16 45 EFB

(l'erreur est souligner)

Merci de vos réponses