Form. Control Collection Класс
Определение
Представляет коллекцию элементов управления в форме. Represents a collection of controls on the form.
Примеры
Следующий пример кода добавляет TextBox Label элемент управления и в коллекцию элементов управления формы. The following code example adds a TextBox and Label control to the control collection of a form. Для этого примера требуется, чтобы была создана и именована форма Form1 . The example requires that a form has been created and named Form1 .
Комментарии
Этот класс представляет коллекцию элементов управления, содержащихся в форме. This class represents the collection of controls contained within a form. С помощью метода можно Add Добавить в форму элемент управления и Remove метод для удаления элемента управления из формы. You can use the Add method to add a control to the form and the Remove method to remove the control from the form. Коллекцию элементов управления, представленную этим классом, нельзя создать, не привязывая ее к определенной форме. The control collection represented by this class cannot be created without binding it to a specific form. В результате нельзя создать несколько экземпляров этой коллекции элементов управления и заменять их активной формой для предоставления различных макетов элементов управления. As a result, you cannot create multiple instances of this control collection and interchange them with an active form to provide different control layouts.
Конструкторы
Инициализирует новый экземпляр класса Form.ControlCollection. Initializes a new instance of the Form.ControlCollection class.
Свойства
Возвращает количество элементов, содержащихся в коллекции. Gets the number of elements contained in the collection.
(Унаследовано от Control.ControlCollection)
Получает значение, указывающее, является ли этот объект коллекции доступным только для чтения. Gets a value that indicates whether this collection object is read-only.
(Унаследовано от Control.ControlCollection)
Указывает объект Control, находящийся в заданном индексом местоположении в коллекции. Indicates the Control at the specified indexed location in the collection.
(Унаследовано от Control.ControlCollection)
Указывает объект Control с заданным ключом в коллекции. Indicates a Control with the specified key in the collection.
(Унаследовано от Control.ControlCollection)
Получает элемент управления, владеющий данной коллекцией Control.ControlCollection. Gets the control that owns this Control.ControlCollection.
(Унаследовано от Control.ControlCollection)
Методы
Добавляет элемент управления в форму. Adds a control to the form.
Добавляет массив объектов управления в коллекцию. Adds an array of control objects to the collection.
(Унаследовано от Control.ControlCollection)
Удаляет все элементы управления из коллекции. Removes all controls from the collection.
(Унаследовано от Control.ControlCollection)
Определяет, является ли указанный элемент управления членом коллекции. Determines whether the specified control is a member of the collection.
(Унаследовано от Control.ControlCollection)
Определяет, содержится ли элемент с указанным ключом в коллекции Control.ControlCollection. Determines whether the Control.ControlCollection contains an item with the specified key.
(Унаследовано от Control.ControlCollection)
Копирует элементы из коллекции в массив, начиная с определенного индекса массива. Copies the elements of the collection to an array, starting at a particular array index.
(Унаследовано от Control.ControlCollection)
Указывает, равен ли текущий объект коллекции указанному объекту. Specifies whether the current collection object and the specified object are equal.
(Унаследовано от Control.ControlCollection)
Выполняет поиск элементов управления по их свойству Name и создает массив из всех элементов управления, которые соответствуют условиям поиска. Searches for controls by their Name property and builds an array of all the controls that match.
(Унаследовано от Control.ControlCollection)
Извлекает индекс указанного дочернего элемента управления в коллекции элементов управления. Retrieves the index of the specified child control within the control collection.
(Унаследовано от Control.ControlCollection)
Извлекает индекс указанного дочернего элемента управления в коллекции и при необходимости вызывает исключение, если указанный элемент управления не обнаружен в коллекции элементов управления. Retrieves the index of the specified child control within the control collection, and optionally raises an exception if the specified control is not within the control collection.
(Унаследовано от Control.ControlCollection)
Извлекает ссылку на объект перечислителя, который используется для итерации по коллекции Control.ControlCollection. Retrieves a reference to an enumerator object that is used to iterate over a Control.ControlCollection.
(Унаследовано от Control.ControlCollection)
Возвращает хэш-код данного экземпляра. Returns the hash code for this instance.
(Унаследовано от Control.ControlCollection)
Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.
(Унаследовано от Object)
Извлекает индекс указанного элемента управления в коллекции элементов управления. Retrieves the index of the specified control in the control collection.
(Унаследовано от Control.ControlCollection)
Извлекает индекс первого вхождения заданного элемента в коллекции. Retrieves the index of the first occurrence of the specified item within the collection.
(Унаследовано от Control.ControlCollection)
Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.
(Унаследовано от Object)
Удаляет элемент управления из формы. Removes a control from the form.
Удаляет элемент управления из коллекции по указанному расположению индекса. Removes a control from the control collection at the specified indexed location.
(Унаследовано от Control.ControlCollection)
Удаляет дочерний элемент управления с указанным ключом. Removes the child control with the specified key.
(Унаследовано от Control.ControlCollection)
Задает определенное значение индексу указанного дочернего элемента управления в коллекции. Sets the index of the specified child control in the collection to the specified index value.
(Унаследовано от Control.ControlCollection)
Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.
(Унаследовано от Object)
Явные реализации интерфейса
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе Clone(). For a description of this member, see Clone().
(Унаследовано от Control.ControlCollection)
Описание этого элемента см. в свойстве IsSynchronized. For a description of this member, see the IsSynchronized property.
(Унаследовано от ArrangedElementCollection)
Описание этого элемента см. в свойстве SyncRoot. For a description of this member, see the SyncRoot property.
(Унаследовано от ArrangedElementCollection)
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе Add(Object). For a description of this member, see Add(Object).
(Унаследовано от Control.ControlCollection)
Описание этого элемента содержится в методе Clear(). For a description of this member, see the Clear() method.
(Унаследовано от ArrangedElementCollection)
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе Contains(Object). For a description of this member, see Contains(Object).
(Унаследовано от Control.ControlCollection)
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе IndexOf(Object). For a description of this member, see IndexOf(Object).
(Унаследовано от Control.ControlCollection)
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе Insert(Int32, Object). For a description of this member, see Insert(Int32, Object).
(Унаследовано от Control.ControlCollection)
Описание этого элемента см. в свойстве IsFixedSize. For a description of this member, see the IsFixedSize property.
(Унаследовано от ArrangedElementCollection)
Описание этого элемента см. в свойстве Item[Int32]. For a description of this member, see the Item[Int32] property.
(Унаследовано от ArrangedElementCollection)
Этот API поддерживает инфраструктуру продукта и не предназначен для использования непосредственно из программного кода.
Описание этого члена см. в разделе Remove(Object). For a description of this member, see Remove(Object).
(Унаследовано от Control.ControlCollection)
Описание этого элемента содержится в методе RemoveAt(Int32). For a description of this member, see the RemoveAt(Int32) method.
(Унаследовано от ArrangedElementCollection)
Методы расширения
Приводит элементы объекта IEnumerable к заданному типу. Casts the elements of an IEnumerable to the specified type.
Выполняет фильтрацию элементов объекта IEnumerable по заданному типу. Filters the elements of an IEnumerable based on a specified type.
Позволяет осуществлять параллельный запрос. Enables parallelization of a query.
Преобразовывает коллекцию IEnumerable в объект IQueryable. Converts an IEnumerable to an IQueryable.