using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace WindowsApplication4 { public class Icone { NotifyIcon niIcone; ContextMenu cmIcone; MenuItem miIcone; System.ComponentModel.IContainer components; public Icone() { this.components = new System.ComponentModel.Container(); this.cmIcone = new System.Windows.Forms.ContextMenu(); this.miIcone = new System.Windows.Forms.MenuItem(); cmIcone.MenuItems.AddRange(new System.Windows.Forms.MenuItem[] {miIcone}); this.miIcone.Index = 0; this.miIcone.Text = "E&xit"; this.miIcone.Click += new System.EventHandler(this.miIcone_Click); // Create the NotifyIcon. this.niIcone = new System.Windows.Forms.NotifyIcon(this.components); // The Icon property sets the icon that will appear // in the systray for this application. // copiez ici //?\WindowsApplication4\App.ico au //?\WindowsApplication4\bin\Debug niIcone.Icon = new Icon("App.ico"); // The Text property sets the text that will be displayed, // in a tooltip, when the mouse hovers over the systray icon. niIcone.Text = "Form1 (NotifyIcon example)"; niIcone.Visible = true; // Handle the DoubleClick event to activate the form. niIcone.DoubleClick += new System.EventHandler(this.niIcone_DoubleClick); while(true) { // do nothig // just for test // CtrlAltDel->Gestionnaire des taches // for stop it :) } } private void niIcone_DoubleClick(object Sender, EventArgs e) { // Show the form when the user double clicks on the notify icon. MessageBox.Show("2 click", "Name Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } private void miIcone_Click(object Sender, EventArgs e) { MessageBox.Show("1 Click", "Name Entry Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation); } static void Main() { Icone ic = new Icone(); } } }
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre questionwhile(true) { // do nothig // just for test // CtrlAltDel->Gestionnaire des taches // for stop it :) }
static void Main() { Icone ic = new Icone(); Application.Run(); }