CheckButton on a Form : CheckBox « GUI Windows Form « C# / C Sharp

Home
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.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » CheckBoxScreenshots 
CheckButton on a Form
CheckButton on a Form

/*
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 CheckButton
{
  /// <summary>
  /// Summary description for FormCheckButton.
  /// </summary>
  public class FormCheckButton : System.Windows.Forms.Form
  {
    private System.Windows.Forms.CheckBox checkBox1;
    private System.Windows.Forms.Button button1;
    private System.ComponentModel.IContainer components;

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

      //
      // TODO: Add any constructor code after InitializeComponent call
      //
      checkBox1.Appearance = Appearance.Button;
      checkBox1.FlatStyle = FlatStyle.System;
      checkBox1.TextAlign = ContentAlignment.MiddleCenter;
    }

    /// <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.button1 = new System.Windows.Forms.Button();
      this.checkBox1 = new System.Windows.Forms.CheckBox();
      this.SuspendLayout();
      // 
      // button1
      // 
      this.button1.Location = new System.Drawing.Point(7240);
      this.button1.Name = "button1";
      this.button1.Size = new System.Drawing.Size(10432);
      this.button1.TabIndex = 1;
      this.button1.Text = "button1";
      // 
      // checkBox1
      // 
      this.checkBox1.FlatStyle = System.Windows.Forms.FlatStyle.Flat;
      this.checkBox1.Location = new System.Drawing.Point(7288);
      this.checkBox1.Name = "checkBox1";
      this.checkBox1.Size = new System.Drawing.Size(10432);
      this.checkBox1.TabIndex = 0;
      this.checkBox1.Text = "checkBox1";
      // 
      // FormCheckButton
      // 
      this.AutoScaleBaseSize = new System.Drawing.Size(513);
      this.ClientSize = new System.Drawing.Size(292141);
      this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                      this.button1,
                                      this.checkBox1});
      this.Name = "FormCheckButton";
      this.Text = "FormCheckButton";
      this.ResumeLayout(false);

    }
    #endregion

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



           
       
Related examples in the same category
1.CheckBox with Label
2.CheckBox Image
3.Subclass CheckBox
4.CheckedChanged Event
5.Is CheckBox checkedIs CheckBox checked
6.CheckBox click (Selected/Unselected) eventCheckBox click (Selected/Unselected) event
7.CheckBox StyleCheckBox Style
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.