GOA - System.Windows.Forms.ItemCheckEventArgs

ItemCheckEventArgs Class


Provides data for the ItemCheck event of the CheckedListBox control.

Definition

public class ItemCheckEventArgs: EventArgs

Members Table

MethodDescription
EqualsOverloaded. Compares two objects to determine if they are equal. (Inherited from Object)
GetHashCodeServes as a hash function for a particular type, suitable for use in hashing algorithms and data structures like a hash table. (Inherited from Object)
GetTypeGets the Type of the current instance. (Inherited from Object)
ItemCheckEventArgsInitializes a new instance of ItemCheckEventArgs.
ReferenceEqualsDetermines whether the specified Object instances are the same instance. (Inherited from Object)
ToStringReturns a String that represents the current Object. (Inherited from Object)
PropertyDescription
CurrentValueGets a value of the CheckState indicating the current state of the check box of the item.
IndexGets the index of the item to change.
NewValueGets or sets a value of the CheckState indicating whether to set the check box for the item to be checked, unchecked, or indeterminate.
FieldDescription
EmptyRepresents an event with no event data. (Inherited from EventArgs)

Inheritance Hierarchy

Object
EventArgs
ItemCheckEventArgs

Examples

// This sample shows how to use the ItemCheckEventArgs to provide data for the ItemCheck event.

 

using System;

using System.Windows.Forms;

 

public class Form1 : System.Windows.Forms.Form

{

     private CheckedListBox checkedListBox;

 

     public Form1() { InitializeComponent(); }

 

     private void InitializeComponent()

     {

          // Adds the items to the CheckedListBox.

          string[] Items = {"Item1", "Item2","Item3"};

          this.checkedListBox = new CheckedListBox();

          this.checkedListBox.Items.AddRange(Items);

          this.checkedListBox.ItemCheck += new ItemCheckEventHandler(checkedListBox_ItemCheck);

          this.Controls.Add(this.checkedListBox);

     }

 

     private void checkedListBox_ItemCheck(object sender, ItemCheckEventArgs e)

     {

          if(e.NewValue==CheckState.Unchecked)

               MessageBox.Show("You have just unchecked an item.");

          else

               MessageBox.Show("You have just checked an item.");

     }

     public static void Main()

     {

          Application.Run(new Form1());

     }

}

Class Information

NamespaceSystem.Windows.Forms
Flash LibrarySystem.Windows.Forms.scl
Flash Library Version2.0.0.2118
Silverlight LibrarySystem.Windows.Forms.dll



© 2003-2007 NETiKA Technologies. All rights reserved.