126 references to Items
System.Windows.Forms (16)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedIndexCollection.cs (2)
148return _owner.Items.InnerArray; 161if (index >= 0 && index < _owner.Items.Count)
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.CheckedItemCollection.cs (1)
43return _owner.Items.InnerArray;
System\Windows\Forms\Controls\ListBoxes\CheckedListBox.cs (13)
229ObjectCollection items = Items; 373ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 415if (index < 0 || index >= Items.Count) 485if (e.Index < Items.Count) 487item = Items[e.Index]; 507if (e.Index < Items.Count) 714if (Items.Count == 0 && 835CheckState[] savedCheckedItems = new CheckState[Items.Count]; 836for (int i = 0; i < Items.Count; i++) 845for (int j = 0; j < Items.Count; j++) 858ArgumentOutOfRangeException.ThrowIfGreaterThanOrEqual(index, Items.Count); 945if (item < 0 || item >= Items.Count) 958if (item < 0 || item >= Items.Count || (state != LB_CHECKED && state != LB_UNCHECKED))
System.Windows.Forms.Tests (106)
CheckedListBoxTests.cs (50)
145box.Items.Add("item1"); 270Assert.Empty(control.Items); 275Assert.Empty(control.Items); 283control.Items.Add("item1"); 284control.Items.Add("item2"); 287Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 292Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 309Assert.Empty(control.Items); 317Assert.Empty(control.Items); 328control.Items.Add("item1"); 329control.Items.Add("item2"); 339Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 347Assert.Equal(new object[] { "item1", "item2" }, control.Items.Cast<object>()); 371control.Items.Add(new CheckBox(), false); 388control.Items.Add(new CheckBox(), false); 398box.Items.Add(new CheckBox(), false); 418control.Items.Add("item1"); 419control.Items.Add("item2"); 433control.Items.Add("item1"); 434control.Items.Add("item2"); 486control.Items.Add("item1"); 507checkedListBox.Items.AddRange((object[])["1", "2", "3"]); 508checkedListBox.SelectedItem = checkedListBox.Items[0]; 510Assert.Equal(3, checkedListBox.Items.Count); 511Assert.Equal(checkedListBox.Items[0], checkedListBox.SelectedItem); 516checkedListBox.Items.Remove(checkedListBox.Items[2]); 518Assert.Equal(2, checkedListBox.Items.Count); 519Assert.Equal(checkedListBox.Items[0], checkedListBox.SelectedItem); 524checkedListBox.Items.Remove(checkedListBox.Items[1]); 526Assert.Single(checkedListBox.Items); 527Assert.Equal(checkedListBox.Items[0], checkedListBox.SelectedItem); 546checkedListBox.Items.AddRange((object[])["1", "2", "3"]); 548for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 550checkedListBox.SelectedItem = checkedListBox.Items[0]; 552Assert.Equal(checkedListBox.Items[0], checkedListBox.SelectedItem); 557checkedListBox.Items.Remove(checkedListBox.Items[0]); 560Assert.Equal(count, checkedListBox.Items.Count); 580checkedListBox.Items.AddRange((object[])["1", "2", "3"]); 584for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 589checkedListBox.Items.Remove(checkedListBox.Items[2]); 593Assert.Equal(count, checkedListBox.Items.Count); 611checkedListBox.Items.AddRange((object[])["1", "2", "3"]); 613for (int count = checkedListBox.Items.Count; count > 1; count -= 1) 620checkedListBox.Items.Remove(checkedListBox.Items[0]); 624Assert.Equal(count, checkedListBox.Items.Count);
System\Windows\Forms\AccessibleObjects\CheckedListBoxAccessibleObjectTests.cs (17)
19checkedListBox.Items.Add("a"); 20checkedListBox.Items.Add("b"); 21checkedListBox.Items.Add("c"); 22checkedListBox.Items.Add("d"); 23checkedListBox.Items.Add("e"); 24checkedListBox.Items.Add("f"); 25checkedListBox.Items.Add("g"); 26checkedListBox.Items.Add("h"); 27checkedListBox.Items.Add("i"); 32for (int i = 0; i < checkedListBox.Items.Count; i++) 117checkedListBox.Items.Add(i); 141checkedListBox.Items.Add(0); 142checkedListBox.Items.Add(1); 143checkedListBox.Items.Add(2); 157checkedListBox.Items.Add(0); 158checkedListBox.Items.Add(1); 159checkedListBox.Items.Add(2);
System\Windows\Forms\AccessibleObjects\CheckedListBoxItemAccessibleObjectTests.cs (31)
48checkedListBox.Items.Add(testName); 58checkedListBox.Items.Add("A"); 69checkedListBox.Items.Add(0); 70checkedListBox.Items.Add(1); 71checkedListBox.Items.Add(2); 90checkedListBox.Items.Add("A"); 102checkedListBox.Items.Add("A"); 117checkedListBox.Items.Add(0); 118checkedListBox.Items.Add(1); 119checkedListBox.Items.Add(2); 133checkedListBox.Items.Add(0); 134checkedListBox.Items.Add(1); 135checkedListBox.Items.Add(2); 152checkedListBox.Items.Add(0); 153checkedListBox.Items.Add(1); 154checkedListBox.Items.Add(2); 170checkedListBox.Items.Add("A"); 187checkedListBox.Items.Add("A"); 200checkedListBox.Items.Add("A"); 214checkedListBox.Items.Add("A"); 227checkedListBox.Items.Add("A"); 244checkedListBox.Items.Add("A"); 263checkedListBox.Items.Add("A"); 277checkedListBox.Items.Add("A"); 294checkedListBox.Items.Add("A"); 310checkedListBox.Items.Add("A"); 321checkedListBox.Items.Add("A"); 348checkedListBox.Items.Add("Item 1", 355checkedListBox.Items.InnerArray.GetEntryObject(0, 0), 365checkedListBox.Items.Add("Item 1"); 370checkedListBox.Items.InnerArray.GetEntryObject(0, 0),
System\Windows\Forms\CheckedListBox.CheckedIndexCollectionTests.cs (3)
23_checkedListBox.Items.Clear(); 66_checkedListBox.Items.Add(items[i], checkedStates[i]); 89_checkedListBox.Items.Add(items[i], checkedStates[i]);
System\Windows\Forms\CheckedListBox.CheckedItemCollectionTests.cs (4)
23_checkedListBox.Items.Clear(); 53_checkedListBox.Items.Add("item1", true); 54_checkedListBox.Items.Add("item2", false); 64_checkedListBox.Items.Add(items[i], checkedStates[i]);
System\Windows\Forms\ControlTests.cs (1)
1045checkedListBox1.Items.AddRange((object[])["Foo", "Foo", "Foo"]);
TestPassApp (1)
CommonControl1.Designer.cs (1)
245this.checkedListBox1.Items.AddRange(new object[] {
WinFormsControlsTest (3)
MultipleControls.cs (1)
132checkedListBox1.Items.Add("Pennsylvania", CheckState.Checked);
MultipleControls.Designer.cs (2)
227this.checkedListBox1.Items.AddRange(new object[] { 283this.checkedListBox2.Items.AddRange(new object[] {