Provides data for the ItemCheck event of the CheckedListBox control.
public class ItemCheckEventArgs: EventArgs
ObjectEventArgsItemCheckEventArgs
// 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());
}
}
Namespace System.Windows.Forms Flash Library System.Windows.Forms.scl Flash Library Version 2.0.0.2118 Silverlight Library System.Windows.Forms.dll
| © 2003-2007 NETiKA Technologies. All rights reserved. |