C#
  Home arrow C# arrow Page 2 - C# Simplified, part 7: Working with WinFor...
ASP Free Forums 
.NET  
ASP  
ASP Code  
ASP.NET  
ASP.NET Code  
BrainDump  
C#  
Code Examples  
Database  
Database Code  
IIS  
Microsoft Access  
MS SQL Server  
Visual Basic.NET  
Windows Scripting  
Windows Security  
XML  
ASP Web Hosting  
ASP.NET Web Hosting 
Mobile Linux 
App Generation ROI 
Windows Web Hosting
 
IBM® developerWorks 
Sun Developer Network 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
C#

C# Simplified, part 7: Working with WinForm Controls
By: Anand Narayanaswamy
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 11
    2005-06-14

    Table of Contents:
  • C# Simplified, part 7: Working with WinForm Controls
  • Working with Checkboxes
  • Working with RadioButtons
  • Working with Labels
  • Working with Combo boxes
  • Working with List boxes

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    C# Simplified, part 7: Working with WinForm Controls - Working with Checkboxes


    (Page 2 of 6 )

    Checkboxes enable you to select more than one item at a time. This control is widely used in all applications. The moment you click on an item, a tick mark appears on the control. The tick mark will disappear if you click it again. Listing 7.2 illustrates this control:

    Listing 7.2

    001: using System;
    002: using System.Drawing;
    003: using System.Windows.Forms;
    004:
    005: public class MyCheckbox:Form
    006: {
    007:   CheckBox c1 = new CheckBox();
    008:   CheckBox c2 = new CheckBox();
    009:   CheckBox c3 = new CheckBox();
    010:
    011:   MyCheckbox()
    012:   {
    013:     c1.Text = "Football";
    014:     c2.Text = "BasketBall";
    015:     c3.Text = "Swimming";
    016:
    017:     c1.Location = new Point(50,40);
    018:     c2.Location = new Point(50,60);
    019:     c3.Location = new Point(50,80);
    020:
    021:     this.Controls.Add(c1);
    022:     this.Controls.Add(c2);
    023:     this.Controls.Add(c3);
    024:
    025:     this.Text = "CheckBox Control Demo";
    026:   }
    027:
    028:   public static void Main()
    029:   {
    030:     MyCheckbox mychk = new MyCheckbox();
    031:     Application.Run(mychk);
    032:   }
    033: }

    Output

    Figure 7.2

    More C# Articles
    More By Anand Narayanaswamy


     

    C# ARTICLES

    - C# and XML
    - Pointers and Arrays in C#
    - C# 3.0 Extension Methods
    - Overloading Operators in C#
    - Iterators and Nullable Types
    - Patterns and Iterators in C#
    - C# Exceptions
    - Methods in C#
    - Delegates and Events in C#
    - Advanced C#
    - Working with Regular Expressions in C#
    - Sending Simple E-Mail in C#
    - Building C# Comparable Objects: IComparable ...
    - Color Transformation Applications in C# GDI+...
    - Performing Color Transformation Operations i...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT