System windows forms currencymanager

Currency Manager Класс

Определение

Управляет списком объектов Binding. Manages a list of Binding objects.

Примеры

В следующем примере кода элемент управления привязывается TextBox к столбцу в DataTable , получает CurrencyManager для привязки и задает его расположение. The following code example binds a TextBox control to a column in a DataTable, gets the CurrencyManager for the binding, and sets its position.

Комментарии

Объект CurrencyManager является производным от BindingManagerBase класса. The CurrencyManager derives from the BindingManagerBase class. Используйте BindingContext для возврата либо CurrencyManager PropertyManager . Use the BindingContext to return either a CurrencyManager or a PropertyManager. Фактический возвращаемый объект зависит от источника данных и члена данных, переданного Item[] свойству объекта BindingContext . The actual object returned depends on the data source and data member passed to the Item[] property of the BindingContext. Если источник данных является объектом, который может возвращать только одно свойство (а не список объектов), типом будет PropertyManager . If the data source is an object that can return only a single property (instead of a list of objects), the type will be a PropertyManager. Например, если указать в TextBox качестве источника данных, PropertyManager будет возвращен. For example, if you specify a TextBox as the data source, a PropertyManager will be returned. Если, с другой стороны, источником данных является объект, реализующий IList IListSource интерфейс, или IBindingList , CurrencyManager будет возвращен. If, on the other hand, the data source is an object that implements the IList, IListSource, or IBindingList interface, a CurrencyManager will be returned.

CurrentСвойство возвращает текущий элемент в базовом списке. The Current property returns the current item in the underlying list. Чтобы изменить текущий элемент, присвойте Position свойству новое значение. To change the current item, set the Position property to a new value. Значение должно быть больше 0 и должно быть меньше значения Count Свойства. The value must be greater than 0 and must be less than the value of the Count property.

Если базовый источник данных реализует IBindingList интерфейс, а AllowNew свойство имеет значение true , можно использовать AddNew метод. If the underlying data source implements the IBindingList interface, and the AllowNew property is set to true , you can use the AddNew method.

Задает тип данных списка. Specifies the data type of the list.

Задает текущую позицию объекта CurrencyManager в списке. Specifies the current position of the CurrencyManager in the list.

Задает обработчик для события CurrentChanged. Specifies the event handler for the CurrentChanged event.

(Унаследовано от BindingManagerBase) onPositionChangedHandler

Задает обработчик для события PositionChanged. Specifies the event handler for the PositionChanged event.

(Унаследовано от BindingManagerBase)

Свойства

Возвращает коллекцию управляемых привязок. Gets the collection of bindings being managed.

(Унаследовано от BindingManagerBase) Count

Возвращает число элементов в списке. Gets the number of items in the list.

Возвращает текущий элемент в списке. Gets the current item in the list.

Возвращает значение, указывающее, приостановлено ли действие привязки. Gets a value indicating whether binding is suspended.

(Унаследовано от BindingManagerBase) List

Получает список для данного объекта CurrencyManager. Gets the list for this CurrencyManager.

Читайте также:  Сбита кодировка windows 10

Возвращает или задает текущую позицию в списке. Gets or sets the position you are at within the list.

Методы

Добавляет новый элемент в базовый список. Adds a new item to the underlying list.

Отменяет текущую операцию редактирования. Cancels the current edit operation.

Создает исключение, если список отсутствует или пуст. Throws an exception if there is no list, or the list is empty.

Завершает текущую операцию редактирования. Ends the current edit operation.

Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.

(Унаследовано от Object) GetHashCode()

Служит хэш-функцией по умолчанию. Serves as the default hash function.

(Унаследовано от Object) GetItemProperties()

Возвращает коллекцию дескрипторов свойств для базового списка. Gets the property descriptor collection for the underlying list.

Получает коллекцию дескрипторов свойств для привязки с помощью указанного списка ArrayList. Gets the collection of property descriptors for the binding using the specified ArrayList.

(Унаследовано от BindingManagerBase) GetItemProperties(Type, Int32, ArrayList, ArrayList)

