using System; using System.Drawing; using System.Collections; using System.ComponentModel; using System.Windows.Forms; namespace NewMarche2013 { /// <summary> /// Description résumée de Form1. /// </summary> public class Form1 : System.Windows.Forms.Form { MettreBoutton mesBouttons public FormPasswd() { InitializeComponent(); mesBouttons = new MettreBoutton(this); } } }
using System; using System.Linq; using System.Collections.Generic; using System.Text; using System.Windows.Forms; namespace Boutton { class MettreBoutton { private Button btnAnnuler = new Button(); private Button btnValider = new Button(); private void InitialiseComponent(Control Parent) { // // btnAnnuler // this.btnAnnuler.BackColor = System.Drawing.Color.Red; this.btnAnnuler.ForeColor = System.Drawing.Color.White; this.btnAnnuler.Location = new System.Drawing.Point(3, 134); this.btnAnnuler.Name = "btnAnnuler"; this.btnAnnuler.Size = new System.Drawing.Size(103, 35); this.btnAnnuler.TabIndex = 3; this.btnAnnuler.Text = "Annuler"; this.btnAnnuler.Click += new System.EventHandler(this.btnAnnul_Click); this.btnAnnuler.Parent = Parent; // // btnValider // this.btnValider.BackColor = System.Drawing.Color.Lime; this.btnValider.Location = new System.Drawing.Point(133, 134); this.btnValider.Name = "btnValider"; this.btnValider.Size = new System.Drawing.Size(103, 35); this.btnValider.TabIndex = 2; this.btnValider.Text = "Valider"; this.btnValider.Click += new System.EventHandler(this.btnValid_Click); this.btnValider.Parent = Parent; } public MettreBoutton (Control Parent) { InitialiseComponent(Parent); } private void btnAnnul_Click(object sender, System.EventArgs e) { //Code d'annuler } private void btnValid_Click(object sender, System.EventArgs e) { //Code de la validation } } }
private System.ComponentModel.IContainer components = null;
public NewMarche2013() { // // Requis pour la prise en charge du Concepteur Windows Forms // InitializeComponent(); // // TODO : ajoutez le code du constructeur après l'appel à InitializeComponent // }
protected override void Dispose(bool disposing) { if (disposing && (components != null)) { components.Dispose(); } base.Dispose(disposing); } #region Windows Form Designer generated code /// <summary> /// Required method for Designer support - do not modify /// the contents of this method with the code editor. /// </summary>
Vous n’avez pas trouvé la réponse que vous recherchez ?
Posez votre question