Form Anchor : Control Anchor « GUI Windows Form « C# / C Sharp

C# / C Sharp
1. 2D Graphics
2. Class Interface
3. Collections Data Structure
4. Components
5. Data Types
6. Database ADO.net
7. Design Patterns
8. Development Class
9. Event
10. File Stream
11. Generics
12. GUI Windows Form
13. Language Basics
14. LINQ
15. Network
16. Office
17. Reflection
18. Regular Expressions
19. Security
20. Services Event
21. Thread
22. Web Services
23. Windows
24. XML
25. XML LINQ
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
C# / C Sharp » GUI Windows Form » Control AnchorScreenshots 
Form Anchor
Form Anchor

/*
C# Programming Tips & Techniques
by Charles Wright, Kris Jamsa

Publisher: Osborne/McGraw-Hill (December 28, 2001)
ISBN: 0072193794
*/

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

namespace Anchor
{
  /// <summary>
  /// Summary description for Form1.
  /// </summary>
  public class FormAnchor : System.Windows.Forms.Form
  {
    private System.Windows.Forms.Button btnOK;
    private System.Windows.Forms.Button btnCancel;
    private System.Windows.Forms.TextBox textBox1;
    private System.Windows.Forms.Button btnClear;
    private System.Windows.Forms.CheckBox checkBox1;
    private System.Windows.Forms.CheckBox checkBox2;
    private System.Windows.Forms.CheckBox checkBox3;
    private System.Windows.Forms.RadioButton radioButton1;
    private System.Windows.Forms.RadioButton radioButton2;
    /// <summary>
    /// Required designer variable.
    /// </summary>
    private System.ComponentModel.Container components = null;

    public FormAnchor()
    {
      //
      // Required for Windows Form Designer support
      //
      InitializeComponent();

      //
      // TODO: Add any constructor code after InitializeComponent call
      //
    }

    /// <summary>
    /// Clean up any resources being used.
    /// </summary>
    protected override void Disposebool disposing )
    {
      ifdisposing )
      {
        if (components != null
        {
          components.Dispose();
        }
      }
      base.Disposedisposing );
    }

    #region Windows Form Designer generated code
    /// <summary>
    /// Required method for Designer support - do not modify
    /// the contents of this method with the code editor.
    /// </summary>
    private void InitializeComponent()
    {
      this.btnOK = new System.Windows.Forms.Button();
      this.btnCancel = new System.Windows.Forms.Button();
      this.textBox1 = new System.Windows.Forms.TextBox();
      this.btnClear = new System.Windows.Forms.Button();
      this.checkBox1 = new System.Windows.Forms.CheckBox();
      this.checkBox2 = new System.Windows.Forms.CheckBox();
      this.checkBox3 = new System.Windows.Forms.CheckBox();
      this.radioButton1 = new System.Windows.Forms.RadioButton();
      this.radioButton2 = new System.Windows.Forms.RadioButton();
      this.SuspendLayout();
      // 
      // btnOK
      // 
      this.btnOK.Anchor = System.Windows.Forms.AnchorStyles.Bottom;
      this.btnOK.Location = new System.Drawing.Point(106188);
      this.btnOK.Name = "btnOK";
      this.btnOK.Size = new System.Drawing.Size(7232);
      this.btnOK.TabIndex = 0;
      this.btnOK.Text = "Bottom";
      // 
      // btnCancel
      // 
      this.btnCancel.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right);
      this.btnCancel.Location = new System.Drawing.Point(196188);
      this.btnCancel.Name = "btnCancel";
      this.btnCancel.Size = new System.Drawing.Size(7232);
      this.btnCancel.TabIndex = 1;
      this.btnCancel.Text = "Bottom Right";
      // 
      // textBox1
      // 
      this.textBox1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom
        | System.Windows.Forms.AnchorStyles.Left
        | System.Windows.Forms.AnchorStyles.Right);
      this.textBox1.Location = new System.Drawing.Point(7280);
      this.textBox1.Multiline = true;
      this.textBox1.Name = "textBox1";
      this.textBox1.Size = new System.Drawing.Size(14060);
      this.textBox1.TabIndex = 2;
      this.textBox1.Text = "Top Bottom Left Right";
      // 
      // btnClear
      // 
      this.btnClear.Anchor = (System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left);
      this.btnClear.Location = new System.Drawing.Point(16188);
      this.btnClear.Name = "btnClear";
      this.btnClear.Size = new System.Drawing.Size(7232);
      this.btnClear.TabIndex = 3;
      this.btnClear.Text = "Bottom Left";
      // 
      // checkBox1
      // 
      this.checkBox1.Location = new System.Drawing.Point(168);
      this.checkBox1.Name = "checkBox1";
      this.checkBox1.Size = new System.Drawing.Size(5624);
      this.checkBox1.TabIndex = 4;
      this.checkBox1.Text = "Top Left";
      // 
      // checkBox2
      // 
      this.checkBox2.Anchor = (System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right);
      this.checkBox2.Location = new System.Drawing.Point(2288);
      this.checkBox2.Name = "checkBox2";
      this.checkBox2.Size = new System.Drawing.Size(6424);
      this.checkBox2.TabIndex = 5;
      this.checkBox2.Text = "Top Right";
      // 
      // checkBox3
      // 
      this.checkBox3.Anchor = System.Windows.Forms.AnchorStyles.Top;
      this.checkBox3.Location = new System.Drawing.Point(1068);
      this.checkBox3.Name = "checkBox3";
      this.checkBox3.Size = new System.Drawing.Size(8024);
      this.checkBox3.TabIndex = 6;
      this.checkBox3.Text = "Top";
      // 
      // radioButton1
      // 
      this.radioButton1.Anchor = System.Windows.Forms.AnchorStyles.Left;
      this.radioButton1.Location = new System.Drawing.Point(882);
      this.radioButton1.Name = "radioButton1";
      this.radioButton1.Size = new System.Drawing.Size(4848);
      this.radioButton1.TabIndex = 7;
      this.radioButton1.Text = "Left";
      // 
      // radioButton2
      // 
      this.radioButton2.Anchor = System.Windows.Forms.AnchorStyles.Right;
      this.radioButton2.Location = new System.Drawing.Point(22882);
      this.radioButton2.Name = "radioButton2";
      this.radioButton2.Size = new System.Drawing.Size(5648);
      this.radioButton2.TabIndex = 8;
      this.radioButton2.Text = "Right";
      // 
      // FormAnchor
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(513);
      this.ClientSize = new System.Drawing.Size(296245);
      this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                      this.radioButton2,
                                      this.radioButton1,
                                      this.checkBox3,
                                      this.checkBox2,
                                      this.checkBox1,
                                      this.btnClear,
                                      this.textBox1,
                                      this.btnCancel,
                                      this.btnOK});
      this.Name = "FormAnchor";
      this.Text = "FormAnchor";
      this.ResumeLayout(false);

    }
    #endregion

    /// <summary>
    /// The main entry point for the application.
    /// </summary>
    [STAThread]
    static void Main() 
    {
      Application.Run(new FormAnchor());
    }
  }
}


           
       
Related examples in the same category
w___w___w.__j__av_a_2__s__.co__m_ | Contact Us
Copyright 2003 - 08 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.