Appliquer le Style ‘Plat'(FlatStyle) à un contrôle

Author:

Appliquer,le,Style,'Plat'(FlatStyle),à,un,contrôle
{filelink=14642}

using System;
using System.Drawing;
using System.Windows.Forms;

class StyleBouton: Form
{
     public static void Main()
     {
          Application.Run(new StyleBouton());
     }
     public StyleBouton()
     {
          int y = 0;
         // Modifier le titre de la fenêtre
          Text = "Exemple de StyleFlat";

          foreach (FlatStyle fs in Enum.GetValues(typeof(FlatStyle)))
          {
               Button btn    = new Button();
               btn.Parent    = this;
               btn.FlatStyle = fs;
               btn.Text      = fs.ToString();
               btn.Location  = new Point(50, y += 50);
          }
     }

}

Leave a Reply

Your email address will not be published. Required fields are marked *