using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; using System.Data; namespace TestsIHM { public class Form1 : System.Windows.Forms.Form { private System.Windows.Forms.Label label1; private System.Windows.Forms.Label label2; private System.Windows.Forms.Label label3; private System.Windows.Forms.Label label4; private System.Windows.Forms.TextBox nom; private System.Windows.Forms.TextBox prenom; private System.Windows.Forms.DateTimePicker dateNaissance; private System.Windows.Forms.NumericUpDown articles; private System.Windows.Forms.PictureBox pictureBox1; private System.Windows.Forms.Button nextGuru; private System.Windows.Forms.Button previousGuru; private System.ComponentModel.Container components = null; private static DateTime start; private static DateTime end; static Form1(){ start = DateTime.Now; } public Form1() { InitializeComponent(); VisibleChanged += new System.EventHandler(this.devenuVisible); } public void devenuVisible(Object s, EventArgs evt) { end = DateTime.Now; TimeSpan ts = end.Subtract(start); if (Visible) MessageBox.Show("Temps écoulé : " + ts.TotalMilliseconds ); } protected override void Dispose( bool disposing ) { if( disposing ) { if (components != null) { components.Dispose(); } } base.Dispose( disposing ); } #region Windows Form Designer generated code /// /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// private void InitializeComponent() { System.Resources.ResourceManager resources = new System.Resources.ResourceManager(typeof(Form1)); this.label1 = new System.Windows.Forms.Label(); this.label2 = new System.Windows.Forms.Label(); this.label3 = new System.Windows.Forms.Label(); this.label4 = new System.Windows.Forms.Label(); this.nom = new System.Windows.Forms.TextBox(); this.prenom = new System.Windows.Forms.TextBox(); this.dateNaissance = new System.Windows.Forms.DateTimePicker(); this.articles = new System.Windows.Forms.NumericUpDown(); this.pictureBox1 = new System.Windows.Forms.PictureBox(); this.nextGuru = new System.Windows.Forms.Button(); this.previousGuru = new System.Windows.Forms.Button(); ((System.ComponentModel.ISupportInitialize)(this.articles)).BeginInit(); this.SuspendLayout(); // // label1 // this.label1.Location = new System.Drawing.Point(128, 24); this.label1.Name = "label1"; this.label1.Size = new System.Drawing.Size(40, 23); this.label1.TabIndex = 0; this.label1.Text = "Nom"; // // label2 // this.label2.Location = new System.Drawing.Point(112, 48); this.label2.Name = "label2"; this.label2.Size = new System.Drawing.Size(56, 23); this.label2.TabIndex = 1; this.label2.Text = "Prénom"; // // label3 // this.label3.Location = new System.Drawing.Point(40, 80); this.label3.Name = "label3"; this.label3.Size = new System.Drawing.Size(120, 24); this.label3.TabIndex = 2; this.label3.Text = "Date de Naissance"; // // label4 // this.label4.Location = new System.Drawing.Point(64, 112); this.label4.Name = "label4"; this.label4.Size = new System.Drawing.Size(96, 24); this.label4.TabIndex = 3; this.label4.Text = "Articles publiés"; // // nom // this.nom.Location = new System.Drawing.Point(176, 16); this.nom.Name = "nom"; this.nom.TabIndex = 4; this.nom.Text = ""; // // prenom // this.prenom.Location = new System.Drawing.Point(176, 48); this.prenom.Name = "prenom"; this.prenom.TabIndex = 5; this.prenom.Text = ""; // // dateNaissance // this.dateNaissance.Location = new System.Drawing.Point(176, 80); this.dateNaissance.Name = "dateNaissance"; this.dateNaissance.Size = new System.Drawing.Size(216, 22); this.dateNaissance.TabIndex = 6; // // articles // this.articles.Location = new System.Drawing.Point(176, 112); this.articles.Name = "articles"; this.articles.Size = new System.Drawing.Size(40, 22); this.articles.TabIndex = 7; // // pictureBox1 // this.pictureBox1.Image = ((System.Drawing.Bitmap)(resources.GetObject("pictureBox1.Image"))); this.pictureBox1.Location = new System.Drawing.Point(16, 160); this.pictureBox1.Name = "pictureBox1"; this.pictureBox1.Size = new System.Drawing.Size(808, 528); this.pictureBox1.TabIndex = 8; this.pictureBox1.TabStop = false; // // nextGuru // this.nextGuru.Location = new System.Drawing.Point(488, 80); this.nextGuru.Name = "nextGuru"; this.nextGuru.Size = new System.Drawing.Size(104, 23); this.nextGuru.TabIndex = 9; this.nextGuru.Text = "Next Guru ->"; // // previousGuru // this.previousGuru.Location = new System.Drawing.Point(440, 32); this.previousGuru.Name = "previousGuru"; this.previousGuru.Size = new System.Drawing.Size(120, 23); this.previousGuru.TabIndex = 10; this.previousGuru.Text = "<- Previous Guru"; // // Form1 // this.AutoScaleBaseSize = new System.Drawing.Size(6, 15); this.ClientSize = new System.Drawing.Size(672, 656); this.Controls.AddRange(new System.Windows.Forms.Control[] { this.previousGuru, this.nextGuru, this.pictureBox1, this.articles, this.dateNaissance, this.prenom, this.nom, this.label4, this.label3, this.label2, this.label1}); this.Name = "Form1"; this.Text = "Form1"; ((System.ComponentModel.ISupportInitialize)(this.articles)).EndInit(); this.ResumeLayout(false); } #endregion [STAThread] static void Main() { Application.Run(new Form1()); } private void Form1_Load(object sender, System.EventArgs e) { } } }