CheckBox click (Selected/Unselected) event : 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 
CheckBox click (Selected/Unselected) event
CheckBox click (Selected/Unselected) event

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

   public class CheckBoxTest : System.Windows.Forms.Form
   {
      private System.Windows.Forms.CheckBox boldCheckBox;
      private System.Windows.Forms.CheckBox italicCheckBox;

      private System.Windows.Forms.Label outputLabel;

      public CheckBoxTest()
      {
         InitializeComponent();
      }

      private void InitializeComponent()
      {
         this.boldCheckBox = new System.Windows.Forms.CheckBox();
         this.outputLabel = new System.Windows.Forms.Label();
         this.italicCheckBox = new System.Windows.Forms.CheckBox();
         this.SuspendLayout();

         this.boldCheckBox.Location = new System.Drawing.Point7256 );
         this.boldCheckBox.Name = "boldCheckBox";
         this.boldCheckBox.Size = new System.Drawing.Size4824 );
         this.boldCheckBox.TabIndex = 1;
         this.boldCheckBox.Text = "Bold";

         this.boldCheckBox.CheckedChanged += new System.EventHandler(this.boldCheckBox_CheckedChanged );

         this.outputLabel.Location = new System.Drawing.Point6424 );
         this.outputLabel.Name = "outputLabel";
         this.outputLabel.Size = new System.Drawing.Size15216 );
         this.outputLabel.TabIndex = 0;
         this.outputLabel.Text = "WWW.JAVA2S.COM";

         this.italicCheckBox.Location = new System.Drawing.Point16056 );
         this.italicCheckBox.Name = "italicCheckBox";
         this.italicCheckBox.Size = new System.Drawing.Size4824 );
         this.italicCheckBox.TabIndex = 1;
         this.italicCheckBox.Text = "Italic";
         this.italicCheckBox.CheckedChanged += new System.EventHandler(this.italicCheckBox_CheckedChanged );

         this.AutoScaleBaseSize = new System.Drawing.Size513 );
         this.ClientSize = new System.Drawing.Size264109 );
         this.Controls.AddRange(new System.Windows.Forms.Control[] {
               this.italicCheckBox,this.boldCheckBox,this.outputLabel } );
         this.Name = "CheckBoxTest";
         this.Text = "CheckBoxTest";
         this.ResumeLayoutfalse );

      }
      [STAThread]
      static void Main() 
      {
         Application.Runnew CheckBoxTest() );
      }

      private void boldCheckBox_CheckedChanged(object sender, System.EventArgs e )
      {
         outputLabel.Font =new FontoutputLabel.Font.Name,outputLabel.Font.Size,
            outputLabel.Font.Style ^ FontStyle.Bold );
      }
 
      private void italicCheckBox_CheckedChanged(object sender, System.EventArgs e )
      {
         outputLabel.Font = new FontoutputLabel.Font.Name,
            outputLabel.Font.Size,outputLabel.Font.Style ^ FontStyle.Italic );
      }
   }


           
       
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.CheckButton on a FormCheckButton on a Form
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.