Получает список свойств элементов, управляемых этим объектом BindingManagerBase. Gets the list of properties of the items managed by this BindingManagerBase.

(Унаследовано от BindingManagerBase) GetListName(ArrayList)

Возвращает имя списка, предоставляющего данные для привязки, с использованием заданного набора связанных свойств. Gets the name of the list supplying the data for the binding using the specified set of bound properties.

Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.

(Унаследовано от Object) MemberwiseClone()

Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.

(Унаследовано от Object) OnBindingComplete(BindingCompleteEventArgs)

Вызывает событие BindingComplete. Raises the BindingComplete event.

(Унаследовано от BindingManagerBase) OnCurrentChanged(EventArgs)

Вызывает событие CurrentChanged. Raises the CurrentChanged event.

(Унаследовано от BindingManagerBase) OnDataError(Exception)

Вызывает событие DataError. Raises the DataError event.

(Унаследовано от BindingManagerBase) OnItemChanged(ItemChangedEventArgs)

Вызывает событие ItemChanged. Raises the ItemChanged event.

Вызывает событие MetaDataChanged. Raises the MetaDataChanged event.

Вызывает событие PositionChanged. Raises the PositionChanged event.

Передает данные из привязанного к данным элемента управления в источник данных, не возвращая никаких сведений. Pulls data from the data-bound control into the data source, returning no information.

(Унаследовано от BindingManagerBase) PushData()

Принудительно передает данные из источника данных в привязанный к данным элемент управления, не возвращая никаких сведений. Pushes data from the data source into the data-bound control, returning no information.

(Унаследовано от BindingManagerBase) Refresh()

Вызывает принудительное повторное заполнение списка с привязкой к данным. Forces a repopulation of the data-bound list.

Удаляет элемент по указанному индексу. Removes the item at the specified index.

Возобновляет привязку данных. Resumes data binding.

Приостанавливает действие привязки данных, чтобы предотвратить обновление привязанного источника данных в результате изменений. Suspends data binding to prevents changes from updating the bound data source.

Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.

(Унаследовано от Object) UpdateIsBinding()

Обновляет состояние привязки. Updates the status of the binding.

События

Происходит во время завершения операции по привязке данных. Occurs at the completion of a data-binding operation.

Читайте также:  Script javascript windows open

(Унаследовано от BindingManagerBase) CurrentChanged

Происходит при изменении элемента, к которому имеется привязка. Occurs when the currently bound item changes.

(Унаследовано от BindingManagerBase) CurrentItemChanged

Происходит при изменении состояния элемента, к которому имеется привязка. Occurs when the state of the currently bound item changes.

(Унаследовано от BindingManagerBase) DataError

Происходит, когда исключение Exception автоматически обрабатывается объектом BindingManagerBase. Occurs when an Exception is silently handled by the BindingManagerBase.

(Унаследовано от BindingManagerBase) ItemChanged

Происходит при изменении текущего элемента. Occurs when the current item has been altered.

Происходит при изменении в списке или в элементе списка. Occurs when the list changes or an item in the list changes.

Происходит при изменении метаданных объекта List. Occurs when the metadata of the List has changed.

Происходит после изменения значения свойства Position. Occurs after the value of the Position property has changed.

Currency Manager Class

Definition

Manages a list of Binding objects.

Examples

The following code example binds a TextBox control to a column in a DataTable, gets the CurrencyManager for the binding, and sets its position.

Remarks

The CurrencyManager derives from the BindingManagerBase class. Use the BindingContext to return either a CurrencyManager or a PropertyManager. The actual object returned depends on the data source and data member passed to the Item[] property of the BindingContext. If the data source is an object that can return only a single property (instead of a list of objects), the type will be a PropertyManager. For example, if you specify a TextBox as the data source, a PropertyManager will be returned. If, on the other hand, the data source is an object that implements the IList, IListSource, or IBindingList interface, a CurrencyManager will be returned.

The Current property returns the current item in the underlying list. To change the current item, set the Position property to a new value. The value must be greater than 0 and must be less than the value of the Count property.

If the underlying data source implements the IBindingList interface, and the AllowNew property is set to true , you can use the AddNew method.

