Пример #1
0
        private void CreerOuiNonBoutons()
        {
            Point position = new Point(
                ClientSize.Width / 4 - taille.Width / 2,
                ClientSize.Height - taille.Height - 15
                );

            Bouton bouton = CreerBouton(position, @"Oui");

            bouton.Click += (sender, args) =>
            {
                resultat = DialogResult.Yes;
                Action_Fermeture(sender, args);
            };

            position = new Point(
                ClientSize.Width * 3 / 4 - taille.Width / 2,
                ClientSize.Height - taille.Height - 15
                );
            bouton = CreerBouton(position, @"Non");

            bouton.Click += (sender, args) =>
            {
                resultat = DialogResult.No;
                Action_Fermeture(sender, args);
            };
        }
Пример #2
0
        private void CreerOkButton()
        {
            Point position = new Point(
                (ClientSize.Width - taille.Width) / 2,
                ClientSize.Height - taille.Height - 15
                );

            Bouton boutonOk = CreerBouton(position, @"OK");

            boutonOk.Click += Action_Fermeture;
        }
Пример #3
0
        private Bouton CreerBouton(Point position, string texte)
        {
            Bouton bouton = new Bouton
            {
                Location = position,
                Size     = taille, Text = texte
            };

            Controls.Add(bouton);

            return(bouton);
        }