DomainUpDown.DomainUpDownItemCollection Class
TOC
Collapse the table of content
Expand the table of content

DomainUpDown::DomainUpDownItemCollection Class

 

Encapsulates a collection of objects for use by the DomainUpDown class.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

System::Object
  System.Collections::ArrayList
    System.Windows.Forms::DomainUpDown::DomainUpDownItemCollection

public ref class DomainUpDownItemCollection : ArrayList

NameDescription
System_CAPS_pubpropertyCapacity

Gets or sets the number of elements that the ArrayList can contain.(Inherited from ArrayList.)

System_CAPS_pubpropertyCount

Gets the number of elements actually contained in the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubpropertyIsFixedSize

Gets a value indicating whether the ArrayList has a fixed size.(Inherited from ArrayList.)

System_CAPS_pubpropertyIsReadOnly

Gets a value indicating whether the ArrayList is read-only.(Inherited from ArrayList.)

System_CAPS_pubpropertyIsSynchronized

Gets a value indicating whether access to the ArrayList is synchronized (thread safe).(Inherited from ArrayList.)

System_CAPS_pubpropertyItem[Int32]

Gets or sets the item at the specified indexed location in the collection.(Overrides ArrayList::Item[Int32].)

System_CAPS_pubpropertySyncRoot

Gets an object that can be used to synchronize access to the ArrayList.(Inherited from ArrayList.)

NameDescription
System_CAPS_pubmethodAdd(Object^)

Adds the specified object to the end of the collection.(Overrides ArrayList::Add(Object^).)

System_CAPS_pubmethodAddRange(ICollection^)

Adds the elements of an ICollection to the end of the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodBinarySearch(Int32, Int32, Object^, IComparer^)

Searches a range of elements in the sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.(Inherited from ArrayList.)

System_CAPS_pubmethodBinarySearch(Object^)

Searches the entire sorted ArrayList for an element using the default comparer and returns the zero-based index of the element.(Inherited from ArrayList.)

System_CAPS_pubmethodBinarySearch(Object^, IComparer^)

Searches the entire sorted ArrayList for an element using the specified comparer and returns the zero-based index of the element.(Inherited from ArrayList.)

System_CAPS_pubmethodClear()

Removes all elements from the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodClone()

Creates a shallow copy of the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodContains(Object^)

Determines whether an element is in the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodCopyTo(Array^)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the beginning of the target array.(Inherited from ArrayList.)

System_CAPS_pubmethodCopyTo(Array^, Int32)

Copies the entire ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from ArrayList.)

System_CAPS_pubmethodCopyTo(Int32, Array^, Int32, Int32)

Copies a range of elements from the ArrayList to a compatible one-dimensional Array, starting at the specified index of the target array.(Inherited from ArrayList.)

System_CAPS_pubmethodEquals(Object^)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetEnumerator()

Returns an enumerator for the entire ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodGetEnumerator(Int32, Int32)

Returns an enumerator for a range of elements in the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetRange(Int32, Int32)

Returns an ArrayList which represents a subset of the elements in the source ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_pubmethodIndexOf(Object^)

Searches for the specified Object and returns the zero-based index of the first occurrence within the entire ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodIndexOf(Object^, Int32)

Searches for the specified Object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that extends from the specified index to the last element.(Inherited from ArrayList.)

System_CAPS_pubmethodIndexOf(Object^, Int32, Int32)

Searches for the specified Object and returns the zero-based index of the first occurrence within the range of elements in the ArrayList that starts at the specified index and contains the specified number of elements.(Inherited from ArrayList.)

System_CAPS_pubmethodInsert(Int32, Object^)

Inserts the specified object into the collection at the specified location.(Overrides ArrayList::Insert(Int32, Object^).)

System_CAPS_pubmethodInsertRange(Int32, ICollection^)

Inserts the elements of a collection into the ArrayList at the specified index.(Inherited from ArrayList.)

System_CAPS_pubmethodLastIndexOf(Object^)

Searches for the specified Object and returns the zero-based index of the last occurrence within the entire ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodLastIndexOf(Object^, Int32)

Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that extends from the first element to the specified index.(Inherited from ArrayList.)

System_CAPS_pubmethodLastIndexOf(Object^, Int32, Int32)