Fields

Specifies the data type of the list.

Specifies the current position of the CurrencyManager in the list.

Specifies the event handler for the CurrentChanged event.

(Inherited from BindingManagerBase) onPositionChangedHandler

Specifies the event handler for the PositionChanged event.

(Inherited from BindingManagerBase)

Properties

Gets the collection of bindings being managed.

(Inherited from BindingManagerBase) Count

Gets the number of items in the list.

Gets the current item in the list.

Gets a value indicating whether binding is suspended.

(Inherited from BindingManagerBase) List

Gets the list for this CurrencyManager.

Gets or sets the position you are at within the list.

Methods

Adds a new item to the underlying list.

Cancels the current edit operation.

Throws an exception if there is no list, or the list is empty.

Ends the current edit operation.

Determines whether the specified object is equal to the current object.

(Inherited from Object) GetHashCode()

Serves as the default hash function.

(Inherited from Object)

Читайте также:  Установить утм windows 10
GetItemProperties()

Gets the property descriptor collection for the underlying list.

Gets the collection of property descriptors for the binding using the specified ArrayList.

(Inherited from BindingManagerBase) GetItemProperties(Type, Int32, ArrayList, ArrayList)

Gets the list of properties of the items managed by this BindingManagerBase.

(Inherited from BindingManagerBase) GetListName(ArrayList)

Gets the name of the list supplying the data for the binding using the specified set of bound properties.

Gets the Type of the current instance.

(Inherited from Object) MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object) OnBindingComplete(BindingCompleteEventArgs)

(Inherited from BindingManagerBase) OnCurrentChanged(EventArgs)

(Inherited from BindingManagerBase) OnDataError(Exception)

Raises the DataError event.

(Inherited from BindingManagerBase) OnItemChanged(ItemChangedEventArgs)

Raises the ItemChanged event.

Pulls data from the data-bound control into the data source, returning no information.

(Inherited from BindingManagerBase) PushData()

Pushes data from the data source into the data-bound control, returning no information.

(Inherited from BindingManagerBase) Refresh()

Forces a repopulation of the data-bound list.

Removes the item at the specified index.

Resumes data binding.

Suspends data binding to prevents changes from updating the bound data source.

Returns a string that represents the current object.

(Inherited from Object) UpdateIsBinding()

Updates the status of the binding.

Events

Occurs at the completion of a data-binding operation.

(Inherited from BindingManagerBase) CurrentChanged

Occurs when the currently bound item changes.

(Inherited from BindingManagerBase) CurrentItemChanged

Occurs when the state of the currently bound item changes.

(Inherited from BindingManagerBase) DataError

Occurs when an Exception is silently handled by the BindingManagerBase.

(Inherited from BindingManagerBase) ItemChanged

Occurs when the current item has been altered.

Occurs when the list changes or an item in the list changes.

Occurs when the metadata of the List has changed.

Occurs after the value of the Position property has changed.

Control. Height Свойство

Определение

Возвращает или задает высоту элемента управления. Gets or sets the height of the control.

Значение свойства

Высота элемента управления в пикселях. The height of the control in pixels.

Примеры

Следующий пример кода создает три Button элемента управления в форме и задает их размер и расположение с помощью различных свойств, связанных с размером и расположением. The following code example creates three Button controls on a form and sets their size and location by using the various size-related and location-related properties. В этом примере предполагается, что у вас есть Form Ширина и высота не менее 300 пикселей. This example requires that you have a Form that has a width and height of at least 300 pixels.

Комментарии

Изменения, вносимые в Height Top значения свойств и, приводят к Bottom изменению значения свойства элемента управления. Changes made to the Height and Top property values cause the Bottom property value of the control to change.

Минимальная высота производного элемента управления Splitter — один пиксель. The minimum height for the derived control Splitter is one pixel. Высота элемента управления по умолчанию Splitter составляет три пикселя. The default height for the Splitter control is three pixels. Если задать Splitter для высоты элемента управления значение меньше единицы, значение свойства будет равно высоте по умолчанию. Setting the height of the Splitter control to a value less than one will reset the property value to the default height.

Оцените статью