using System; using System.Drawing; using System.Windows.Forms; //Attention il faut donc linker avec ces librairies: using System.Text;//csc test.cs r:System.Windows.Form r:System.Text public class Form1 : Form { Label l; public Form1() { InitializeComponent(); } private void moveLabel(object source, MouseEventArgs e) { Console.WriteLine("{0}", e.X); l.Location = new System.Drawing.Point(e.X, e.Y); Update(); } //c'est standard de créer l'interface avec cette fonction private void InitializeComponent() { this.MouseDown += new MouseEventHandler(moveLabel); //on desactive le update de l'interface this.SuspendLayout(); l = new Label(); l.Text = "HALLO"; Controls.Add(l); //ici on ajoute les composantes de l'interface // par exemple vos buttons. //on reactive le update de l'interface this.ResumeLayout(false); } static void Main() { Application.Run(new Form1());//une boucle infinie qui gère l'interface } }