2 // Copyright (c) 2005 Novell, Inc.
5 // Ritvik Mayank (mritvik@novell.com)
10 using System.Windows.Forms;
13 namespace MonoTests.System.Windows.Forms
16 public class CheckedListBoxItemCheckEvent
18 static bool eventhandled = false;
19 public void ItemCheck_EventHandler (object sender,ItemCheckEventArgs e)
25 public void ItemCheckTest ()
27 Form myform = new Form ();
28 CheckedListBox mychklstbox = new CheckedListBox ();
29 mychklstbox.Items.Add ("test1");
30 mychklstbox.Items.Add ("test2");
31 //Test ItemCheck Event
32 mychklstbox.ItemCheck += new ItemCheckEventHandler (ItemCheck_EventHandler);
33 mychklstbox.Items.Add ("test1",CheckState.Checked);
34 myform.Controls.Add (mychklstbox);
36 Assert.AreEqual (true, eventhandled, "#A1");
38 mychklstbox.SetItemChecked (1,true);
39 Assert.AreEqual (true, eventhandled, "#A2");