Style ‘Anchor’: Indiquer aux composants de dessiner son bas à l’égard du forme parent

Author:

Style,'Anchor':,Indiquer,aux,composants,de,dessiner,son,bas,à,l'égard,du,forme,parent
{filelink=14631}

  using System;
  using System.Drawing;
  using System.Collections;
  using System.ComponentModel;
  using System.Windows.Forms;
  using System.Data;

  public class ExempleAnchorBottom : System.Windows.Forms.Form
  {
    private System.Windows.Forms.Button bouton;

    public ExempleAnchorBottom()
    {
      InitializeComponent();
      CenterToScreen();
    }
    private void InitializeComponent()
    {
      this.bouton = new System.Windows.Forms.Button();
      this.Controls.AddRange(new System.Windows.Forms.Control[] {this.bouton});
      this.Text = "Anchoring des Controles: Style 'Dock' inférieur";

      bouton.Anchor = AnchorStyles.Bottom;
      bouton.Dock = DockStyle.Left;
      bouton.Text = "Anchor: " + bouton.Anchor.ToString() +
        "Dock: " + bouton.Dock.ToString();
      this.bouton.Click += new System.EventHandler(this.bouton_Click);
    }
      private void bouton_Click(object sender, System.EventArgs e)
      {
          MessageBox.Show("Exemple 'Anchoring': Style 'bottom'");
      }
    static void Main()
    {
      Application.Run(new ExempleAnchorBottom());
    }

  }

Leave a Reply

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