System. Windows. Forms. Design Namespace
Contains classes that support design-time configuration and behavior for Windows Forms components. These classes consist of designer classes that provide support for Windows Forms components, a set of design-time services; UITypeEditor classes for configuring certain types of properties, and classes for importing ActiveX controls.
Classes
Provides a user interface for configuring an Anchor property.
Imports ActiveX controls and generates a wrapper that can be accessed by a designer.
Represents a set of options for an AxImporter.
Represents a parameter of a method of a hosted ActiveX control.
Generates a wrapper for ActiveX controls for use in the design-time environment.
Provides an editor for setting the BorderSides property.
Base designer class for extending the design mode behavior of a root design document that supports nested components.
Provides a user interface for a WindowsFormsComponentEditor.
Provides a base implementation for a ComponentEditorPage.
Provides behavior for the component tray of a designer.
Extends the design mode behavior of a Control.
Provides access to get and set option values for a designer.
Provides a user interface for specifying a Dock property.
Base designer class for extending the design mode behavior of, and providing a root-level design mode view for, a Control that supports nested controls and should receive scroll messages.
Provides a systematic way to manage event handlers for the current document.
Provides a PropertyTab that can display events for selection and linking.
Provides a user interface for selecting a file name.
Provides a user interface for choosing a folder from the file system.
Represents a dialog box that allows the user to choose a folder. This class cannot be inherited.
Serializes string dictionaries.
Provides an editor that can perform default file searching for bitmap (.bmp) files.
Defines a set of members for derived classes to provide options for the masked text box UI type editor.
Defines a set of CommandID fields that each correspond to a command function provided by the host environment.
Extends the design mode behavior of a Control that supports nested controls.
Provides a base class for property tabs.
Base designer class for extending the design mode behavior of a Control which should receive scroll messages.
Provides an editor for picking shortcut keys.
Specifies which types a ToolStripItem can appear in. This class cannot be inherited.
Provides a base class for editors that use a modal dialog to display a properties page similar to an ActiveX control’s property page.
Provides access to get and set option values for a Windows Forms designer.
Structs
Represents a window and a value that indicates how its scrollbars should be themed when displayed in the Visual Studio designer.
Interfaces
Provides methods to resolve references to ActiveX libraries, COM type libraries or assemblies, or managed assemblies.
Defines a method for getting information about how the scrollbars of windows need to be themed when displayed in the Visual Studio designer.
Provides access to the menu editing service.
Enables interaction with the user interface of the development environment object that is hosting the designer.
Provides an interface for a UITypeEditor to display Windows Forms or to display a control in a drop-down area from a property grid control in design mode.
Enums
Designer action items that can be associated with a component.
Defines identifiers used to indicate the root folder for a folder browser to initially browse to.
Defines identifiers used to specify behavior of a FolderNameEditor.FolderBrowser.
Defines identifiers that are used to indicate selection rules for a component.
A value that indicates whether the scrollbars of a window and its children will be themed when displayed in the Visual Studio designer.
Specifies controls that are visible in the designer.
Control Designer Класс
Определение
Расширяет поведение элемента управления Control в режиме разработки. Extends the design mode behavior of a Control.
Примеры
В следующем примере ControlDesigner реализации демонстрируется обработка MouseEnter и MouseLeave события, рисование в элементе управления из кода конструктора и использование части IDesignerFilter интерфейса для добавления свойства элемента управления во время разработки. The following example ControlDesigner implementation demonstrates handling MouseEnter and MouseLeave events, drawing on a control from designer code, and using part of the IDesignerFilter interface to add a property for the control at design time. Следующий пример кода содержит конструктор и образец пользовательского элемента управления, связанного с конструктором. The following sample code contains a designer and a sample user control associated with the designer. Чтобы создать этот пример, скомпилируйте пример в библиотеку классов, добавьте ссылку на библиотеку в Windows Forms проект, добавьте элемент управления на панель элементов и добавьте в форму экземпляр элемента управления. To build this sample, compile the sample into a class library, add a reference to the library to a Windows Forms project, add the control to the Toolbox, and add an instance of the control to your form. При наведении указателя мыши на элемент управления выделяется внутренняя структура периметра элемента управления, а цвет, используемый для рисования контура, соответствует OutlineColor свойству, которое конструктор добавил к свойствам, перечисленным для элемента управления. When you point to the control, the inner outline of the perimeter of the control is highlighted, and the color used to draw the outline corresponds to the OutlineColor property that the designer has added to the properties listed for the control.
Добавьте ссылку на сборку System.Design, чтобы скомпилировать пример кода. Add a reference to the System.Design assembly to compile the code example.
Комментарии
ControlDesigner предоставляет базовый класс для конструкторов компонентов, производных от Control . ControlDesigner provides a base class for designers of components that derive from Control. В дополнение к методам и функциональным возможностям, унаследованным от ComponentDesigner класса, ControlDesigner предоставляет дополнительные методы для поддержки расширения и изменения поведения, связанного Control во время разработки. In addition to the methods and functionality inherited from the ComponentDesigner class, ControlDesigner provides additional methods to support extending and altering the behavior of an associated Control at design time.
Конструктор можно связать с типом с помощью DesignerAttribute . You can associate a designer with a type using a DesignerAttribute. Общие сведения о настройке поведения во время разработки см. в разделе расширение поддержки Design-Time. For an overview of customizing design time behavior, see Extending Design-Time Support.
Конструкторы
Инициализирует новый экземпляр класса ControlDesigner. Initializes a new instance of the ControlDesigner class.
Задает доступный объект для конструктора. Specifies the accessibility object for the designer.
Определяет локальную точку Point, представляющую значения недопустимой точки Point. Defines a local Point that represents the values of an invalid Point.
Свойства
Получает объект AccessibleObject, назначенный элементу управления. Gets the AccessibleObject assigned to the control.
Возвращает списки действий времени разработки, поддерживаемые компонентом, сопоставленным конструктору. Gets the design-time action lists supported by the component associated with the designer.
(Унаследовано от ComponentDesigner)
Получает коллекцию компонентов, сопоставленных компоненту, который управляется конструктором. Gets the collection of components associated with the component managed by the designer.
Получает или задает значение, указывающее, зависит ли распределение дескрипторов изменения размера от значения свойства AutoSize. Gets or sets a value indicating whether resize handle allocation depends on the value of the AutoSize property.
Получает BehaviorService из среды разработки. Gets the BehaviorService from the design environment.
Возвращает основной компонент, создаваемый данным конструктором. Gets the component this designer is designing.
(Унаследовано от ComponentDesigner)
Получает элемент управления, создаваемый данным конструктором. Gets the control that the designer is designing.
Получает значение, указывающее, могут ли быть нарисованы перетаскиваемые прямоугольники на данном компоненте конструктора. Gets a value indicating whether drag rectangles can be drawn on this designer component.
Получает InheritanceAttribute конструктора. Gets the InheritanceAttribute of the designer.
Возвращает атрибут, обозначающий тип наследования связанного компонента. Gets an attribute that indicates the type of inheritance of the associated component.
(Унаследовано от ComponentDesigner)
Возвращает значение, определяющее, наследуется ли этот компонент или нет. Gets a value indicating whether this component is inherited.
(Унаследовано от ComponentDesigner)
Получает родительский компонент для ControlDesigner. Gets the parent component for the ControlDesigner.
Возвращает родительский компонент этого конструктора. Gets the parent component for this designer.
(Унаследовано от ComponentDesigner)
Получает значение, указывающее, разрешит ли ControlDesigner выравнивание по линии привязки во время операции перетаскивания. Gets a value indicating whether the ControlDesigner will allow snapline alignment during a drag operation.
Получает правила выбора, указывающие на возможность перемещения компонентов. Gets the selection rules that indicate the movement capabilities of a component.
Возвращает коллекцию значений свойств, переопределяющих параметры пользователя. Gets a collection of property values that override user settings.
(Унаследовано от ComponentDesigner)
Получает список объектов SnapLine, представляющих важные точки выравнивания для этого элемента управления. Gets a list of SnapLine objects representing significant alignment points for this control.
Возвращает команды в режиме конструктора, поддерживаемые компонентом, связанным с конструктором. Gets the design-time verbs supported by the component that is associated with the designer.
(Унаследовано от ComponentDesigner)
Методы
Обрабатывает сообщения Windows. Processes Windows messages.
Указывает, может ли этот элемент управления конструктора быть порожденным элементом управления заданного конструктора. Indicates if this designer’s control can be parented by the control of the specified designer.
Предоставляет стандартную обработку сообщений Windows. Provides default processing for Windows messages.
Отображает для пользователя информацию об указанном исключении. Displays information about the specified exception to the user.
Освобождает все ресурсы, занятые модулем ComponentDesigner. Releases all resources used by the ComponentDesigner.
(Унаследовано от ComponentDesigner)
Освобождает неуправляемые ресурсы, используемые объектом ControlDesigner, а при необходимости освобождает также управляемые ресурсы. Releases the unmanaged resources used by the ControlDesigner and optionally releases the managed resources.
Создает в файле с исходным кодом подпись метода для события по умолчанию для компонента и устанавливает курсор в позицию, где была создана эта подпись. Creates a method signature in the source code file for the default event on the component and navigates the user’s cursor to that location.
(Унаследовано от ComponentDesigner)
Разрешает функцию разработки для дочернего элемента управления. Enables design time functionality for a child control.
Разрешает или запрещает поддержку операций перетаскивания для проектируемого элемента управления. Enables or disables drag-and-drop support for the control being designed.
Определяет, равен ли указанный объект текущему объекту. Determines whether the specified object is equal to the current object.
(Унаследовано от Object)
Возвращает ControlBodyGlyph, представляющий границы данного элемента управления. Returns a ControlBodyGlyph representing the bounds of this control.
Получает коллекцию объектов Glyph, представляющих границы выделения и токены захвата для стандартного элемента управления. Gets a collection of Glyph objects representing the selection borders and grab handles for a standard control.
Служит хэш-функцией по умолчанию. Serves as the default hash function.
(Унаследовано от Object)
Указывает, должно ли нажатие клавиши мыши в определенной точке обрабатываться элементом управления. Indicates whether a mouse click at the specified point should be handled by the control.
Пытается извлечь службу заданного типа с узла режима разработки компонента конструктора. Attempts to retrieve the specified type of service from the design mode site of the designer’s component.
(Унаследовано от ComponentDesigner)
Возвращает объект Type для текущего экземпляра. Gets the Type of the current instance.
(Унаследовано от Object)
Рассылает сообщения от дочерних элементов управления заданного элемента управления в конструктор. Routes messages from the child controls of the specified control to the designer.
Инициализирует конструктор, используя заданный компонент. Initializes the designer with the specified component.
Повторно инициализирует существующий компонент. Re-initializes an existing component.
Выполняет повторную инициализацию существующего компонента. Reinitializes an existing component.
(Унаследовано от ComponentDesigner)
Инициализирует только что созданный компонент. Initializes a newly created component.
Инициализирует только что созданный компонент. Initializes a newly created component.
(Унаследовано от ComponentDesigner)
Инициализирует свойства элемента управления с любыми значениями, не являющимися значениями по умолчанию. Initializes properties of the control to any non-default values.
Инициализирует параметры импортированного компонента, параметры которого уже были инициализированы с использованием параметров, отличных от заданных по умолчанию. Initializes the settings for an imported component that is already initialized to settings other than the defaults.
(Унаследовано от ComponentDesigner)
Возвращает конструктор внутреннего элемента управления с заданным индексом в ControlDesigner. Returns the internal control designer with the specified index in the ControlDesigner.
(Унаследовано от ComponentDesigner)
Создает неполную копию текущего объекта Object. Creates a shallow copy of the current Object.
(Унаследовано от Object)
Возвращает число конструкторов внутреннего элемента управления в ControlDesigner. Returns the number of internal control designers in the ControlDesigner.
Показывает контекстное меню и предоставляет возможность осуществить дополнительную обработку, когда контекстное меню отображается. Shows the context menu and provides an opportunity to perform additional processing when the context menu is about to be displayed.
Предоставляет возможность осуществления дополнительной обработки немедленно после создания дескриптора элемента управления. Provides an opportunity to perform additional processing immediately after the control handle has been created.
Получает вызов для очистки операции перетаскивания. Receives a call to clean up a drag-and-drop operation.
Получает вызов, когда перетаскиваемый объект перемещается на представление конструктора элемента управления. Receives a call when a drag-and-drop object is dropped onto the control designer view.
Получает вызов, когда операция перетаскивания входит на представление конструктора элемента управления. Receives a call when a drag-and-drop operation enters the control designer view.
Получает вызов, когда операция перетаскивания выходит за пределы представления конструктора элемента управления. Receives a call when a drag-and-drop operation leaves the control designer view.
Получает вызов, когда перетаскиваемый объект перемещается по представлению конструктора элемента управления. Receives a call when a drag-and-drop object is dragged over the control designer view.
Получает вызов во время выполнения операции перетаскивания для обеспечения визуального слежения за положением мыши при операции перетаскивания. Receives a call when a drag-and-drop operation is in progress to provide visual cues based on the location of the mouse while a drag operation is in progress.
Получает вызов в ответ на нажатие и удерживание левой кнопки мыши над компонентом. Receives a call in response to the left mouse button being pressed and held while over the component.
Вызывается в конце операции перетаскивания для завершения или отмены операции. Receives a call at the end of a drag-and-drop operation to complete or cancel the operation.
Получает вызов для каждого движения мыши во время операции перетаскивания. Receives a call for each movement of the mouse during a drag-and-drop operation.
Получает вызов, когда указатель мыши в первый раз оказывается на элементе управления. Receives a call when the mouse first enters the control.
Получает вызов после наведения указателя мыши на элемент управления. Receives a call after the mouse hovers over the control.
Получает вызов, когда указатель мыши в первый раз оказывается на элементе управления. Receives a call when the mouse first enters the control.
Получает вызов, когда элемент управления, управляемый конструктором, украсил свою поверхность, так что конструктор имеет возможность дополнительного украшения верхней части элемента управления. Receives a call when the control that the designer is managing has painted its surface so the designer can paint any additional adornments on top of the control.
Вызывается при инициализации конструктора. Called when the designer is initialized.
Получает вызов каждый раз, когда необходимо установить курсор. Receives a call each time the cursor needs to be set.
Позволяет конструктору изменять или удалять элементы из набора атрибутов, предоставленных через класс TypeDescriptor. Allows a designer to change or remove items from the set of attributes that it exposes through a TypeDescriptor.
(Унаследовано от ComponentDesigner)
Позволяет конструктору изменять или удалять элементы из набора событий, предоставленных через класс TypeDescriptor. Allows a designer to change or remove items from the set of events that it exposes through a TypeDescriptor.
(Унаследовано от ComponentDesigner)
Позволяет конструктору изменять или удалять элементы из набора свойств, предоставленных с использованием класса TypeDescriptor. Allows a designer to change or remove items from the set of properties that it exposes through a TypeDescriptor.
(Унаследовано от ComponentDesigner)
Позволяет конструктору добавлять элементы к набору атрибутов, предоставленному с использованием класса TypeDescriptor. Allows a designer to add to the set of attributes that it exposes through a TypeDescriptor.
(Унаследовано от ComponentDesigner)
Позволяет конструктору добавлять элементы к набору событий, предоставленных с использованием класса TypeDescriptor. Allows a designer to add to the set of events that it exposes through a TypeDescriptor.
(Унаследовано от ComponentDesigner)
Настраивает набор свойств, предоставляемых компонентом через TypeDescriptor. Adjusts the set of properties the component exposes through a TypeDescriptor.
Уведомляет службу IComponentChangeService о том, что данный компонент был изменен. Notifies the IComponentChangeService that this component has been changed.
(Унаследовано от ComponentDesigner)
Уведомляет службу IComponentChangeService о том, что компонент будет изменен. Notifies the IComponentChangeService that this component is about to be changed.
(Унаследовано от ComponentDesigner)
Возвращает строку, представляющую текущий объект. Returns a string that represents the current object.
(Унаследовано от Object)
Рассылает сообщения для дочерних элементов заданного элемента управления к каждому элементу управления, а не к родительскому конструктору. Routes messages for the children of the specified control to each control rather than to a parent designer.
Обрабатывает сообщения Windows и дополнительно пересылает их в элемент управления. Processes Windows messages and optionally routes them to the control.
Явные реализации интерфейса
Описание этого элемента содержится в методе PostFilterAttributes(IDictionary). For a description of this member, see the PostFilterAttributes(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента содержится в методе PostFilterEvents(IDictionary). For a description of this member, see the PostFilterEvents(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента содержится в методе PostFilterProperties(IDictionary). For a description of this member, see the PostFilterProperties(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента содержится в методе PreFilterAttributes(IDictionary). For a description of this member, see the PreFilterAttributes(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента содержится в методе PreFilterEvents(IDictionary). For a description of this member, see the PreFilterEvents(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента содержится в методе PreFilterProperties(IDictionary). For a description of this member, see the PreFilterProperties(IDictionary) method.
(Унаследовано от ComponentDesigner)
Описание этого элемента см. в свойстве Children. For a description of this member, see the Children property.
(Унаследовано от ComponentDesigner)
Описание этого элемента см. в свойстве Parent. For a description of this member, see the Parent property.