Searches for the specified Object and returns the zero-based index of the last occurrence within the range of elements in the ArrayList that contains the specified number of elements and ends at the specified index.(Inherited from ArrayList.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodRemove(Object^)

Removes the specified item from the collection.(Overrides ArrayList::Remove(Object^).)

System_CAPS_pubmethodRemoveAt(Int32)

Removes the item from the specified location in the collection.(Overrides ArrayList::RemoveAt(Int32).)

System_CAPS_pubmethodRemoveRange(Int32, Int32)

Removes a range of elements from the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodReverse()

Reverses the order of the elements in the entire ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodReverse(Int32, Int32)

Reverses the order of the elements in the specified range.(Inherited from ArrayList.)

System_CAPS_pubmethodSetRange(Int32, ICollection^)

Copies the elements of a collection over a range of elements in the ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodSort()

Sorts the elements in the entire ArrayList.(Inherited from ArrayList.)

System_CAPS_pubmethodSort(IComparer^)

Sorts the elements in the entire ArrayList using the specified comparer.(Inherited from ArrayList.)

System_CAPS_pubmethodSort(Int32, Int32, IComparer^)

Sorts the elements in a range of elements in ArrayList using the specified comparer.(Inherited from ArrayList.)

System_CAPS_pubmethodToArray()

Copies the elements of the ArrayList to a new Object array.(Inherited from ArrayList.)

System_CAPS_pubmethodToArray(Type^)

Copies the elements of the ArrayList to a new array of the specified element type.(Inherited from ArrayList.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Inherited from Object.)

System_CAPS_pubmethodTrimToSize()

Sets the capacity to the actual number of elements in the ArrayList.(Inherited from ArrayList.)

NameDescription
System_CAPS_pubmethodAsParallel()

Overloaded. Enables parallelization of a query.(Defined by ParallelEnumerable.)

System_CAPS_pubmethodAsQueryable()

Overloaded. Converts an IEnumerable to an IQueryable.(Defined by Queryable.)

System_CAPS_pubmethodCast<TResult>()

Casts the elements of an IEnumerable to the specified type.(Defined by Enumerable.)

System_CAPS_pubmethodOfType<TResult>()

Filters the elements of an IEnumerable based on a specified type.(Defined by Enumerable.)

To create a collection of objects to display in the DomainUpDown control, you can add or remove the items individually by using the Add and Remove methods. The collection is accessed from the parent control, DomainUpDown, by the Items property.

The following example creates and initializes a DomainUpDown control. The example allows you to set some of its properties and create a collection of strings for display in the up-down control. The code assumes that a TextBox, CheckBox and a Button have been instantiated on a form. The example also assumes that you have a member variable at the class level declared as a 32-bit signed integer named myCounter. You can enter a string in the text box and add it to the Items collection when the button is clicked. By clicking the check box, you can toggle the Sorted property and observe the difference in the collection of items in the up-down control.

protected:
   DomainUpDown^ domainUpDown1;

private:
   void InitializeMyDomainUpDown()
   {
      // Create and initialize the DomainUpDown control.
      domainUpDown1 = gcnew DomainUpDown;

      // Add the DomainUpDown control to the form.
      Controls->Add( domainUpDown1 );
   }

   void button1_Click( Object^ sender,
      EventArgs^ e )
   {
      // Add the text box contents and initial location in the collection
      // to the DomainUpDown control.
      domainUpDown1->Items->Add( String::Concat(
         (textBox1->Text->Trim()), " - ", myCounter ) );

      // Increment the counter variable.
      myCounter = myCounter + 1;

      // Clear the TextBox.
      textBox1->Text = "";
   }

   void checkBox1_Click( Object^ sender,
      EventArgs^ e )
   {

      // If Sorted is set to true, set it to false; 
      // otherwise set it to true.
      domainUpDown1->Sorted =  !domainUpDown1->Sorted;
   }

   void domainUpDown1_SelectedItemChanged( Object^ sender,
      EventArgs^ e )
   {

      // Display the SelectedIndex and 
      // SelectedItem property values in a MessageBox.
      MessageBox::Show( String::Concat( "SelectedIndex: ", domainUpDown1->SelectedIndex,
         "\nSelectedItem: ", domainUpDown1->SelectedItem ) );
   }

.NET Framework
Available since 1.1

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Return to top
Show:
© 2016 Microsoft