AnchorStyles.Bottom | AnchorStyles.Right : Anchoring « GUI Windows Forms « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » GUI Windows Forms » Anchoring 
23.57.3.AnchorStyles.Bottom | AnchorStyles.Right
using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;
using System.Data;

  public class Form1 : Form
  {
    private TextBox messageBox;
    private Label label1;
    private Button sendButton;
    private Button clearButton;
    private System.ComponentModel.Container components = null;
    public Form1()
    {
      this.messageBox = new TextBox();
      this.label1 = new Label();
      this.sendButton = new Button();
      this.clearButton = new Button();
      this.SuspendLayout();
      // 
      this.messageBox.Anchor = ((AnchorStyles)(((AnchorStyles.Top | AnchorStyles.Left
        | AnchorStyles.Right)));
      this.messageBox.Font = new Font("Microsoft Sans Serif"8.25F
                            FontStyle.Bold, GraphicsUnit.Point, ((System.Byte)(0)));
      this.messageBox.Location = new Point(832);
      this.messageBox.Name = "messageBox";
      this.messageBox.Size = new Size(28020);
      this.messageBox.TabIndex = 0;
      this.messageBox.Text = "Type your Message here ...";
      // 
      this.label1.Font = new Font("Microsoft Sans Serif"8.25F
                           FontStyle.Bold, GraphicsUnit.Point, ((System.Byte)(0)));
      this.label1.Location = new Point(88);
      this.label1.Name = "label1";
      this.label1.Size = new Size(5616);
      this.label1.TabIndex = 1;
      this.label1.Text = "Message";
      // 
      this.sendButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
      this.sendButton.Location = new Point(13672);
      this.sendButton.Name = "sendButton";
      this.sendButton.Size = new Size(7224);
      this.sendButton.TabIndex = 2;
      this.sendButton.Text = "Send";
      // 
      this.clearButton.Anchor = ((AnchorStyles)((AnchorStyles.Bottom | AnchorStyles.Right)));
      this.clearButton.Location = new Point(21672);
      this.clearButton.Name = "clearButton";
      this.clearButton.Size = new Size(7224);
      this.clearButton.TabIndex = 3;
      this.clearButton.Text = "Clear";
      // 
      this.AutoScaleBaseSize = new Size(513);
      this.ClientSize = new Size(292101);
      this.Controls.Add(this.clearButton);
      this.Controls.Add(this.sendButton);
      this.Controls.Add(this.label1);
      this.Controls.Add(this.messageBox);
      this.Name = "Form1";
      this.Text = "Anchoring Windows Forms Controls";
      this.ResumeLayout(false);
    }
    [STAThread]
    static void Main() 
    {
      Application.Run(new Form1());
    }
  }
23.57.Anchoring
23.57.1.Anchor and dockAnchor and dock
23.57.2.Control AnchoringControl Anchoring
23.57.3.AnchorStyles.Bottom | AnchorStyles.Right
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.