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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86
|
// Création d'un nouveau Form.
private Form fAddNotice = new Form();
// Création de nouveaux controls.
private Label lb_nom_notice = new Label();
private TextBox tb_nom_notice = new TextBox();
private Label lb_nom_realisateur = new Label();
private TextBox tb_nom_realisateur = new TextBox();
private Label lb_date = new Label();
private DateTimePicker dtp_notice = new DateTimePicker();
private Label lb_ref_notice = new Label();
private TextBox tb_ref_notice = new TextBox();
private Label lb_ver_notice = new Label();
private TextBox tb_ver_notice = new TextBox();
private Button bt_valider_new_fiche = new Button();
private Button bt_fermer_fAddNotice = new Button();
private void bt_add_notice_Click(object sender, EventArgs e)
{
fAddNotice.Text = "Ajouter une notice.";
fAddNotice.Size = new Size(700, 200);
// Nom de la notice.
lb_nom_notice.Text = "Nom de la notice";
lb_nom_notice.Size = new Size(100, 15);
lb_nom_notice.Location = new Point(15, 10);
tb_nom_notice.Location = new Point(10, 35);
tb_nom_notice.Size = new Size(113, 20);
// Nom du réalisateur de la notice.
lb_nom_realisateur.Text = "Réalisateur de la notice";
lb_nom_realisateur.Size = new Size(120, 15);
lb_nom_realisateur.Location = new Point(155, 10);
tb_nom_realisateur.Size = new Size(113, 20);
tb_nom_realisateur.Location = new Point(159, 35);
// Date de réalisation de la notice.
lb_date.Text = "Date de la notice";
lb_date.Size = new Size(100, 15);
lb_date.Location = new Point(310, 10);
dtp_notice.Size = new Size(100, 20);
dtp_notice.Format = DateTimePickerFormat.Short;
dtp_notice.Location = new Point(305, 35);
// Référence de la notice.
lb_ref_notice.Text = "Référence de la notice";
lb_ref_notice.Size = new Size(120, 15);
lb_ref_notice.Location = new Point(430, 10);
tb_ref_notice.Size = new Size(113, 20);
tb_ref_notice.Location = new Point(430, 35);
// Version de la notice.
lb_ver_notice.Text = "Version de la notice";
lb_ver_notice.Size = new Size(120, 15);
lb_ver_notice.Location = new Point(570, 10);
tb_ver_notice.Size = new Size(113, 20);
tb_ver_notice.Location = new Point(570, 35);
// Bouton valider.
bt_valider_new_fiche.Text = "Ajouter";
bt_valider_new_fiche.Size = new Size(75, 25);
bt_valider_new_fiche.Location = new Point(275, 100);
bt_valider_new_fiche.Click += new EventHandler(bt_valider_new_fiche_Click);
// Bouton fermer.
bt_fermer_fAddNotice.Text = "Fermer";
bt_fermer_fAddNotice.Size = new Size(75, 25);
bt_fermer_fAddNotice.Location = new Point(360, 100);
bt_fermer_fAddNotice.Click += new EventHandler(bt_fermer_fAddNotice_Click);
// Ajout des controls au Form.
fAddNotice.Controls.Add(lb_nom_notice);
fAddNotice.Controls.Add(tb_nom_notice);
fAddNotice.Controls.Add(lb_nom_realisateur);
fAddNotice.Controls.Add(tb_nom_realisateur);
fAddNotice.Controls.Add(lb_date);
fAddNotice.Controls.Add(dtp_notice);
fAddNotice.Controls.Add(lb_ref_notice);
fAddNotice.Controls.Add(tb_ref_notice);
fAddNotice.Controls.Add(lb_ver_notice);
fAddNotice.Controls.Add(tb_ver_notice);
fAddNotice.Controls.Add(bt_valider_new_fiche);
fAddNotice.Controls.Add(bt_fermer_fAddNotice);
// Ouverture du Form.
fAddNotice.ShowDialog();
} |
Partager