You are on page 1of 515

Contents

System.Windows.Forms.Design
AnchorEditor
AnchorEditor
EditValue
GetEditStyle
AxImporter
AxImporter
GeneratedAssemblies
GeneratedSources
GeneratedTypeLibAttributes
GenerateFromFile
GenerateFromTypeLibrary
GetFileOfTypeLib
AxImporter.IReferenceResolver
ResolveActiveXReference
ResolveComReference
ResolveManagedReference
AxImporter.Options
AxImporter.Options
delaySign
genSources
ignoreRegisteredOcx
keyContainer
keyFile
keyPair
msBuildErrors
noLogo
outputDirectory
outputName
overwriteRCW
publicKey
references
silentMode
verboseMode
AxParameterData
AxParameterData
Convert
Direction
IsByRef
IsIn
IsOptional
IsOut
Name
ParameterType
TypeName
AxWrapperGen
AxWrapperGen
GeneratedSources
BorderSidesEditor
BorderSidesEditor
EditValue
GetEditStyle
ComponentDocumentDesigner
ComponentDocumentDesigner
Control
Dispose
GetToolSupported
Initialize
IRootDesigner.GetView
IRootDesigner.SupportedTechnologies
IToolboxUser.GetToolSupported
IToolboxUser.ToolPicked
ITypeDescriptorFilterService.FilterAttributes
ITypeDescriptorFilterService.FilterEvents
ITypeDescriptorFilterService.FilterProperties
PreFilterProperties
TrayAutoArrange
TrayLargeIcon
ComponentEditorForm
AutoSize
AutoSizeChanged
ComponentEditorForm
OnActivated
OnHelpRequested
OnSelChangeSelector
PreProcessMessage
ShowForm
ComponentEditorPage
Activate
ApplyChanges
AutoSize
AutoSizeChanged
CommitOnDeactivate
Component
ComponentEditorPage
CreateParams
Deactivate
EnterLoadingMode
ExitLoadingMode
FirstActivate
GetControl
GetSelectedComponent
Icon
IsFirstActivate
IsLoading
IsPageMessage
LoadComponent
Loading
LoadRequired
OnApplyComplete
PageSite
ReloadComponent
SaveComponent
SetComponent
SetDirty
SetSite
ShowHelp
SupportsHelp
Title
ComponentTray
AddComponent
AutoArrange
CanCreateComponentFromTool
CanDisplayComponent
ComponentCount
ComponentTray
CreateComponentFromTool
DisplayError
Dispose
GetLocation
GetNextComponent
GetService
GetTrayLocation
IExtenderProvider.CanExtend
IsTrayComponent
OnDoubleClick
OnDragDrop
OnDragEnter
OnDragLeave
OnDragOver
OnGiveFeedback
OnLayout
OnLostCapture
OnMouseDoubleClick
OnMouseDown
OnMouseMove
OnMouseUp
OnPaint
OnSetCursor
RemoveComponent
SetLocation
SetTrayLocation
ShowLargeIcons
WndProc
ControlDesigner
accessibilityObj
AccessibilityObject
AssociatedComponents
AutoResizeHandles
BaseWndProc
BehaviorService
CanBeParentedTo
Control
ControlDesigner
DefWndProc
DisplayError
Dispose
EnableDesignMode
EnableDragDrop
EnableDragRect
GetControlGlyph
GetGlyphs
GetHitTest
HookChildControls
InheritanceAttribute
Initialize
InitializeExistingComponent
InitializeNewComponent
InitializeNonDefault
InternalControlDesigner
InvalidPoint
NumberOfInternalControlDesigners
OnContextMenu
OnCreateHandle
OnDragComplete
OnDragDrop
OnDragEnter
OnDragLeave
OnDragOver
OnGiveFeedback
OnMouseDragBegin
OnMouseDragEnd
OnMouseDragMove
OnMouseEnter
OnMouseHover
OnMouseLeave
OnPaintAdornments
OnSetComponentDefaults
OnSetCursor
ParentComponent
ParticipatesWithSnapLines
PreFilterProperties
SelectionRules
SnapLines
UnhookChildControls
WndProc
ControlDesigner.ControlDesignerAccessibleObject
Bounds
ControlDesigner.ControlDesignerAccessibleObject
DefaultAction
Description
GetChild
GetChildCount
GetFocused
GetSelected
HitTest
Name
Parent
Role
State
Value
DesignerOptions
DesignerOptions
EnableInSituEditing
GridSize
ObjectBoundSmartTagAutoShow
ShowGrid
SnapToGrid
UseOptimizedCodeGeneration
UseSmartTags
UseSnapLines
DockEditor
DockEditor
EditValue
GetEditStyle
DocumentDesigner
Dispose
DocumentDesigner
EnsureMenuEditorService
GetGlyphs
GetToolSupported
Initialize
IRootDesigner.GetView
IRootDesigner.SupportedTechnologies
IToolboxUser.GetToolSupported
IToolboxUser.ToolPicked
menuEditorService
OnContextMenu
OnCreateHandle
PreFilterProperties
SelectionRules
ToolPicked
WndProc
EventHandlerService
EventHandlerChanged
EventHandlerService
FocusWindow
GetHandler
PopHandler
PushHandler
EventsTab
CanExtend
EventsTab
GetDefaultProperty
GetProperties
HelpKeyword
TabName
FileNameEditor
EditValue
FileNameEditor
GetEditStyle
InitializeDialog
FolderNameEditor
EditValue
FolderNameEditor
GetEditStyle
InitializeDialog
FolderNameEditor.FolderBrowser
Description
DirectoryPath
FolderNameEditor.FolderBrowser
ShowDialog
StartLocation
Style
FolderNameEditor.FolderBrowserFolder
FolderNameEditor.FolderBrowserStyles
IContainsThemedScrollbarWindows
ThemedScrollbarWindows
ImageListCodeDomSerializer
Deserialize
ImageListCodeDomSerializer
Serialize
ImageListImageEditor
EditValue
GetFileDialogDescription
GetImageExtenders
GetPaintValueSupported
ImageListImageEditor
PaintValue
IMenuEditorService
GetMenu
IsActive
MessageFilter
SetMenu
SetSelection
IUIService
CanShowComponentEditor
GetDialogOwnerWindow
SetUIDirty
ShowComponentEditor
ShowDialog
ShowError
ShowMessage
ShowToolWindow
Styles
IWindowsFormsEditorService
CloseDropDown
DropDownControl
ShowDialog
MaskDescriptor
Culture
Equals
GetHashCode
IsValidMaskDescriptor
Mask
MaskDescriptor
Name
Sample
ToString
ValidatingType
MenuCommands
ComponentTrayMenu
ContainerMenu
DesignerProperties
EditLabel
KeyCancel
KeyDefaultAction
KeyEnd
KeyHome
KeyInvokeSmartTag
KeyMoveDown
KeyMoveLeft
KeyMoveRight
KeyMoveUp
KeyNudgeDown
KeyNudgeHeightDecrease
KeyNudgeHeightIncrease
KeyNudgeLeft
KeyNudgeRight
KeyNudgeUp
KeyNudgeWidthDecrease
KeyNudgeWidthIncrease
KeyReverseCancel
KeySelectNext
KeySelectPrevious
KeyShiftEnd
KeyShiftHome
KeySizeHeightDecrease
KeySizeHeightIncrease
KeySizeWidthDecrease
KeySizeWidthIncrease
KeyTabOrderSelect
MenuCommands
SelectionMenu
SetStatusRectangle
SetStatusText
TraySelectionMenu
ParentControlDesigner
AddPaddingSnapLines
AllowControlLasso
AllowGenericDragBox
AllowSetChildIndexOnDrop
CanAddComponent
CanParent
CreateTool
CreateToolCore
DefaultControlLocation
Dispose
DrawGrid
EnableDragRect
GetControl
GetControlGlyph
GetGlyphs
GetParentForComponent
GetUpdatedRect
GridSize
Initialize
InitializeNewComponent
InvokeCreateTool
MouseDragTool
OnDragComplete
OnDragDrop
OnDragEnter
OnDragLeave
OnDragOver
OnGiveFeedback
OnMouseDragBegin
OnMouseDragEnd
OnMouseDragMove
OnMouseEnter
OnMouseHover
OnMouseLeave
OnPaintAdornments
OnSetCursor
ParentControlDesigner
PreFilterProperties
SnapLines
WndProc
PropertyTab
Bitmap
CanExtend
Components
Dispose
Finalize
GetDefaultProperty
GetProperties
HelpKeyword
PropertyTab
TabName
ScrollableControlDesigner
GetHitTest
ScrollableControlDesigner
WndProc
SelectionRules
ShortcutKeysEditor
EditValue
GetEditStyle
ShortcutKeysEditor
ThemedScrollbarMode
ThemedScrollbarWindow
Handle
Mode
ToolStripItemDesignerAvailability
ToolStripItemDesignerAvailabilityAttribute
Default
Equals
GetHashCode
IsDefaultAttribute
ItemAdditionVisibility
ToolStripItemDesignerAvailabilityAttribute
WindowsFormsComponentEditor
EditComponent
GetComponentEditorPages
GetInitialComponentEditorPageIndex
WindowsFormsComponentEditor
WindowsFormsDesignerOptionService
CompatibilityOptions
PopulateOptionCollection
WindowsFormsDesignerOptionService
System.Windows.Forms.Design Namespace
The 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
AnchorEditor
Provides a user interface for configuring an Anchor property.

AxImporter
Imports ActiveX controls and generates a wrapper that can be
accessed by a designer.

AxImporter.Options
Represents a set of options for an AxImporter.

AxParameterData
Represents a parameter of a method of a hosted ActiveX
control.

AxWrapperGen
Generates a wrapper for ActiveX controls for use in the
design-time environment.

BorderSidesEditor
Provides an editor for setting the BorderSides property.

ComponentDocumentDesigner
Base designer class for extending the design mode behavior of
a root design document that supports nested components.

ComponentEditorForm
Provides a user interface for a
WindowsFormsComponentEditor.

ComponentEditorPage
Provides a base implementation for a ComponentEditorPage.

ComponentTray
Provides behavior for the component tray of a designer.

ControlDesigner
Extends the design mode behavior of a Control.

ControlDesigner.ControlDesignerAccessibleObject
Provides an AccessibleObject for ControlDesigner.
DesignerOptions
Provides access to get and set option values for a designer.

DockEditor
Provides a user interface for specifying a Dock property.

DocumentDesigner
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.

EventHandlerService
Provides a systematic way to manage event handlers for the
current document.

EventsTab
Provides a PropertyTab that can display events for selection
and linking.

FileNameEditor
Provides a user interface for selecting a file name.

FolderNameEditor
Provides a user interface for choosing a folder from the file
system.

FolderNameEditor.FolderBrowser
Represents a dialog box that allows the user to choose a
folder. This class cannot be inherited.

ImageListCodeDomSerializer
Serializes string dictionaries.

ImageListImageEditor
Provides an editor that can perform default file searching for
bitmap (.bmp) files.

MaskDescriptor
Defines a set of members for derived classes to provide
options for the masked text box UI type editor.

MenuCommands
Defines a set of CommandID fields that each correspond to a
command function provided by the host environment.

ParentControlDesigner
Extends the design mode behavior of a Control that supports
nested controls.

PropertyTab
Provides a base class for property tabs.
ScrollableControlDesigner
Base designer class for extending the design mode behavior of
a Control which should receive scroll messages.

ShortcutKeysEditor
Provides an editor for picking shortcut keys.

ToolStripItemDesignerAvailabilityAttribute
Specifies which types a ToolStripItem can appear in. This class
cannot be inherited.

WindowsFormsComponentEditor
Provides a base class for editors that use a modal dialog to
display a properties page similar to an ActiveX control's
property page.

WindowsFormsDesignerOptionService
Provides access to get and set option values for a Windows
Forms designer.

Structs
ThemedScrollbarWindow
Represents a window and a value that indicates how its
scrollbars should be themed when displayed in the Visual
Studio designer.

Interfaces
AxImporter.IReferenceResolver
Provides methods to resolve references to ActiveX libraries,
COM type libraries or assemblies, or managed assemblies.

IContainsThemedScrollbarWindows
Defines a method for getting information about how the
scrollbars of windows need to be themed when displayed in
the Visual Studio designer.

IMenuEditorService
Provides access to the menu editing service.

IUIService
Enables interaction with the user interface of the development
environment object that is hosting the designer.

IWindowsFormsEditorService
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
Enums
FolderNameEditor.FolderBrowserFolder
Defines identifiers used to indicate the root folder for a folder
browser to initially browse to.

FolderNameEditor.FolderBrowserStyles
Defines identifiers used to specify behavior of a
FolderNameEditor.FolderBrowser.

SelectionRules
Defines identifiers that are used to indicate selection rules for a
component.

ThemedScrollbarMode
A value that indicates whether the scrollbars of a window and
its children will be themed when displayed in the Visual Studio
designer.

ToolStripItemDesignerAvailability
Specifies controls that are visible in the designer.
AnchorEditor AnchorEditor Class
Provides a user interface for configuring an Anchor property.

D eclaration
[System.CLSCompliant(false)]
public sealed class AnchorEditor : System.Drawing.Design.UITypeEditor
type AnchorEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Remarks
The AnchorEditor provides a design-time user interface for configuring an Anchor property. An Anchor property is
typically used to determine which sides of the container a control is bound to. This class provides a drop-down
graphical control that allows the user to specify which sides of the container to anchor the control to.

Constructors
AnchorEditor()
AnchorEditor()

Initializes a new instance of the AnchorEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the value of the specified object using the specified service provider and context.

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Gets the editor style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.
AnchorEditor
I n this Article
Initializes a new instance of the AnchorEditor class.
public AnchorEditor ();
AnchorEditor.EditValue AnchorEditor.EditValue
I n this Article
Edits the value of the specified object using the specified service provider and context.
public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,
IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
An IServiceProvider through which editing services may be obtained.
value Object Object
An instance of the value being edited.
Returns
Object Object
The new value of the object. If the value of the object hasn't changed, this should return the same object it was passed.

Remarks
A service provider is provided so that any required editing services can be obtained.
AnchorEditor.GetEditStyle AnchorEditor.GetEditStyle
I n this Article
Gets the editor style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle
(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
One of the UITypeEditorEditStyle values indicating the provided editing style. If the method is not supported, this
method will return None.
AxImporter AxImporter Class
Imports ActiveX controls and generates a wrapper that can be accessed by a designer.

D eclaration
public class AxImporter
type AxImporter = class

I nheritance H ierarchy
Object Object

Remarks
To generate an ActiveX wrapper for an ActiveX control, first create or obtain an instance of the AxImporter class. The
AxImporter constructor accepts an AxImporter.Options object, which sets options for the importer, such as the
filename for the wrapper .dll to generate and the output directory to generate the wrapper to. To generate the ActiveX
wrapper, call the appropriate Generate method. To generate from a file, call GenerateFromFile. To generate from a type
library, call GenerateFromTypeLibrary. The string that is returned will consist of an assembly qualified name (example:
"Namespace.Type,Assembly") for the type an ActiveX wrapper was generated for. The wrapper for the ActiveX control
will be generated in the .dll file specified in the outputName property of the AxImporter.Options passed to the
AxImporter constructor. The type can be loaded or queried using System.Reflection and treated as an ordinary
managed type. You can also call the GetOcx method of the type to retrieve a COM interface to the object, if the object
supports this.

Constructors
AxImporter(AxImporter+Options)
AxImporter(AxImporter+Options)

Initializes a new instance of the AxImporter class.

Properties
GeneratedAssemblies
GeneratedAssemblies

Gets the names of the assemblies that are generated for the control.

GeneratedSources
GeneratedSources

Gets the names of the source files that were generated.

GeneratedTypeLibAttributes
GeneratedTypeLibAttributes

Gets the attributes for the generated type library.


Methods
GenerateFromFile(FileInfo)
GenerateFromFile(FileInfo)

Generates a wrapper for an ActiveX control for use in the design-time environment.

GenerateFromTypeLibrary(UCOMITypeLib)
GenerateFromTypeLibrary(UCOMITypeLib)

Generates a wrapper for an ActiveX control for use in the design-time environment.

GenerateFromTypeLibrary(UCOMITypeLib, Guid)
GenerateFromTypeLibrary(UCOMITypeLib, Guid)

Generates a wrapper for an ActiveX control for use in the design-time environment.

GetFileOfTypeLib(TYPELIBATTR)
GetFileOfTypeLib(TYPELIBATTR)

Gets the path and file name to the specified type library.
AxImporter AxImporter
I n this Article
Initializes a new instance of the AxImporter class.
public AxImporter (System.Windows.Forms.Design.AxImporter.Options options);
new System.Windows.Forms.Design.AxImporter : System.Windows.Forms.Design.AxImporter.Options ->
System.Windows.Forms.Design.AxImporter

Parameters
options AxImporter.Options AxImporter.Options
An AxImporter.Options that indicates the options for the ActiveX control importer to use.
See AxImporter.OptionsAxImporter.Options
Also
AxImporter.GeneratedAssemblies AxImporter.Generated
Assemblies
I n this Article
Gets the names of the assemblies that are generated for the control.

public string[] GeneratedAssemblies { get; }


member this.GeneratedAssemblies : string[]

Returns
String[]
An array of names of the generated assemblies, or an empty string array if no assemblies have been generated.
AxImporter.GeneratedSources AxImporter.Generated
Sources
I n this Article
Gets the names of the source files that were generated.

public string[] GeneratedSources { get; }


member this.GeneratedSources : string[]

Returns
String[]
An array of file names of the generated source files, or null if none exist.
AxImporter.GeneratedTypeLibAttributes AxImporter.
GeneratedTypeLibAttributes
I n this Article
Gets the attributes for the generated type library.

public System.Runtime.InteropServices.TYPELIBATTR[] GeneratedTypeLibAttributes { get; }


member this.GeneratedTypeLibAttributes : System.Runtime.InteropServices.TYPELIBATTR[]

Returns
TYPELIBATTR []
An array of type TYPELIBATTR that indicates the attributes for the generated type library.
See TYPELIBATTRTYPELIBATTR
Also
AxImporter.GenerateFromFile AxImporter.GenerateFrom
File
I n this Article
Generates a wrapper for an ActiveX control for use in the design-time environment.

public string GenerateFromFile (System.IO.FileInfo file);


member this.GenerateFromFile : System.IO.FileInfo -> string

Parameters
file FileInfo FileInfo
A FileInfo indicating the file that contains the control.
Returns
String String
An assembly qualified name for the type of ActiveX control for which a wrapper was generated.
Exceptions
Exception Exception
A type library could not be loaded from file .
AxImporter.GenerateFromTypeLibrary AxImporter.
GenerateFromTypeLibrary
I n this Article

Overloads
GenerateFromTypeLibrary(UCOMITypeLib) GenerateFromType
Library(UCOMITypeLib) Generates a wrapper for an ActiveX control for use in the
design-time environment.

GenerateFromTypeLibrary(UCOMITypeLib, Guid) Generate


FromTypeLibrary(UCOMITypeLib, Guid) Generates a wrapper for an ActiveX control for use in the
design-time environment.

GenerateFromTypeLibrary(UCOMITypeLib)
GenerateFromTypeLibrary(UCOMITypeLib)
Generates a wrapper for an ActiveX control for use in the design-time environment.

public string GenerateFromTypeLibrary (System.Runtime.InteropServices.UCOMITypeLib typeLib);


member this.GenerateFromTypeLibrary : System.Runtime.InteropServices.UCOMITypeLib -> string

Parameters
typeLib UCOMITypeLib UCOMITypeLib
A UCOMITypeLib that indicates the type library to generate the control from.
Returns
String String
An assembly qualified name for the type of ActiveX control for which a wrapper was generated.
Exceptions
Exception Exception
No registered ActiveX control was found in typeLib .
See UCOMITypeLibUCOMITypeLib
Also

GenerateFromTypeLibrary(UCOMITypeLib, Guid)
GenerateFromTypeLibrary(UCOMITypeLib, Guid)
Generates a wrapper for an ActiveX control for use in the design-time environment.
public string GenerateFromTypeLibrary (System.Runtime.InteropServices.UCOMITypeLib typeLib, Guid
clsid);
member this.GenerateFromTypeLibrary : System.Runtime.InteropServices.UCOMITypeLib * Guid -> string

Parameters
typeLib UCOMITypeLib UCOMITypeLib
A UCOMITypeLib that indicates the type library to generate the control from.
clsid Guid Guid
The Guid for the control wrapper.
Returns
String String
An assembly qualified name for the type of ActiveX control for which a wrapper was generated.
Exceptions
Exception Exception
No registered ActiveX control was found in typeLib .
AxImporter.GetFileOfTypeLib AxImporter.GetFileOfType
Lib
I n this Article
Gets the path and file name to the specified type library.

public static string GetFileOfTypeLib (ref System.Runtime.InteropServices.TYPELIBATTR tlibattr);


static member GetFileOfTypeLib : -> string

Parameters
tlibattr TYPELIBATTR TYPELIBATTR
A TYPELIBATTR that indicates the type library to retrieve the file name of.
Returns
String String
The path and file name to the specified type library, or null if the library could not be located.
AxImporter.IReferenceResolver AxImporter.IReference
Resolver Interface
Provides methods to resolve references to ActiveX libraries, COM type libraries or assemblies, or managed assemblies.

D eclaration
public interface AxImporter.IReferenceResolver
type AxImporter.IReferenceResolver = interface

I nheritance H ierarchy
None

Methods
ResolveActiveXReference(UCOMITypeLib)
ResolveActiveXReference(UCOMITypeLib)

Resolves a reference to the specified type library that contains an ActiveX control.

ResolveComReference(AssemblyName)
ResolveComReference(AssemblyName)

Resolves a reference to the specified assembly that contains a COM component.

ResolveComReference(UCOMITypeLib)
ResolveComReference(UCOMITypeLib)

Resolves a reference to the specified type library that contains an COM component.

ResolveManagedReference(String)
ResolveManagedReference(String)

Resolves a reference to the specified assembly.


AxImporter.IReferenceResolver.ResolveActiveXReference
AxImporter.IReferenceResolver.ResolveActiveXReference
I n this Article
Resolves a reference to the specified type library that contains an ActiveX control.

public string ResolveActiveXReference (System.Runtime.InteropServices.UCOMITypeLib typeLib);


abstract member ResolveActiveXReference : System.Runtime.InteropServices.UCOMITypeLib -> string

Parameters
typeLib UCOMITypeLib UCOMITypeLib
A UCOMITypeLib to resolve a reference to.
Returns
String String
A fully qualified path to an assembly.
AxImporter.IReferenceResolver.ResolveComReference Ax
Importer.IReferenceResolver.ResolveComReference
I n this Article

Overloads
ResolveComReference(AssemblyName) ResolveComReference(
AssemblyName) Resolves a reference to the specified assembly that contains a
COM component.

ResolveComReference(UCOMITypeLib) ResolveComReference(
UCOMITypeLib) Resolves a reference to the specified type library that contains
an COM component.

ResolveComReference(AssemblyName)
ResolveComReference(AssemblyName)
Resolves a reference to the specified assembly that contains a COM component.

public string ResolveComReference (System.Reflection.AssemblyName name);


abstract member ResolveComReference : System.Reflection.AssemblyName -> string

Parameters
name AssemblyName AssemblyName
An AssemblyName that indicates the assembly to resolve a reference to.
Returns
String String
A fully qualified path to an assembly.

ResolveComReference(UCOMITypeLib)
ResolveComReference(UCOMITypeLib)
Resolves a reference to the specified type library that contains an COM component.
public string ResolveComReference (System.Runtime.InteropServices.UCOMITypeLib typeLib);
abstract member ResolveComReference : System.Runtime.InteropServices.UCOMITypeLib -> string

Parameters
typeLib UCOMITypeLib UCOMITypeLib
A UCOMITypeLib to resolve a reference to.
Returns
String String
A fully qualified path to an assembly.
AxImporter.IReferenceResolver.ResolveManaged
Reference AxImporter.IReferenceResolver.Resolve
ManagedReference
I n this Article
Resolves a reference to the specified assembly.
public string ResolveManagedReference (string assemName);
abstract member ResolveManagedReference : string -> string

Parameters
assemName String String
The name of the assembly to resolve a reference to.
Returns
String String
A fully qualified path to an assembly.
AxImporter.Options AxImporter.Options Class
Represents a set of options for an AxImporter.

D eclaration
public sealed class AxImporter.Options
type AxImporter.Options = class

I nheritance H ierarchy
Object Object

Constructors
AxImporter.Options()
AxImporter.Options()

Initializes a new instance of the AxImporter.Options class.

Fields
delaySign
delaySign

Specifies whether the generated assembly is strongly named and will be signed later.

genSources
genSources

Specifies whether sources for the type library wrapper should be generated.

ignoreRegisteredOcx
ignoreRegisteredOcx

Specifies whether to use only input from the command line instead relying on a registered version.

keyContainer
keyContainer

Specifies the path to the file that contains the strong name key container for the generated assemblies.

keyFile
keyFile

Specifies the path to the file that contains the strong name key for the generated assemblies.
keyPair
keyPair

Specifies the strong name used for the generated assemblies.

msBuildErrors
msBuildErrors

Specifies whether errors are output in the Microsoft Build Engine (MSBuild) format.

noLogo
noLogo

Indicates whether the ActiveX importer tool logo will be displayed when the control is imported.

outputDirectory
outputDirectory

Specifies the path to the directory that the generated assemblies will be created in.

outputName
outputName

Specifies the filename to generate the ActiveX control wrapper to.

overwriteRCW
overwriteRCW

Specifies whether to overwrite existing files when generating assemblies.

publicKey
publicKey

Specifies the public key used to sign the generated assemblies.

references
references

Specifies the AxImporter.IReferenceResolver to use to resolve types and references when generating assemblies.

silentMode
silentMode

Specifies whether to compile in silent mode, which generates less displayed information at compile time.
verboseMode
verboseMode

Specifies whether to compile in verbose mode, which generates more displayed information at compile time.
AxImporter.Options
I n this Article
Initializes a new instance of the AxImporter.Options class.
public Options ();
AxImporter.Options.delaySign AxImporter.Options.delay
Sign
I n this Article
Specifies whether the generated assembly is strongly named and will be signed later.

public bool delaySign;


val mutable delaySign : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.genSources AxImporter.Options.gen
Sources
I n this Article
Specifies whether sources for the type library wrapper should be generated.

public bool genSources;


val mutable genSources : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.ignoreRegisteredOcx AxImporter.
Options.ignoreRegisteredOcx
I n this Article
Specifies whether to use only input from the command line instead relying on a registered version.

public bool ignoreRegisteredOcx;


val mutable ignoreRegisteredOcx : bool

Returns
Boolean Boolean
AxImporter.Options.keyContainer AxImporter.
Options.keyContainer
I n this Article
Specifies the path to the file that contains the strong name key container for the generated assemblies.

public string keyContainer;


val mutable keyContainer : string

Returns
String String

Remarks
By default, this field is set to null .
AxImporter.Options.keyFile AxImporter.Options.keyFile
I n this Article
Specifies the path to the file that contains the strong name key for the generated assemblies.
public string keyFile;
val mutable keyFile : string

Returns
String String

Remarks
By default, this field is set to null .
AxImporter.Options.keyPair AxImporter.Options.keyPair
I n this Article
Specifies the strong name used for the generated assemblies.
public System.Reflection.StrongNameKeyPair keyPair;
val mutable keyPair : System.Reflection.StrongNameKeyPair

Returns
StrongNameKeyPair StrongNameKeyPair

Remarks
By default, this field is set to null .
AxImporter.Options.msBuildErrors AxImporter.
Options.msBuildErrors
I n this Article
Specifies whether errors are output in the Microsoft Build Engine (MSBuild) format.

public bool msBuildErrors;


val mutable msBuildErrors : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.noLogo AxImporter.Options.noLogo
I n this Article
Indicates whether the ActiveX importer tool logo will be displayed when the control is imported.
public bool noLogo;
val mutable noLogo : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.outputDirectory AxImporter.
Options.outputDirectory
I n this Article
Specifies the path to the directory that the generated assemblies will be created in.

public string outputDirectory;


val mutable outputDirectory : string

Returns
String String

Remarks
By default, this field is set to null .
AxImporter.Options.outputName AxImporter.
Options.outputName
I n this Article
Specifies the filename to generate the ActiveX control wrapper to.

public string outputName;


val mutable outputName : string

Returns
String String

Remarks
By default, this field is set to null . If this field is null , the file name will be a concatenation of "Ax" + the type library
name from the assembly + ".dll".
AxImporter.Options.overwriteRCW AxImporter.
Options.overwriteRCW
I n this Article
Specifies whether to overwrite existing files when generating assemblies.

public bool overwriteRCW;


val mutable overwriteRCW : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.publicKey AxImporter.Options.public
Key
I n this Article
Specifies the public key used to sign the generated assemblies.

public byte[] publicKey;


val mutable publicKey : byte[]

Returns
Byte[]

Remarks
By default, this field is set to null .
AxImporter.Options.references AxImporter.
Options.references
I n this Article
Specifies the AxImporter.IReferenceResolver to use to resolve types and references when generating assemblies.

public System.Windows.Forms.Design.AxImporter.IReferenceResolver references;


val mutable references : System.Windows.Forms.Design.AxImporter.IReferenceResolver

Returns
AxImporter.IReferenceResolver AxImporter.IReferenceResolver

Remarks
By default, this field is set to null .
See AxImporter.IReferenceResolverAxImporter.IReferenceResolver
Also
AxImporter.Options.silentMode AxImporter.Options.silent
Mode
I n this Article
Specifies whether to compile in silent mode, which generates less displayed information at compile time.

public bool silentMode;


val mutable silentMode : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxImporter.Options.verboseMode AxImporter.
Options.verboseMode
I n this Article
Specifies whether to compile in verbose mode, which generates more displayed information at compile time.

public bool verboseMode;


val mutable verboseMode : bool

Returns
Boolean Boolean

Remarks
By default, this field is set to false .
AxParameterData AxParameterData Class
Represents a parameter of a method of a hosted ActiveX control.

D eclaration
public class AxParameterData
type AxParameterData = class

I nheritance H ierarchy
Object Object

Constructors
AxParameterData(ParameterInfo)
AxParameterData(ParameterInfo)

Initializes a new instance of the AxParameterData class using the specified parameter information.

AxParameterData(ParameterInfo, Boolean)
AxParameterData(ParameterInfo, Boolean)

Initializes a new instance of the AxParameterData class using the specified parameter information and whether to
ignore by reference parameters.

AxParameterData(String, String)
AxParameterData(String, String)

Initializes a new instance of the AxParameterData class using the specified name and type name.

AxParameterData(String, Type)
AxParameterData(String, Type)

Initializes a new instance of the AxParameterData class using the specified name and type.

Properties
Direction
Direction

Indicates the direction of assignment fields.

IsByRef
IsByRef

Indicates whether the parameter data is passed by reference.


IsIn
IsIn

Indicates whether the parameter data is in.

IsOptional
IsOptional

Indicates whether the parameter data is optional.

IsOut
IsOut

Indicates whether the parameter data is out.

Name
Name

Gets or sets the name of the parameter.

ParameterType
ParameterType

Gets the type expected by the parameter.

TypeName
TypeName

Gets the name of the type expected by the parameter.

Methods
Convert(ParameterInfo[])
Convert(ParameterInfo[])

Converts the specified parameter information to an AxParameterData object.

Convert(ParameterInfo[], Boolean)
Convert(ParameterInfo[], Boolean)

Converts the specified parameter information to an AxParameterData object, according to the specified value
indicating whether to ignore by reference parameters.

See Also
ParameterInfo ParameterInfo
AxParameterData AxParameterData
I n this Article

Overloads
AxParameterData(ParameterInfo) AxParameterData(Parameter
Info) Initializes a new instance of the AxParameterData class using
the specified parameter information.

AxParameterData(ParameterInfo, Boolean) AxParameterData(


ParameterInfo, Boolean) Initializes a new instance of the AxParameterData class using
the specified parameter information and whether to ignore by
reference parameters.

AxParameterData(String, String) AxParameterData(String,


String) Initializes a new instance of the AxParameterData class using
the specified name and type name.

AxParameterData(String, Type) AxParameterData(String, Type)


Initializes a new instance of the AxParameterData class using
the specified name and type.

AxParameterData(ParameterInfo)
AxParameterData(ParameterInfo)
Initializes a new instance of the AxParameterData class using the specified parameter information.
public AxParameterData (System.Reflection.ParameterInfo info);
new System.Windows.Forms.Design.AxParameterData : System.Reflection.ParameterInfo ->
System.Windows.Forms.Design.AxParameterData

Parameters
info ParameterInfo ParameterInfo
A ParameterInfo indicating the parameter information to use.
See ParameterInfoParameterInfo
Also

AxParameterData(ParameterInfo, Boolean)
AxParameterData(ParameterInfo, Boolean)
Initializes a new instance of the AxParameterData class using the specified parameter information and whether to
ignore by reference parameters.
public AxParameterData (System.Reflection.ParameterInfo info, bool ignoreByRefs);
new System.Windows.Forms.Design.AxParameterData : System.Reflection.ParameterInfo * bool ->
System.Windows.Forms.Design.AxParameterData

Parameters
info ParameterInfo ParameterInfo
A ParameterInfo indicating the parameter information to use.
ignoreByRefs Boolean Boolean
A value indicating whether to ignore parameters passed by reference.
See ParameterInfoParameterInfo
Also

AxParameterData(String, String) AxParameterData(String, String)


Initializes a new instance of the AxParameterData class using the specified name and type name.
public AxParameterData (string inname, string typeName);
new System.Windows.Forms.Design.AxParameterData : string * string ->
System.Windows.Forms.Design.AxParameterData

Parameters
inname String String
The name of the parameter.
typeName String String
The name of the type of the parameter.

AxParameterData(String, Type) AxParameterData(String, Type)


Initializes a new instance of the AxParameterData class using the specified name and type.
public AxParameterData (string inname, Type type);
new System.Windows.Forms.Design.AxParameterData : string * Type ->
System.Windows.Forms.Design.AxParameterData

Parameters
inname String String
The name of the parameter.
type Type Type
The type of the parameter.
AxParameterData.Convert AxParameterData.Convert
I n this Article

Overloads
Convert(ParameterInfo[]) Convert(ParameterInfo[])
Converts the specified parameter information to an
AxParameterData object.

Convert(ParameterInfo[], Boolean) Convert(ParameterInfo[],


Boolean) Converts the specified parameter information to an
AxParameterData object, according to the specified value
indicating whether to ignore by reference parameters.

Convert(ParameterInfo[]) Convert(ParameterInfo[])
Converts the specified parameter information to an AxParameterData object.
public static System.Windows.Forms.Design.AxParameterData[] Convert
(System.Reflection.ParameterInfo[] infos);
static member Convert : System.Reflection.ParameterInfo[] ->
System.Windows.Forms.Design.AxParameterData[]

Parameters
infos ParameterInfo[]
An array of ParameterInfo objects to convert.
Returns
AxParameterData[]
An array of AxParameterData objects representing the specified array of ParameterInfo objects.
See ParameterInfoParameterInfo
Also

Convert(ParameterInfo[], Boolean) Convert(ParameterInfo[],


Boolean)
Converts the specified parameter information to an AxParameterData object, according to the specified value
indicating whether to ignore by reference parameters.
public static System.Windows.Forms.Design.AxParameterData[] Convert
(System.Reflection.ParameterInfo[] infos, bool ignoreByRefs);
static member Convert : System.Reflection.ParameterInfo[] * bool ->
System.Windows.Forms.Design.AxParameterData[]

Parameters
infos ParameterInfo[]
An array of ParameterInfo objects to convert.
ignoreByRefs Boolean Boolean
A value indicating whether to ignore parameters passed by reference.
Returns
AxParameterData[]
An array of AxParameterData objects representing the specified array of ParameterInfo objects.
See ParameterInfoParameterInfo
Also
AxParameterData.Direction AxParameterData.Direction
I n this Article
Indicates the direction of assignment fields.
public System.CodeDom.FieldDirection Direction { get; }
member this.Direction : System.CodeDom.FieldDirection

Returns
FieldDirection FieldDirection
A FieldDirection indicating the direction of assignment fields.
See FieldDirectionFieldDirection
Also
AxParameterData.IsByRef AxParameterData.IsByRef
I n this Article
Indicates whether the parameter data is passed by reference.
public bool IsByRef { get; }
member this.IsByRef : bool

Returns
Boolean Boolean
true if the parameter data is by reference; otherwise, false .
AxParameterData.IsIn AxParameterData.IsIn
I n this Article
Indicates whether the parameter data is in.
public bool IsIn { get; }
member this.IsIn : bool

Returns
Boolean Boolean
true if the parameter data is in; otherwise, false .
AxParameterData.IsOptional AxParameterData.Is
Optional
I n this Article
Indicates whether the parameter data is optional.

public bool IsOptional { get; }


member this.IsOptional : bool

Returns
Boolean Boolean
true if the parameter data is optional; otherwise, false .
AxParameterData.IsOut AxParameterData.IsOut
I n this Article
Indicates whether the parameter data is out.
public bool IsOut { get; }
member this.IsOut : bool

Returns
Boolean Boolean
true if the parameter data is out; otherwise, false .
AxParameterData.Name AxParameterData.Name
I n this Article
Gets or sets the name of the parameter.
public string Name { get; set; }
member this.Name : string with get, set

Returns
String String
The name of the parameter.
AxParameterData.ParameterType AxParameterData.
ParameterType
I n this Article
Gets the type expected by the parameter.

public Type ParameterType { get; }


member this.ParameterType : Type

Returns
Type Type
The type expected by the parameter.
AxParameterData.TypeName AxParameterData.Type
Name
I n this Article
Gets the name of the type expected by the parameter.

public string TypeName { get; }


member this.TypeName : string

Returns
String String
The name of the type expected by the parameter.
AxWrapperGen AxWrapperGen Class
Generates a wrapper for ActiveX controls for use in the design-time environment.

D eclaration
public class AxWrapperGen
type AxWrapperGen = class

I nheritance H ierarchy
Object Object

Constructors
AxWrapperGen(Type)
AxWrapperGen(Type)

Generates an ActiveX wrapper for design-time hosting of an ActiveX control.

Fields
GeneratedSources
GeneratedSources

This field initializes a local ArrayList variable named GeneratedSources.


AxWrapperGen AxWrapperGen
I n this Article
Generates an ActiveX wrapper for design-time hosting of an ActiveX control.
public AxWrapperGen (Type axType);
new System.Windows.Forms.Design.AxWrapperGen : Type -> System.Windows.Forms.Design.AxWrapperGen

Parameters
axType Type Type
The type of ActiveX control to generate a wrapper for.
AxWrapperGen.GeneratedSources AxWrapperGen.
GeneratedSources
I n this Article
This field initializes a local ArrayList variable named GeneratedSources.

public static System.Collections.ArrayList GeneratedSources;


staticval mutable GeneratedSources : System.Collections.ArrayList

Returns
ArrayList ArrayList

Remarks
This object contains the paths to each of any sources for ActiveX control wrappers that were generated.
BorderSidesEditor BorderSidesEditor Class
Provides an editor for setting the BorderSides property.

D eclaration
[System.CLSCompliant(false)]
public class BorderSidesEditor : System.Drawing.Design.UITypeEditor
type BorderSidesEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Constructors
BorderSidesEditor()
BorderSidesEditor()

Initializes a new instance of the BorderSidesEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the given object value using the editor style provided by GetEditStyle(ITypeDescriptorContext).

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Retrieves the editing style of the EditValue method.


BorderSidesEditor
I n this Article
Initializes a new instance of the BorderSidesEditor class.
public BorderSidesEditor ();
BorderSidesEditor.EditValue BorderSidesEditor.EditValue
I n this Article
Edits the given object value using the editor style provided by GetEditStyle(ITypeDescriptorContext).
public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,
IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext providing information about the control or component.
provider IServiceProvider IServiceProvider
An IServiceProvider providing custom support to other objects.
value Object Object
The object value to edit.
Returns
Object Object
The edited object.
BorderSidesEditor.GetEditStyle BorderSidesEditor.GetEdit
Style
I n this Article
Retrieves the editing style of the EditValue method.

public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle


(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext providing information about the control or component.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
One of the UITypeEditorEditStyle values. If the method is not supported, this method returns None.
ComponentDocumentDesigner ComponentDocument
Designer Class
Base designer class for extending the design mode behavior of a root design document that supports nested
components.

D eclaration
public class ComponentDocumentDesigner : System.ComponentModel.Design.ComponentDesigner,
IDisposable, System.ComponentModel.Design.IRootDesigner,
System.ComponentModel.Design.ITypeDescriptorFilterService, System.Drawing.Design.IToolboxUser
type ComponentDocumentDesigner = class
inherit ComponentDesigner
interface IRootDesigner
interface IDesigner
interface IDisposable
interface IToolboxUser
interface ITypeDescriptorFilterService

I nheritance H ierarchy
Object Object
ComponentDesigner ComponentDesigner

Remarks
ComponentDocumentDesigner provides a base class for designers of root design documents that support nested
components. In addition to the methods and functionality inherited from the ComponentDesigner class,
ComponentDocumentDesigner implements the IRootDesigner interface to provide a root-level design mode view for
the associated component, and any nested components.
Note

The root-level design mode view for a Form or Control is typically provided by a built-in root designer. A custom
IRootDesigner implementation is required to provide a view for other types of root components in design mode.
You can associate a designer with a type using a DesignerAttribute. For an overview of customizing design time
behavior, see Extending Design-Time Support.

Constructors
ComponentDocumentDesigner()
ComponentDocumentDesigner()

Initializes a new instance of the ComponentDocumentDesigner class.

Properties
Control
Control

Gets the control for the designer.


TrayAutoArrange
TrayAutoArrange

Gets or sets a value indicating whether the component tray for the designer is in auto-arrange mode.

TrayLargeIcon
TrayLargeIcon

Gets or sets a value indicating whether the component tray for the designer is in large icon mode.

Methods
Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the ComponentDocumentDesigner and optionally releases the
managed resources.

GetToolSupported(ToolboxItem)
GetToolSupported(ToolboxItem)

Gets a value indicating whether the specified tool is supported by the designer.

Initialize(IComponent)
Initialize(IComponent)

Initializes the designer with the specified component.

PreFilterProperties(IDictionary)
PreFilterProperties(IDictionary)

Adjusts the set of properties the component will expose through a TypeDescriptor.

IRootDesigner.GetView(ViewTechnology)
IRootDesigner.GetView(ViewTechnology)

For a description of this member, see ViewTechnology.

IRootDesigner.SupportedTechnologies
IRootDesigner.SupportedTechnologies

For a description of this member, see SupportedTechnologies.

ITypeDescriptorFilterService.FilterAttributes(IComponent, IDictionary)
ITypeDescriptorFilterService.FilterAttributes(IComponent, IDictionary)
For a description of this member, see FilterAttributes(IComponent, IDictionary).

ITypeDescriptorFilterService.FilterEvents(IComponent, IDictionary)
ITypeDescriptorFilterService.FilterEvents(IComponent, IDictionary)

For a description of this member, see FilterEvents(IComponent, IDictionary).

ITypeDescriptorFilterService.FilterProperties(IComponent, IDictionary)
ITypeDescriptorFilterService.FilterProperties(IComponent, IDictionary)

For a description of this member, see FilterProperties(IComponent, IDictionary).

IToolboxUser.GetToolSupported(ToolboxItem)
IToolboxUser.GetToolSupported(ToolboxItem)

For a description of this member, see GetToolSupported(ToolboxItem).

IToolboxUser.ToolPicked(ToolboxItem)
IToolboxUser.ToolPicked(ToolboxItem)

For a description of this member, see ToolPicked(ToolboxItem).

See Also
ComponentDesigner ComponentDesigner
IRootDesigner IRootDesigner
IDesigner IDesigner
ComponentDesigner ComponentDesigner
ComponentDocumentDesigner
I n this Article
Initializes a new instance of the ComponentDocumentDesigner class.
public ComponentDocumentDesigner ();
ComponentDocumentDesigner.Control Component
DocumentDesigner.Control
I n this Article
Gets the control for the designer.

public System.Windows.Forms.Control Control { get; }


member this.Control : System.Windows.Forms.Control

Returns
Control Control
The Control the designer is editing.
ComponentDocumentDesigner.Dispose Component
DocumentDesigner.Dispose
I n this Article
Releases the unmanaged resources used by the ComponentDocumentDesigner and optionally releases the managed
resources.
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true, this method releases all resources held by any managed objects that this
ComponentDocumentDesigner references. This method invokes the Dispose() method of each referenced object.
ComponentDocumentDesigner.GetToolSupported
ComponentDocumentDesigner.GetToolSupported
I n this Article
Gets a value indicating whether the specified tool is supported by the designer.

[System.CLSCompliant(false)]
protected virtual bool GetToolSupported (System.Drawing.Design.ToolboxItem tool);
abstract member GetToolSupported : System.Drawing.Design.ToolboxItem -> bool
override this.GetToolSupported : System.Drawing.Design.ToolboxItem -> bool

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to test for toolbox support.
Returns
Boolean Boolean
true if the tool should be enabled on the toolbox; false if the document designer doesn't know how to use the tool.
Attributes CLSCompliantAttribute

Remarks
If a tool is supported, it will be enabled in the toolbox when the designer regains focus. Otherwise, it will be disabled.
Once a tool is marked as enabled or disabled it cannot be queried again.
See IToolboxUserIToolboxUser
Also
ComponentDocumentDesigner.Initialize Component
DocumentDesigner.Initialize
I n this Article
Initializes the designer with the specified component.

public override void Initialize (System.ComponentModel.IComponent component);


override this.Initialize : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to associate with the designer.
See IDesignerIDesigner
Also
ComponentDocumentDesigner.IRootDesigner.GetView
I n this Article
For a description of this member, see ViewTechnology.
object IRootDesigner.GetView (System.ComponentModel.Design.ViewTechnology technology);

Parameters
technology ViewTechnology
A ViewTechnology that indicates a particular view technology.
Returns
Object
An object that represents the view for this designer.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an IRootDesigner interface.
ComponentDocumentDesigner.IRootDesigner.Supported
Technologies
I n this Article
For a description of this member, see SupportedTechnologies.

System.ComponentModel.Design.ViewTechnology[]
System.ComponentModel.Design.IRootDesigner.SupportedTechnologies { get; }

Returns
ViewTechnology[]
An array of supported ViewTechnology values.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an IRootDesigner interface.
ComponentDocumentDesigner.IToolboxUser.GetTool
Supported
I n this Article
For a description of this member, see GetToolSupported(ToolboxItem).

bool IToolboxUser.GetToolSupported (System.Drawing.Design.ToolboxItem tool);

Parameters
tool ToolboxItem
The ToolboxItem to be tested for toolbox support.
Returns
Boolean
true if the tool is supported by the toolbox and can be enabled; false if the document designer does not know how
to use the tool.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an IToolboxUser interface.
ComponentDocumentDesigner.IToolboxUser.ToolPicked
I n this Article
For a description of this member, see ToolPicked(ToolboxItem).
void IToolboxUser.ToolPicked (System.Drawing.Design.ToolboxItem tool);

Parameters
tool ToolboxItem
The ToolboxItem to select.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an IToolboxUser interface.
ComponentDocumentDesigner.ITypeDescriptorFilter
Service.FilterAttributes
I n this Article
For a description of this member, see FilterAttributes(IComponent, IDictionary).

bool ITypeDescriptorFilterService.FilterAttributes (System.ComponentModel.IComponent component,


System.Collections.IDictionary attributes);

Parameters
component IComponent
The component to filter the attributes of.
attributes IDictionary
A dictionary of attributes that can be modified.
Returns
Boolean
true if the set of filtered attributes is to be cached; false if the filter service must query again.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an ITypeDescriptorFilterService interface.
ComponentDocumentDesigner.ITypeDescriptorFilter
Service.FilterEvents
I n this Article
For a description of this member, see FilterEvents(IComponent, IDictionary).

bool ITypeDescriptorFilterService.FilterEvents (System.ComponentModel.IComponent component,


System.Collections.IDictionary events);

Parameters
component IComponent
The component to filter events for.
events IDictionary
A dictionary of events that can be modified.
Returns
Boolean
true if the set of filtered events is to be cached; false if the filter service must query again.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an ITypeDescriptorFilterService interface.
ComponentDocumentDesigner.ITypeDescriptorFilter
Service.FilterProperties
I n this Article
For a description of this member, see FilterProperties(IComponent, IDictionary).

bool ITypeDescriptorFilterService.FilterProperties (System.ComponentModel.IComponent component,


System.Collections.IDictionary properties);

Parameters
component IComponent
The component to filter properties for.
properties IDictionary
A dictionary of properties that can be modified.
Returns
Boolean
true if the set of filtered properties is to be cached; false if the filter service must query again.

Remarks
This member is an explicit interface member implementation. It can be used only when the
ComponentDocumentDesigner instance is cast to an ITypeDescriptorFilterService interface.
ComponentDocumentDesigner.PreFilterProperties
ComponentDocumentDesigner.PreFilterProperties
I n this Article
Adjusts the set of properties the component will expose through a TypeDescriptor.

protected override void PreFilterProperties (System.Collections.IDictionary properties);


override this.PreFilterProperties : System.Collections.IDictionary -> unit

Parameters
properties IDictionary IDictionary
An IDictionary that contains the properties for the class of the component.

Remarks
This IDesignerFilter interface method override adds a non-browsable, design-time only boolean property named
"TrayLargeIcon" to this designer's component at design time. This property is used by the component tray.
ComponentDocumentDesigner.TrayAutoArrange
ComponentDocumentDesigner.TrayAutoArrange
I n this Article
Gets or sets a value indicating whether the component tray for the designer is in auto-arrange mode.

public bool TrayAutoArrange { get; set; }


member this.TrayAutoArrange : bool with get, set

Returns
Boolean Boolean
true if the component tray for the designer is in auto-arrange mode; otherwise, false .
ComponentDocumentDesigner.TrayLargeIcon
ComponentDocumentDesigner.TrayLargeIcon
I n this Article
Gets or sets a value indicating whether the component tray for the designer is in large icon mode.

public bool TrayLargeIcon { get; set; }


member this.TrayLargeIcon : bool with get, set

Returns
Boolean Boolean
true if the component tray for the designer is in large icon mode; otherwise, false .
ComponentEditorForm ComponentEditorForm Class
Provides a user interface for a WindowsFormsComponentEditor.

D eclaration
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType
.AutoDispatch)]
public class ComponentEditorForm : System.Windows.Forms.Form
type ComponentEditorForm = class
inherit Form

I nheritance H ierarchy
Object Object
MarshalByRefObject MarshalByRefObject
Component Component
Control Control
ScrollableControl ScrollableControl
ContainerControl ContainerControl
Form Form

Remarks
A ComponentEditorForm shows a view of available component editor pages along with a user interface for selection.

Constructors
ComponentEditorForm(Object, Type[])
ComponentEditorForm(Object, Type[])

Initializes a new instance of the ComponentEditorForm class.

Properties
AutoSize
AutoSize

Resize the form according to the setting of AutoSizeMode.

Methods
OnActivated(EventArgs)
OnActivated(EventArgs)

Raises the Activated event.

OnHelpRequested(HelpEventArgs)
OnHelpRequested(HelpEventArgs)
Raises the HelpRequested event.

OnSelChangeSelector(Object, TreeViewEventArgs)
OnSelChangeSelector(Object, TreeViewEventArgs)

Switches between component editor pages.

PreProcessMessage(Message)
PreProcessMessage(Message)

Provides a method to override in order to preprocess input messages before they are dispatched.

ShowForm()
ShowForm()

Shows the form. The form will have no owner window.

ShowForm(Int32)
ShowForm(Int32)

Shows the specified page of the specified form. The form will have no owner window.

ShowForm(IWin32Window)
ShowForm(IWin32Window)

Shows the form with the specified owner.

ShowForm(IWin32Window, Int32)
ShowForm(IWin32Window, Int32)

Shows the form and the specified page with the specified owner.

Events
AutoSizeChanged
AutoSizeChanged

Occurs when the AutoSize property changes.


ComponentEditorForm.AutoSize ComponentEditorForm.
AutoSize
I n this Article
Resize the form according to the setting of AutoSizeMode.

[System.ComponentModel.Browsable(false)]
public override bool AutoSize { get; set; }
member this.AutoSize : bool with get, set

Returns
Boolean Boolean
true if the form will automatically resize; false if it must be manually resized.
Attributes BrowsableAttribute
ComponentEditorForm.AutoSizeChanged Component
EditorForm.AutoSizeChanged
I n this Article
Occurs when the AutoSize property changes.

[System.ComponentModel.Browsable(false)]
public event EventHandler AutoSizeChanged;
member this.AutoSizeChanged : EventHandler

Attributes BrowsableAttribute
ComponentEditorForm ComponentEditorForm
I n this Article
Initializes a new instance of the ComponentEditorForm class.
public ComponentEditorForm (object component, Type[] pageTypes);
new System.Windows.Forms.Design.ComponentEditorForm : obj * Type[] ->
System.Windows.Forms.Design.ComponentEditorForm

Parameters
component Object Object
The component to be edited.
pageTypes Type[]
The set of ComponentEditorPage objects to be shown in the form.
Exceptions
ArgumentException ArgumentException
component is not an IComponent.
ComponentEditorForm.OnActivated ComponentEditor
Form.OnActivated
I n this Article
Raises the Activated event.

protected override void OnActivated (EventArgs e);


override this.OnActivated : EventArgs -> unit

Parameters
e EventArgs EventArgs
An EventArgs that contains the event data.

Remarks
The first time the OnActivated method is executed, it shows the first component editor page in the list.
Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising
Events.
The OnActivated method also allows derived classes to handle the event without attaching a delegate. This is the
preferred technique for handling the event in a derived class.
ComponentEditorForm.OnHelpRequested Component
EditorForm.OnHelpRequested
I n this Article
Raises the HelpRequested event.

protected override void OnHelpRequested (System.Windows.Forms.HelpEventArgs e);


override this.OnHelpRequested : System.Windows.Forms.HelpEventArgs -> unit

Parameters
e HelpEventArgs HelpEventArgs
A HelpEventArgs that contains the event data.

Remarks
The OnHelpRequested method shows the Help page that is associated with the component editor page, if there is one.
Raising an event invokes the event handler through a delegate. For more information, see Handling and Raising
Events.
The OnHelpRequested method also allows derived classes to handle the event without attaching a delegate. This is the
preferred technique for handling the event in a derived class.
ComponentEditorForm.OnSelChangeSelector
ComponentEditorForm.OnSelChangeSelector
I n this Article
Switches between component editor pages.

protected virtual void OnSelChangeSelector (object source, System.Windows.Forms.TreeViewEventArgs


e);
abstract member OnSelChangeSelector : obj * System.Windows.Forms.TreeViewEventArgs -> unit
override this.OnSelChangeSelector : obj * System.Windows.Forms.TreeViewEventArgs -> unit

Parameters
source Object Object
The source of the event.
e TreeViewEventArgs TreeViewEventArgs
A TreeViewEventArgs that contains the event data.
Exceptions
CheckoutException CheckoutException
A designer file is checked into source code control and cannot be changed.
ComponentEditorForm.PreProcessMessage Component
EditorForm.PreProcessMessage
I n this Article
Provides a method to override in order to preprocess input messages before they are dispatched.

public override bool PreProcessMessage (ref System.Windows.Forms.Message msg);


override this.PreProcessMessage : -> bool

Parameters
msg Message Message
A Message that specifies the message to preprocess.
Returns
Boolean Boolean
true if the specified message is for a component editor page; otherwise, false .

Remarks
PreProcessMessage is called by the application's message loop to preprocess input messages before they are
dispatched.
ComponentEditorForm.ShowForm ComponentEditor
Form.ShowForm
I n this Article

Overloads
ShowForm() ShowForm()
Shows the form. The form will have no owner window.

ShowForm(Int32) ShowForm(Int32)
Shows the specified page of the specified form. The form will
have no owner window.

ShowForm(IWin32Window) ShowForm(IWin32Window)
Shows the form with the specified owner.

ShowForm(IWin32Window, Int32) ShowForm(IWin32Window,


Int32) Shows the form and the specified page with the specified
owner.

ShowForm() ShowForm()
Shows the form. The form will have no owner window.
public virtual System.Windows.Forms.DialogResult ShowForm ();
abstract member ShowForm : unit -> System.Windows.Forms.DialogResult
override this.ShowForm : unit -> System.Windows.Forms.DialogResult

Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned from the dialog box.
See DialogResultDialogResult
Also

ShowForm(Int32) ShowForm(Int32)
Shows the specified page of the specified form. The form will have no owner window.

public virtual System.Windows.Forms.DialogResult ShowForm (int page);


abstract member ShowForm : int -> System.Windows.Forms.DialogResult
override this.ShowForm : int -> System.Windows.Forms.DialogResult

Parameters
page Int32 Int32
The index of the page to show.
Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned from the dialog box.
See DialogResultDialogResult
Also

ShowForm(IWin32Window) ShowForm(IWin32Window)
Shows the form with the specified owner.
public virtual System.Windows.Forms.DialogResult ShowForm (System.Windows.Forms.IWin32Window owner);
abstract member ShowForm : System.Windows.Forms.IWin32Window -> System.Windows.Forms.DialogResult
override this.ShowForm : System.Windows.Forms.IWin32Window -> System.Windows.Forms.DialogResult

Parameters
owner IWin32Window IWin32Window
The IWin32Window to own the dialog.
Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned from the dialog box.
See DialogResultDialogResult
Also

ShowForm(IWin32Window, Int32) ShowForm(IWin32Window,


Int32)
Shows the form and the specified page with the specified owner.
public virtual System.Windows.Forms.DialogResult ShowForm (System.Windows.Forms.IWin32Window owner,
int page);
abstract member ShowForm : System.Windows.Forms.IWin32Window * int ->
System.Windows.Forms.DialogResult
override this.ShowForm : System.Windows.Forms.IWin32Window * int ->
System.Windows.Forms.DialogResult

Parameters
owner IWin32Window IWin32Window
The IWin32Window to own the dialog.
page Int32 Int32
The index of the page to show.
Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned from the dialog box.
See DialogResultDialogResult
Also
ComponentEditorPage ComponentEditorPage Class
Provides a base implementation for a ComponentEditorPage.

D eclaration
[System.Runtime.InteropServices.ComVisible(true)]
[System.Runtime.InteropServices.ClassInterface(System.Runtime.InteropServices.ClassInterfaceType
.AutoDispatch)]
public abstract class ComponentEditorPage : System.Windows.Forms.Panel
type ComponentEditorPage = class
inherit Panel

I nheritance H ierarchy
Object Object
MarshalByRefObject MarshalByRefObject
Component Component
Control Control
ScrollableControl ScrollableControl
Panel Panel

Remarks
The ComponentEditorPage class is a complete implementation for a component editor page that consists of an empty
window. You can extend this page to add your own controls. ComponentEditorPage is used by a
ComponentEditorForm of a WindowsFormsComponentEditor.

Constructors
ComponentEditorPage()
ComponentEditorPage()

Initializes a new instance of the ComponentEditorPage class.

Properties
AutoSize
AutoSize

This property is not relevant for this class.

CommitOnDeactivate
CommitOnDeactivate

Specifies whether the editor should apply its changes before it is deactivated.

Component
Component

Gets or sets the component to edit.


CreateParams
CreateParams

Gets the creation parameters for the control.

FirstActivate
FirstActivate

Gets or sets a value indicating whether the page is being activated for the first time.

Icon
Icon

Gets or sets the icon for the page.

Loading
Loading

Indicates how many load dependencies remain until loading has been completed.

LoadRequired
LoadRequired

Gets or sets a value indicating whether a component must be loaded before editing can occur.

PageSite
PageSite

Gets or sets the page site.

Title
Title

Gets the title of the page.

Methods
Activate()
Activate()

Activates and displays the page.

ApplyChanges()
ApplyChanges()

Applies changes to all the components being edited.


Deactivate()
Deactivate()

Deactivates and hides the page.

EnterLoadingMode()
EnterLoadingMode()

Increments the loading counter.

ExitLoadingMode()
ExitLoadingMode()

Decrements the loading counter.

GetControl()
GetControl()

Gets the control that represents the window for this page.

GetSelectedComponent()
GetSelectedComponent()

Gets the component that is to be edited.

IsFirstActivate()
IsFirstActivate()

Gets a value indicating whether the page is being activated for the first time.

IsLoading()
IsLoading()

Gets a value indicating whether the page is being loaded.

IsPageMessage(Message)
IsPageMessage(Message)

Processes messages that could be handled by the page.

LoadComponent()
LoadComponent()

Loads the component into the page user interface (UI).


OnApplyComplete()
OnApplyComplete()

Called when the page and any sibling pages have applied their changes.

ReloadComponent()
ReloadComponent()

Reloads the component for the page.

SaveComponent()
SaveComponent()

Saves the component from the page user interface (UI).

SetComponent(IComponent)
SetComponent(IComponent)

Sets the component to be edited.

SetDirty()
SetDirty()

Sets the page as changed since the last load or save.

SetSite(IComponentEditorPageSite)
SetSite(IComponentEditorPageSite)

Sets the site for this page.

ShowHelp()
ShowHelp()

Shows Help information if the page supports Help information.

SupportsHelp()
SupportsHelp()

Gets a value indicating whether the editor supports Help.

Events
AutoSizeChanged
AutoSizeChanged

This event is not relevant for this class.


ComponentEditorPage.Activate ComponentEditorPage.
Activate
I n this Article
Activates and displays the page.

public virtual void Activate ();


abstract member Activate : unit -> unit
override this.Activate : unit -> unit
ComponentEditorPage.ApplyChanges ComponentEditor
Page.ApplyChanges
I n this Article
Applies changes to all the components being edited.

public virtual void ApplyChanges ();


abstract member ApplyChanges : unit -> unit
override this.ApplyChanges : unit -> unit
ComponentEditorPage.AutoSize ComponentEditorPage.
AutoSize
I n this Article
This property is not relevant for this class.

[System.ComponentModel.Browsable(false)]
public override bool AutoSize { get; set; }
member this.AutoSize : bool with get, set

Returns
Boolean Boolean
true if enabled; otherwise, false .
Attributes BrowsableAttribute
ComponentEditorPage.AutoSizeChanged Component
EditorPage.AutoSizeChanged
I n this Article
This event is not relevant for this class.

[System.ComponentModel.Browsable(false)]
public event EventHandler AutoSizeChanged;
member this.AutoSizeChanged : EventHandler

Attributes BrowsableAttribute
ComponentEditorPage.CommitOnDeactivate
ComponentEditorPage.CommitOnDeactivate
I n this Article
Specifies whether the editor should apply its changes before it is deactivated.

public bool CommitOnDeactivate { get; set; }


member this.CommitOnDeactivate : bool with get, set

Returns
Boolean Boolean
true if the editor should apply its changes; otherwise, false .

Remarks
The standard implementation returns false .
ComponentEditorPage.Component ComponentEditor
Page.Component
I n this Article
Gets or sets the component to edit.

protected System.ComponentModel.IComponent Component { get; set; }


member this.Component : System.ComponentModel.IComponent with get, set

Returns
IComponent IComponent
The IComponent this page allows you to edit.
ComponentEditorPage
I n this Article
Initializes a new instance of the ComponentEditorPage class.
public ComponentEditorPage ();
ComponentEditorPage.CreateParams ComponentEditor
Page.CreateParams
I n this Article
Gets the creation parameters for the control.

protected override System.Windows.Forms.CreateParams CreateParams { get; }


member this.CreateParams : System.Windows.Forms.CreateParams

Returns
CreateParams CreateParams
A CreateParams that indicates the creation parameters for the control.
See ControlControl
Also
ComponentEditorPage.Deactivate ComponentEditor
Page.Deactivate
I n this Article
Deactivates and hides the page.

public virtual void Deactivate ();


abstract member Deactivate : unit -> unit
override this.Deactivate : unit -> unit
ComponentEditorPage.EnterLoadingMode Component
EditorPage.EnterLoadingMode
I n this Article
Increments the loading counter.

protected void EnterLoadingMode ();


member this.EnterLoadingMode : unit -> unit

Remarks
Each procedure that performs loading or initialization should first call the EnterLoadingMode method to indicate that it
will load something before the editor can display the loaded editor page. When a loading procedure that called
EnterLoadingMode completes, it should call the ExitLoadingMode method to indicate that its part of the load process
is completed.
The Loading property is used as a counter to determine when loading is complete. A page is in loading mode if the
value of the Loading property is non-zero.
ComponentEditorPage.ExitLoadingMode Component
EditorPage.ExitLoadingMode
I n this Article
Decrements the loading counter.

protected void ExitLoadingMode ();


member this.ExitLoadingMode : unit -> unit

Remarks
Each procedure that performs loading or initialization should first call the EnterLoadingMode method to indicate that it
will load something before the editor can display the loaded editor page. When a loading procedure that called
EnterLoadingMode completes, it should call the ExitLoadingMode method to indicate that its part of the load process
is completed.
The Loading property is used as a counter to determine when loading is complete. A page is in loading mode if the
value of the Loading property is non-zero.
ComponentEditorPage.FirstActivate ComponentEditor
Page.FirstActivate
I n this Article
Gets or sets a value indicating whether the page is being activated for the first time.

protected bool FirstActivate { get; set; }


member this.FirstActivate : bool with get, set

Returns
Boolean Boolean
true if the page has not previously been activated; otherwise, false .
ComponentEditorPage.GetControl ComponentEditor
Page.GetControl
I n this Article
Gets the control that represents the window for this page.

public virtual System.Windows.Forms.Control GetControl ();


abstract member GetControl : unit -> System.Windows.Forms.Control
override this.GetControl : unit -> System.Windows.Forms.Control

Returns
Control Control
The Control that represents the window for this page.
ComponentEditorPage.GetSelectedComponent
ComponentEditorPage.GetSelectedComponent
I n this Article
Gets the component that is to be edited.

protected System.ComponentModel.IComponent GetSelectedComponent ();


member this.GetSelectedComponent : unit -> System.ComponentModel.IComponent

Returns
IComponent IComponent
The IComponent that is to be edited.
ComponentEditorPage.Icon ComponentEditorPage.Icon
I n this Article
Gets or sets the icon for the page.
public System.Drawing.Icon Icon { get; set; }
member this.Icon : System.Drawing.Icon with get, set

Returns
Icon Icon
An Icon used to represent the page.
ComponentEditorPage.IsFirstActivate ComponentEditor
Page.IsFirstActivate
I n this Article
Gets a value indicating whether the page is being activated for the first time.

protected bool IsFirstActivate ();


member this.IsFirstActivate : unit -> bool

Returns
Boolean Boolean
true if this is the first time the page is being activated; otherwise, false .
ComponentEditorPage.IsLoading ComponentEditorPage.
IsLoading
I n this Article
Gets a value indicating whether the page is being loaded.

protected bool IsLoading ();


member this.IsLoading : unit -> bool

Returns
Boolean Boolean
true if the page is being loaded; otherwise, false .
ComponentEditorPage.IsPageMessage ComponentEditor
Page.IsPageMessage
I n this Article
Processes messages that could be handled by the page.

public virtual bool IsPageMessage (ref System.Windows.Forms.Message msg);


abstract member IsPageMessage : -> bool
override this.IsPageMessage : -> bool

Parameters
msg Message Message
The message to process.
Returns
Boolean Boolean
true if the page processed the message; otherwise, false .

Remarks
This method gives the page a chance to process messages before the caller uses them. If this returns true , the
message will be consumed; otherwise, the caller will continue to process the message.
ComponentEditorPage.LoadComponent Component
EditorPage.LoadComponent
I n this Article
Loads the component into the page user interface (UI).

protected abstract void LoadComponent ();


abstract member LoadComponent : unit -> unit
ComponentEditorPage.Loading ComponentEditorPage.
Loading
I n this Article
Indicates how many load dependencies remain until loading has been completed.

protected int Loading { get; set; }


member this.Loading : int with get, set

Returns
Int32 Int32
The number of remaining load dependencies.

Remarks
This property is used to track the number of loading stages remaining. For each process needed to completely load the
document, this counter is incremented before loading begins, and decremented when each loading process completes.
ComponentEditorPage.LoadRequired ComponentEditor
Page.LoadRequired
I n this Article
Gets or sets a value indicating whether a component must be loaded before editing can occur.

protected bool LoadRequired { get; set; }


member this.LoadRequired : bool with get, set

Returns
Boolean Boolean
true if a component must be loaded before editing can occur; otherwise, false .
ComponentEditorPage.OnApplyComplete Component
EditorPage.OnApplyComplete
I n this Article
Called when the page and any sibling pages have applied their changes.

public virtual void OnApplyComplete ();


abstract member OnApplyComplete : unit -> unit
override this.OnApplyComplete : unit -> unit
ComponentEditorPage.PageSite ComponentEditorPage.
PageSite
I n this Article
Gets or sets the page site.

protected System.Windows.Forms.IComponentEditorPageSite PageSite { get; set; }


member this.PageSite : System.Windows.Forms.IComponentEditorPageSite with get, set

Returns
IComponentEditorPageSite IComponentEditorPageSite
The page site.

Remarks
The site for this component editor page.
ComponentEditorPage.ReloadComponent Component
EditorPage.ReloadComponent
I n this Article
Reloads the component for the page.

protected virtual void ReloadComponent ();


abstract member ReloadComponent : unit -> unit
override this.ReloadComponent : unit -> unit

Remarks
This method is called when the current component may have changed elsewhere and needs to be reloaded into the
user interface (UI).
ComponentEditorPage.SaveComponent Component
EditorPage.SaveComponent
I n this Article
Saves the component from the page user interface (UI).

protected abstract void SaveComponent ();


abstract member SaveComponent : unit -> unit
ComponentEditorPage.SetComponent ComponentEditor
Page.SetComponent
I n this Article
Sets the component to be edited.

public virtual void SetComponent (System.ComponentModel.IComponent component);


abstract member SetComponent : System.ComponentModel.IComponent -> unit
override this.SetComponent : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to be edited.
ComponentEditorPage.SetDirty ComponentEditorPage.
SetDirty
I n this Article
Sets the page as changed since the last load or save.

protected virtual void SetDirty ();


abstract member SetDirty : unit -> unit
override this.SetDirty : unit -> unit
ComponentEditorPage.SetSite ComponentEditorPage.
SetSite
I n this Article
Sets the site for this page.

public virtual void SetSite (System.Windows.Forms.IComponentEditorPageSite site);


abstract member SetSite : System.Windows.Forms.IComponentEditorPageSite -> unit
override this.SetSite : System.Windows.Forms.IComponentEditorPageSite -> unit

Parameters
site IComponentEditorPageSite IComponentEditorPageSite
The site for this page.
ComponentEditorPage.ShowHelp ComponentEditor
Page.ShowHelp
I n this Article
Shows Help information if the page supports Help information.

public virtual void ShowHelp ();


abstract member ShowHelp : unit -> unit
override this.ShowHelp : unit -> unit

Remarks
This is only called if SupportsHelp returns true . The Help system calls the ShowHelp method to provide Help for the
page. ShowHelp is usually called in response to F1 or when the Help button is clicked to allow the page to bring up its
associated Help topic.
ComponentEditorPage.SupportsHelp ComponentEditor
Page.SupportsHelp
I n this Article
Gets a value indicating whether the editor supports Help.

public virtual bool SupportsHelp ();


abstract member SupportsHelp : unit -> bool
override this.SupportsHelp : unit -> bool

Returns
Boolean Boolean
true if the editor supports Help; otherwise, false . The default implementation returns false .
ComponentEditorPage.Title ComponentEditorPage.Title
I n this Article
Gets the title of the page.
public virtual string Title { get; }
member this.Title : string

Returns
String String
The title of the page.

Remarks
The caller may use this to show the name of this editor before it's actually activated.
ComponentTray ComponentTray Class
Provides behavior for the component tray of a designer.

D eclaration
public class ComponentTray : System.Windows.Forms.ScrollableControl,
System.ComponentModel.IExtenderProvider
type ComponentTray = class
inherit ScrollableControl
interface IExtenderProvider

I nheritance H ierarchy
Object Object
MarshalByRefObject MarshalByRefObject
Component Component
Control Control
ScrollableControl ScrollableControl

Remarks
The component tray represents components that do not otherwise provide a visible surface at design time and
provides a way for users to access and set the properties of those components.
Some types of components, such as a Timer, may not have a user interface that can be viewed at design time. These
components are usually represented by icons that are shown in the component tray.
The component tray is a rectangular region displayed at the bottom of the design view window while in design view
mode, once it is active. The component tray becomes active in design view after a component that is displayed in the
component tray has been added to or is part of the current document.

Constructors
ComponentTray(IDesigner, IServiceProvider)
ComponentTray(IDesigner, IServiceProvider)

Initializes a new instance of the ComponentTray class using the specified designer and service provider.

Properties
AutoArrange
AutoArrange

Gets or sets a value indicating whether the tray items are automatically aligned.

ComponentCount
ComponentCount

Gets the number of components contained in the tray.


ShowLargeIcons
ShowLargeIcons

Gets or sets a value indicating whether the tray displays a large icon to represent each component in the tray.

Methods
AddComponent(IComponent)
AddComponent(IComponent)

Adds a component to the tray.

CanCreateComponentFromTool(ToolboxItem)
CanCreateComponentFromTool(ToolboxItem)

Gets a value indicating whether the specified tool can be used to create a new component.

CanDisplayComponent(IComponent)
CanDisplayComponent(IComponent)

Gets a value indicating whether the specified component can be displayed.

CreateComponentFromTool(ToolboxItem)
CreateComponentFromTool(ToolboxItem)

Creates a component from the specified toolbox item, adds the component to the current document, and displays
a representation for the component in the component tray.

DisplayError(Exception)
DisplayError(Exception)

Displays an error message to the user with information about the specified exception.

Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the ComponentTray and optionally releases the managed resources.

GetLocation(IComponent)
GetLocation(IComponent)

Gets the location of the specified component, relative to the upper-left corner of the component tray.

GetNextComponent(IComponent, Boolean)
GetNextComponent(IComponent, Boolean)
Similar to GetNextControl(Control, Boolean), this method returns the next component in the tray, given a starting
component.

GetService(Type)
GetService(Type)

Gets the requested service type.

GetTrayLocation(IComponent)
GetTrayLocation(IComponent)

Gets the value of the Location extender property.

IsTrayComponent(IComponent)
IsTrayComponent(IComponent)

Tests a component for presence in the component tray.

OnDoubleClick(EventArgs)
OnDoubleClick(EventArgs)

OnDragDrop(DragEventArgs)
OnDragDrop(DragEventArgs)

Called when an object that has been dragged is dropped on the component tray.

OnDragEnter(DragEventArgs)
OnDragEnter(DragEventArgs)

Called when an object is dragged over, and has entered the area over, the component tray.

OnDragLeave(EventArgs)
OnDragLeave(EventArgs)

Called when an object is dragged out of the area over the component tray.

OnDragOver(DragEventArgs)
OnDragOver(DragEventArgs)

Called when an object is dragged over the component tray.

OnGiveFeedback(GiveFeedbackEventArgs)
OnGiveFeedback(GiveFeedbackEventArgs)

Called during an OLE drag and drop operation to provide an opportunity for the component tray to give feedback
to the user about the results of dropping the object at a specific point.

OnLayout(LayoutEventArgs)
OnLayout(LayoutEventArgs)

Raises the Layout event.

OnLostCapture()
OnLostCapture()

Called when a mouse drag selection operation is canceled.

OnMouseDoubleClick(MouseEventArgs)
OnMouseDoubleClick(MouseEventArgs)

Called when the mouse is double clicked over the component tray.

OnMouseDown(MouseEventArgs)
OnMouseDown(MouseEventArgs)

Called when the mouse button is pressed.

OnMouseMove(MouseEventArgs)
OnMouseMove(MouseEventArgs)

Called when the mouse cursor position has changed.

OnMouseUp(MouseEventArgs)
OnMouseUp(MouseEventArgs)

Called when the mouse button has been released.

OnPaint(PaintEventArgs)
OnPaint(PaintEventArgs)

Called when the view for the component tray should be refreshed.

OnSetCursor()
OnSetCursor()

Called to set the mouse cursor.


RemoveComponent(IComponent)
RemoveComponent(IComponent)

Removes the specified component from the tray.

SetLocation(IComponent, Point)
SetLocation(IComponent, Point)

Sets the location of the specified component to the specified location.

SetTrayLocation(IComponent, Point)
SetTrayLocation(IComponent, Point)

Sets the value of the Location extender property.

WndProc(Message)
WndProc(Message)

Processes Windows messages.

IExtenderProvider.CanExtend(Object)
IExtenderProvider.CanExtend(Object)

For a description of this member, see CanExtend(Object).


ComponentTray.AddComponent ComponentTray.Add
Component
I n this Article
Adds a component to the tray.

public virtual void AddComponent (System.ComponentModel.IComponent component);


abstract member AddComponent : System.ComponentModel.IComponent -> unit
override this.AddComponent : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to add to the tray.
See RemoveComponent(IComponent)RemoveComponent(IComponent)
Also
ComponentTray.AutoArrange ComponentTray.Auto
Arrange
I n this Article
Gets or sets a value indicating whether the tray items are automatically aligned.

public bool AutoArrange { get; set; }


member this.AutoArrange : bool with get, set

Returns
Boolean Boolean
true if the tray items are automatically arranged; otherwise, false .
ComponentTray.CanCreateComponentFromTool
ComponentTray.CanCreateComponentFromTool
I n this Article
Gets a value indicating whether the specified tool can be used to create a new component.

[System.CLSCompliant(false)]
protected virtual bool CanCreateComponentFromTool (System.Drawing.Design.ToolboxItem tool);
abstract member CanCreateComponentFromTool : System.Drawing.Design.ToolboxItem -> bool
override this.CanCreateComponentFromTool : System.Drawing.Design.ToolboxItem -> bool

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to test.
Returns
Boolean Boolean
true if the specified tool can be used to create a component; otherwise, false .
Attributes CLSCompliantAttribute
ComponentTray.CanDisplayComponent ComponentTray.
CanDisplayComponent
I n this Article
Gets a value indicating whether the specified component can be displayed.

protected virtual bool CanDisplayComponent (System.ComponentModel.IComponent component);


abstract member CanDisplayComponent : System.ComponentModel.IComponent -> bool
override this.CanDisplayComponent : System.ComponentModel.IComponent -> bool

Parameters
component IComponent IComponent
The IComponent to test.
Returns
Boolean Boolean
true if the component can be displayed; otherwise, false .

Remarks
This method tests the specified component for the existence of a DesignTimeVisibleAttribute, which indicates whether
the component has a user interface that can be displayed.
ComponentTray.ComponentCount ComponentTray.
ComponentCount
I n this Article
Gets the number of components contained in the tray.

public int ComponentCount { get; }


member this.ComponentCount : int

Returns
Int32 Int32
The number of components in the tray.
ComponentTray ComponentTray
I n this Article
Initializes a new instance of the ComponentTray class using the specified designer and service provider.
public ComponentTray (System.ComponentModel.Design.IDesigner mainDesigner, IServiceProvider
serviceProvider);
new System.Windows.Forms.Design.ComponentTray : System.ComponentModel.Design.IDesigner *
IServiceProvider -> System.Windows.Forms.Design.ComponentTray

Parameters
mainDesigner IDesigner IDesigner
The IDesigner that is the main or document designer for the current project.
serviceProvider IServiceProvider IServiceProvider
An IServiceProvider that can be used to obtain design-time services.

Remarks
The component tray monitors component additions and removals and displays appropriate user interface objects to
represent the components it contains.
ComponentTray.CreateComponentFromTool Component
Tray.CreateComponentFromTool
I n this Article
Creates a component from the specified toolbox item, adds the component to the current document, and displays a
representation for the component in the component tray.
[System.CLSCompliant(false)]
public void CreateComponentFromTool (System.Drawing.Design.ToolboxItem tool);
member this.CreateComponentFromTool : System.Drawing.Design.ToolboxItem -> unit

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component from.
Attributes CLSCompliantAttribute

Remarks
This method checks the item for an appropriate DesignTimeVisibleAttribute before attempting to create the
component and add it to the component tray.
ComponentTray.DisplayError ComponentTray.Display
Error
I n this Article
Displays an error message to the user with information about the specified exception.

protected void DisplayError (Exception e);


member this.DisplayError : Exception -> unit

Parameters
e Exception Exception
The exception about which to display information.
ComponentTray.Dispose ComponentTray.Dispose
I n this Article
Releases the unmanaged resources used by the ComponentTray and optionally releases the managed resources.
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true, this method releases all resources held by any managed objects that this
ComponentTray references. This method invokes the Dispose() method of each referenced object.
ComponentTray.GetLocation ComponentTray.Get
Location
I n this Article
Gets the location of the specified component, relative to the upper-left corner of the component tray.

[System.ComponentModel.Browsable(false)]
public System.Drawing.Point GetLocation (System.ComponentModel.IComponent receiver);
member this.GetLocation : System.ComponentModel.IComponent -> System.Drawing.Point

Parameters
receiver IComponent IComponent
The IComponent to retrieve the location of.
Returns
Point Point
A Point indicating the coordinates of the specified component, or an empty Point if the specified component could not
be found in the component tray. An empty Point has an IsEmpty property equal to true and typically has X and Y
properties that are each equal to zero.
Attributes BrowsableAttribute

Remarks
GetLocation is an accessor method for the location extender property that is added to each component in the
component tray.
ComponentTray.GetNextComponent ComponentTray.Get
NextComponent
I n this Article
Similar to GetNextControl(Control, Boolean), this method returns the next component in the tray, given a starting
component.
public System.ComponentModel.IComponent GetNextComponent (System.ComponentModel.IComponent
component, bool forward);
member this.GetNextComponent : System.ComponentModel.IComponent * bool ->
System.ComponentModel.IComponent

Parameters
component IComponent IComponent
The component from which to start enumerating.
forward Boolean Boolean
true to enumerate forward through the list; otherwise, false to enumerate backward.
Returns
IComponent IComponent
The next component in the component tray, or null , if the end of the list is encountered (or the beginning, if forward
is false ).
ComponentTray.GetService ComponentTray.GetService
I n this Article
Gets the requested service type.
protected override object GetService (Type serviceType);
override this.GetService : Type -> obj

Parameters
serviceType Type Type
The type of the service to retrieve.
Returns
Object Object
An instance of the requested service, or null if the service could not be found.
ComponentTray.GetTrayLocation ComponentTray.GetTray
Location
I n this Article
Gets the value of the Location extender property.

[System.ComponentModel.Browsable(false)]
public System.Drawing.Point GetTrayLocation (System.ComponentModel.IComponent receiver);
member this.GetTrayLocation : System.ComponentModel.IComponent -> System.Drawing.Point

Parameters
receiver IComponent IComponent
The IComponent that receives the location extender property.
Returns
Point Point
A Point representing the location of receiver .
Attributes BrowsableAttribute

Remarks
The Location extender property is offered to all non-visual components. The returned value takes into account the
value of AutoScrollPosition. If receiver does not have a component view, the returned value is an empty Point.
See GetLocation(IComponent)GetLocation(IComponent)
Also SetLocation(IComponent, Point)SetLocation(IComponent, Point)
SetTrayLocation(IComponent, Point)SetTrayLocation(IComponent, Point)
ComponentTray.IExtenderProvider.CanExtend
I n this Article
For a description of this member, see CanExtend(Object).
bool IExtenderProvider.CanExtend (object component);

Parameters
component Object
The Object to receive the extender properties.
Returns
Boolean
true if this object can provide extender properties to the specified object; otherwise, false .

Remarks
This member is an explicit interface member implementation. It can be used only when the ComponentTray instance is
cast to an IExtenderProvider interface.
ComponentTray.IsTrayComponent ComponentTray.IsTray
Component
I n this Article
Tests a component for presence in the component tray.

public bool IsTrayComponent (System.ComponentModel.IComponent comp);


member this.IsTrayComponent : System.ComponentModel.IComponent -> bool

Parameters
comp IComponent IComponent
The component to test for presence in the component tray.
Returns
Boolean Boolean
true if comp is being shown on the tray; otherwise, false .
ComponentTray.OnDoubleClick ComponentTray.On
DoubleClick
I n this Article
protected override void OnDoubleClick (EventArgs e);
override this.OnDoubleClick : EventArgs -> unit

Parameters
e EventArgs EventArgs
ComponentTray.OnDragDrop ComponentTray.OnDrag
Drop
I n this Article
Called when an object that has been dragged is dropped on the component tray.

protected override void OnDragDrop (System.Windows.Forms.DragEventArgs de);


override this.OnDragDrop : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ComponentTray.OnDragEnter ComponentTray.OnDrag
Enter
I n this Article
Called when an object is dragged over, and has entered the area over, the component tray.

protected override void OnDragEnter (System.Windows.Forms.DragEventArgs de);


override this.OnDragEnter : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ComponentTray.OnDragLeave ComponentTray.OnDrag
Leave
I n this Article
Called when an object is dragged out of the area over the component tray.

protected override void OnDragLeave (EventArgs e);


override this.OnDragLeave : EventArgs -> unit

Parameters
e EventArgs EventArgs
An EventArgs that provides data for the event.
ComponentTray.OnDragOver ComponentTray.OnDrag
Over
I n this Article
Called when an object is dragged over the component tray.

protected override void OnDragOver (System.Windows.Forms.DragEventArgs de);


override this.OnDragOver : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ComponentTray.OnGiveFeedback ComponentTray.On
GiveFeedback
I n this Article
Called during an OLE drag and drop operation to provide an opportunity for the component tray to give feedback to
the user about the results of dropping the object at a specific point.
protected override void OnGiveFeedback (System.Windows.Forms.GiveFeedbackEventArgs gfevent);
override this.OnGiveFeedback : System.Windows.Forms.GiveFeedbackEventArgs -> unit

Parameters
gfevent GiveFeedbackEventArgs GiveFeedbackEventArgs
A GiveFeedbackEventArgs that provides data for the event.
ComponentTray.OnLayout ComponentTray.OnLayout
I n this Article
Raises the Layout event.
protected override void OnLayout (System.Windows.Forms.LayoutEventArgs levent);
override this.OnLayout : System.Windows.Forms.LayoutEventArgs -> unit

Parameters
levent LayoutEventArgs LayoutEventArgs
A LayoutEventArgs that contains the event data.
ComponentTray.OnLostCapture ComponentTray.OnLost
Capture
I n this Article
Called when a mouse drag selection operation is canceled.

protected virtual void OnLostCapture ();


abstract member OnLostCapture : unit -> unit
override this.OnLostCapture : unit -> unit
ComponentTray.OnMouseDoubleClick ComponentTray.
OnMouseDoubleClick
I n this Article
Called when the mouse is double clicked over the component tray.

protected override void OnMouseDoubleClick (System.Windows.Forms.MouseEventArgs e);


override this.OnMouseDoubleClick : System.Windows.Forms.MouseEventArgs -> unit

Parameters
e MouseEventArgs MouseEventArgs
An EventArgs that provides data for the event.
ComponentTray.OnMouseDown ComponentTray.On
MouseDown
I n this Article
Called when the mouse button is pressed.

protected override void OnMouseDown (System.Windows.Forms.MouseEventArgs e);


override this.OnMouseDown : System.Windows.Forms.MouseEventArgs -> unit

Parameters
e MouseEventArgs MouseEventArgs
A MouseEventArgs that provides data for the event.
ComponentTray.OnMouseMove ComponentTray.On
MouseMove
I n this Article
Called when the mouse cursor position has changed.

protected override void OnMouseMove (System.Windows.Forms.MouseEventArgs e);


override this.OnMouseMove : System.Windows.Forms.MouseEventArgs -> unit

Parameters
e MouseEventArgs MouseEventArgs
A MouseEventArgs that provides data for the event.
ComponentTray.OnMouseUp ComponentTray.OnMouse
Up
I n this Article
Called when the mouse button has been released.

protected override void OnMouseUp (System.Windows.Forms.MouseEventArgs e);


override this.OnMouseUp : System.Windows.Forms.MouseEventArgs -> unit

Parameters
e MouseEventArgs MouseEventArgs
A MouseEventArgs that provides data for the event.
ComponentTray.OnPaint ComponentTray.OnPaint
I n this Article
Called when the view for the component tray should be refreshed.
protected override void OnPaint (System.Windows.Forms.PaintEventArgs pe);
override this.OnPaint : System.Windows.Forms.PaintEventArgs -> unit

Parameters
pe PaintEventArgs PaintEventArgs
A PaintEventArgs that provides data for the event.
ComponentTray.OnSetCursor ComponentTray.OnSet
Cursor
I n this Article
Called to set the mouse cursor.

protected virtual void OnSetCursor ();


abstract member OnSetCursor : unit -> unit
override this.OnSetCursor : unit -> unit
ComponentTray.RemoveComponent ComponentTray.
RemoveComponent
I n this Article
Removes the specified component from the tray.

public virtual void RemoveComponent (System.ComponentModel.IComponent component);


abstract member RemoveComponent : System.ComponentModel.IComponent -> unit
override this.RemoveComponent : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to remove from the tray.
See AddComponent(IComponent)AddComponent(IComponent)
Also
ComponentTray.SetLocation ComponentTray.SetLocation
I n this Article
Sets the location of the specified component to the specified location.
public void SetLocation (System.ComponentModel.IComponent receiver, System.Drawing.Point location);
member this.SetLocation : System.ComponentModel.IComponent * System.Drawing.Point -> unit

Parameters
receiver IComponent IComponent
The IComponent to set the location of.
location Point Point
A Point indicating the new location for the specified component.
ComponentTray.SetTrayLocation ComponentTray.SetTray
Location
I n this Article
Sets the value of the Location extender property.

public void SetTrayLocation (System.ComponentModel.IComponent receiver, System.Drawing.Point


location);
member this.SetTrayLocation : System.ComponentModel.IComponent * System.Drawing.Point -> unit

Parameters
receiver IComponent IComponent
The IComponent that receives the location extender property.
location Point Point
A Point representing the location of receiver .

Remarks
The Location extender property is offered to all non-visual components. The actual value takes into account the value
of AutoScrollPosition.
See GetTrayLocation(IComponent)GetTrayLocation(IComponent)
Also GetLocation(IComponent)GetLocation(IComponent)
SetLocation(IComponent, Point)SetLocation(IComponent, Point)
ComponentTray.ShowLargeIcons ComponentTray.Show
LargeIcons
I n this Article
Gets or sets a value indicating whether the tray displays a large icon to represent each component in the tray.

public bool ShowLargeIcons { get; set; }


member this.ShowLargeIcons : bool with get, set

Returns
Boolean Boolean
true if large icons are displayed; otherwise, false .
ComponentTray.WndProc ComponentTray.WndProc
I n this Article
Processes Windows messages.
protected override void WndProc (ref System.Windows.Forms.Message m);
override this.WndProc : -> unit

Parameters
m Message Message
The Message to process.
ControlDesigner ControlDesigner Class
Extends the design mode behavior of a Control.

D eclaration
[System.CLSCompliant(false)]
public class ControlDesigner : System.ComponentModel.Design.ComponentDesigner
type ControlDesigner = class
inherit ComponentDesigner

I nheritance H ierarchy
Object Object
ComponentDesigner ComponentDesigner

Remarks
ControlDesigner provides a base class for designers of components that derive from 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.
You can associate a designer with a type using a DesignerAttribute. For an overview of customizing design time
behavior, see Extending Design-Time Support.

Constructors
ControlDesigner()
ControlDesigner()

Initializes a new instance of the ControlDesigner class.

Fields
accessibilityObj
accessibilityObj

Specifies the accessibility object for the designer.

InvalidPoint
InvalidPoint

Defines a local Point that represents the values of an invalid Point.

Properties
AccessibilityObject
AccessibilityObject

Gets the AccessibleObject assigned to the control.


AssociatedComponents
AssociatedComponents

Gets the collection of components associated with the component managed by the designer.

AutoResizeHandles
AutoResizeHandles

Gets or sets a value indicating whether resize handle allocation depends on the value of the AutoSize property.

BehaviorService
BehaviorService

Gets the BehaviorService from the design environment.

Control
Control

Gets the control that the designer is designing.

EnableDragRect
EnableDragRect

Gets a value indicating whether drag rectangles can be drawn on this designer component.

InheritanceAttribute
InheritanceAttribute

Gets the InheritanceAttribute of the designer.

ParentComponent
ParentComponent

Gets the parent component for the ControlDesigner.

ParticipatesWithSnapLines
ParticipatesWithSnapLines

Gets a value indicating whether the ControlDesigner will allow snapline alignment during a drag operation.

SelectionRules
SelectionRules

Gets the selection rules that indicate the movement capabilities of a component.
SnapLines
SnapLines

Gets a list of SnapLine objects representing significant alignment points for this control.

Methods
BaseWndProc(Message)
BaseWndProc(Message)

Processes Windows messages.

CanBeParentedTo(IDesigner)
CanBeParentedTo(IDesigner)

Indicates if this designer's control can be parented by the control of the specified designer.

DefWndProc(Message)
DefWndProc(Message)

Provides default processing for Windows messages.

DisplayError(Exception)
DisplayError(Exception)

Displays information about the specified exception to the user.

Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the ControlDesigner and optionally releases the managed resources.

EnableDesignMode(Control, String)
EnableDesignMode(Control, String)

Enables design time functionality for a child control.

EnableDragDrop(Boolean)
EnableDragDrop(Boolean)

Enables or disables drag-and-drop support for the control being designed.

GetControlGlyph(GlyphSelectionType)
GetControlGlyph(GlyphSelectionType)

Returns a ControlBodyGlyph representing the bounds of this control.


GetGlyphs(GlyphSelectionType)
GetGlyphs(GlyphSelectionType)

Gets a collection of Glyph objects representing the selection borders and grab handles for a standard control.

GetHitTest(Point)
GetHitTest(Point)

Indicates whether a mouse click at the specified point should be handled by the control.

HookChildControls(Control)
HookChildControls(Control)

Routes messages from the child controls of the specified control to the designer.

Initialize(IComponent)
Initialize(IComponent)

Initializes the designer with the specified component.

InitializeExistingComponent(IDictionary)
InitializeExistingComponent(IDictionary)

Re-initializes an existing component.

InitializeNewComponent(IDictionary)
InitializeNewComponent(IDictionary)

Initializes a newly created component.

InitializeNonDefault()
InitializeNonDefault()

InternalControlDesigner(Int32)
InternalControlDesigner(Int32)

Returns the internal control designer with the specified index in the ControlDesigner.

NumberOfInternalControlDesigners()
NumberOfInternalControlDesigners()

Returns the number of internal control designers in the ControlDesigner.


OnContextMenu(Int32, Int32)
OnContextMenu(Int32, Int32)

Shows the context menu and provides an opportunity to perform additional processing when the context menu is
about to be displayed.

OnCreateHandle()
OnCreateHandle()

Provides an opportunity to perform additional processing immediately after the control handle has been created.

OnDragComplete(DragEventArgs)
OnDragComplete(DragEventArgs)

Receives a call to clean up a drag-and-drop operation.

OnDragDrop(DragEventArgs)
OnDragDrop(DragEventArgs)

Receives a call when a drag-and-drop object is dropped onto the control designer view.

OnDragEnter(DragEventArgs)
OnDragEnter(DragEventArgs)

Receives a call when a drag-and-drop operation enters the control designer view.

OnDragLeave(EventArgs)
OnDragLeave(EventArgs)

Receives a call when a drag-and-drop operation leaves the control designer view.

OnDragOver(DragEventArgs)
OnDragOver(DragEventArgs)

Receives a call when a drag-and-drop object is dragged over the control designer view.

OnGiveFeedback(GiveFeedbackEventArgs)
OnGiveFeedback(GiveFeedbackEventArgs)

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.

OnMouseDragBegin(Int32, Int32)
OnMouseDragBegin(Int32, Int32)

Receives a call in response to the left mouse button being pressed and held while over the component.
OnMouseDragEnd(Boolean)
OnMouseDragEnd(Boolean)

Receives a call at the end of a drag-and-drop operation to complete or cancel the operation.

OnMouseDragMove(Int32, Int32)
OnMouseDragMove(Int32, Int32)

Receives a call for each movement of the mouse during a drag-and-drop operation.

OnMouseEnter()
OnMouseEnter()

Receives a call when the mouse first enters the control.

OnMouseHover()
OnMouseHover()

Receives a call after the mouse hovers over the control.

OnMouseLeave()
OnMouseLeave()

Receives a call when the mouse first enters the control.

OnPaintAdornments(PaintEventArgs)
OnPaintAdornments(PaintEventArgs)

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.

OnSetComponentDefaults()
OnSetComponentDefaults()

Called when the designer is intialized.

OnSetCursor()
OnSetCursor()

Receives a call each time the cursor needs to be set.

PreFilterProperties(IDictionary)
PreFilterProperties(IDictionary)

Adjusts the set of properties the component exposes through a TypeDescriptor.

UnhookChildControls(Control)
UnhookChildControls(Control)

Routes messages for the children of the specified control to each control rather than to a parent designer.

WndProc(Message)
WndProc(Message)

Processes Windows messages and optionally routes them to the control.

See Also
ComponentDesigner ComponentDesigner
IDesigner IDesigner
ComponentDesigner ComponentDesigner
ControlDesigner.accessibilityObj Control
Designer.accessibilityObj
I n this Article
Specifies the accessibility object for the designer.

protected System.Windows.Forms.AccessibleObject accessibilityObj;


val mutable accessibilityObj : System.Windows.Forms.AccessibleObject

Returns
AccessibleObject AccessibleObject

Remarks
The default value is null .
See AccessibleObjectAccessibleObject
Also
ControlDesigner.AccessibilityObject ControlDesigner.
AccessibilityObject
I n this Article
Gets the AccessibleObject assigned to the control.

public virtual System.Windows.Forms.AccessibleObject AccessibilityObject { get; }


member this.AccessibilityObject : System.Windows.Forms.AccessibleObject

Returns
AccessibleObject AccessibleObject
The AccessibleObject assigned to the control.

Remarks
For more information about accessible objects, see the Active Accessibility section of the MSDN Library.
See AccessibleObjectAccessibleObject
Also
ControlDesigner.AssociatedComponents Control
Designer.AssociatedComponents
I n this Article
Gets the collection of components associated with the component managed by the designer.

public override System.Collections.ICollection AssociatedComponents { get; }


member this.AssociatedComponents : System.Collections.ICollection

Returns
ICollection ICollection
The components that are associated with the component managed by the designer.

Remarks
This property indicates any components to copy or move along with the component managed by the designer during a
copy, drag, or move operation.
If this collection contains references to other components in the current design mode document, those components will
be copied along with the component managed by the designer during a copy operation.
When the component managed by the designer is selected, this collection is filled with any nested controls. This
collection can also include other components, such as the buttons of a toolbar.
ControlDesigner.AutoResizeHandles ControlDesigner.
AutoResizeHandles
I n this Article
Gets or sets a value indicating whether resize handle allocation depends on the value of the AutoSize property.

public bool AutoResizeHandles { get; set; }


member this.AutoResizeHandles : bool with get, set

Returns
Boolean Boolean
true if resize handle allocation depends on the value of the AutoSize and AutoSizeMode properties; otherwise, false .
The default is false .
ControlDesigner.BaseWndProc ControlDesigner.BaseWnd
Proc
I n this Article
Processes Windows messages.

protected void BaseWndProc (ref System.Windows.Forms.Message m);


member this.BaseWndProc : -> unit

Parameters
m Message Message
The Message to process.

Remarks
This method causes the message to be processed by Windows, skipping the control. This is useful if you want to block
the message from getting to the control, but you do not want to block it from getting to Windows itself because it can
cause other messages to be generated.
ControlDesigner.BehaviorService ControlDesigner.
BehaviorService
I n this Article
Gets the BehaviorService from the design environment.

protected System.Windows.Forms.Design.Behavior.BehaviorService BehaviorService { get; }


member this.BehaviorService : System.Windows.Forms.Design.Behavior.BehaviorService

Returns
BehaviorService BehaviorService
The BehaviorService, or null if the service is unavailable.
ControlDesigner.CanBeParentedTo ControlDesigner.Can
BeParentedTo
I n this Article
Indicates if this designer's control can be parented by the control of the specified designer.

public virtual bool CanBeParentedTo (System.ComponentModel.Design.IDesigner parentDesigner);


abstract member CanBeParentedTo : System.ComponentModel.Design.IDesigner -> bool
override this.CanBeParentedTo : System.ComponentModel.Design.IDesigner -> bool

Parameters
parentDesigner IDesigner IDesigner
The IDesigner that manages the control to check.
Returns
Boolean Boolean
true if the control managed by the specified designer can parent the control managed by this designer; otherwise,
false .

Remarks
This method is useful for testing whether a control can be parented by a particular type of parent. For example,
TabPage controls can only be parented by TabControl controls.
Note

This method is not called when an item is dragged from the Toolbox onto the design surface.
ControlDesigner.Control ControlDesigner.Control
I n this Article
Gets the control that the designer is designing.
public virtual System.Windows.Forms.Control Control { get; }
member this.Control : System.Windows.Forms.Control

Returns
Control Control
The control that the designer is designing.
ControlDesigner
I n this Article
Initializes a new instance of the ControlDesigner class.
public ControlDesigner ();
ControlDesigner.DefWndProc ControlDesigner.DefWnd
Proc
I n this Article
Provides default processing for Windows messages.

protected void DefWndProc (ref System.Windows.Forms.Message m);


member this.DefWndProc : -> unit

Parameters
m Message Message
The Message to process.

Remarks
This method causes the message to be processed by the control, rather than by the designer.
See WndProc(Message)WndProc(Message)
Also
ControlDesigner.DisplayError ControlDesigner.Display
Error
I n this Article
Displays information about the specified exception to the user.

protected void DisplayError (Exception e);


member this.DisplayError : Exception -> unit

Parameters
e Exception Exception
The Exception to display.
ControlDesigner.Dispose ControlDesigner.Dispose
I n this Article
Releases the unmanaged resources used by the ControlDesigner and optionally releases the managed resources.
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true , this method releases all resources held by any managed objects that this
ControlDesigner references. This method invokes the Dispose() method of each referenced object.
See IDesignerIDesigner
Also
ControlDesigner.EnableDesignMode ControlDesigner.
EnableDesignMode
I n this Article
Enables design time functionality for a child control.

protected bool EnableDesignMode (System.Windows.Forms.Control child, string name);


member this.EnableDesignMode : System.Windows.Forms.Control * string -> bool

Parameters
child Control Control
The child control for which design mode will be enabled.
name String String
The name of child as exposed to the end user.

Returns
Boolean Boolean
true if the child control could be enabled for design time; false if the hosting infrastructure does not support it.
Exceptions
ArgumentNullException ArgumentNullException
child or name is null .

Remarks
The child control specified by child is a child of this control designer's control. The child does not directly participate
in persistence, but it will if it is exposed as a property of the main control. Consider a control like the SplitContainer: it
has two panels, Panel1 and Panel2 . These panels are exposed through read only Panel1 and Panel2 properties on the
SplitContainer control. The SplitContainer control's designer calls EnableDesignMode for each panel, which allows
other components to be dropped on them. But, in order for the contents of Panel1 and Panel2 to be saved, the
SplitContainer control itself must expose the panels as public properties.
Control names must be unique within a control designer, but they are not required to be unique with respect to the
children of other control designers.
To support this feature, the hosting infrastructure must expose the INestedContainer class as a service through the site.
ControlDesigner.EnableDragDrop ControlDesigner.
EnableDragDrop
I n this Article
Enables or disables drag-and-drop support for the control being designed.

protected void EnableDragDrop (bool value);


member this.EnableDragDrop : bool -> unit

Parameters
value Boolean Boolean
true to enable drag-and-drop support for the control; false if the control should not have drag-and-drop support.
The default is false .

Remarks
The default value of false specifies that a control cannot have children dragged onto it at design time. To allow a
control to parent other controls at design time, associate it with a designer that derives from ParentControlDesigner.
ControlDesigner.EnableDragRect ControlDesigner.Enable
DragRect
I n this Article
Gets a value indicating whether drag rectangles can be drawn on this designer component.

protected virtual bool EnableDragRect { get; }


member this.EnableDragRect : bool

Returns
Boolean Boolean
true if drag rectangles can be drawn; otherwise, false .
ControlDesigner.GetControlGlyph ControlDesigner.Get
ControlGlyph
I n this Article
Returns a ControlBodyGlyph representing the bounds of this control.

protected virtual System.Windows.Forms.Design.Behavior.ControlBodyGlyph GetControlGlyph


(System.Windows.Forms.Design.Behavior.GlyphSelectionType selectionType);
abstract member GetControlGlyph : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.ControlBodyGlyph
override this.GetControlGlyph : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.ControlBodyGlyph

Parameters
selectionType GlyphSelectionType GlyphSelectionType
A GlyphSelectionType value that specifies the selection state.
Returns
ControlBodyGlyph ControlBodyGlyph
A ControlBodyGlyph representing the bounds of this control.
ControlDesigner.GetGlyphs ControlDesigner.GetGlyphs
I n this Article
Gets a collection of Glyph objects representing the selection borders and grab handles for a standard control.
public virtual System.Windows.Forms.Design.Behavior.GlyphCollection GetGlyphs
(System.Windows.Forms.Design.Behavior.GlyphSelectionType selectionType);
abstract member GetGlyphs : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.GlyphCollection
override this.GetGlyphs : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.GlyphCollection

Parameters
selectionType GlyphSelectionType GlyphSelectionType
A GlyphSelectionType value that specifies the selection state.
Returns
GlyphCollection GlyphCollection
A collection of Glyph objects.

Remarks
Note that based on selectionType , the Glyph objects returned will represent one of these selection states:
A fully resizable selection border with grab handles;
A locked selection border;
A single 'hidden' selection Glyph.
ControlDesigner.GetHitTest ControlDesigner.GetHitTest
I n this Article
Indicates whether a mouse click at the specified point should be handled by the control.
protected virtual bool GetHitTest (System.Drawing.Point point);
abstract member GetHitTest : System.Drawing.Point -> bool
override this.GetHitTest : System.Drawing.Point -> bool

Parameters
point Point Point
A Point indicating the position at which the mouse was clicked, in screen coordinates.
Returns
Boolean Boolean
true if a click at the specified point is to be handled by the control; otherwise, false .

Remarks
The GetHitTest method determines whether a click at the specified point should be passed to the control, while the
control is in design mode. You can override and implement this method to enable your control to receive clicks in the
design-time environment.
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
The GetHitTest method is called in response to the WM_NCHITTEST message, so it is called on each mouse move.
ControlDesigner.HookChildControls ControlDesigner.
HookChildControls
I n this Article
Routes messages from the child controls of the specified control to the designer.

protected void HookChildControls (System.Windows.Forms.Control firstChild);


member this.HookChildControls : System.Windows.Forms.Control -> unit

Parameters
firstChild Control Control
The first child Control to process. This method may recursively call itself for children of the control.
ControlDesigner.InheritanceAttribute ControlDesigner.
InheritanceAttribute
I n this Article
Gets the InheritanceAttribute of the designer.

protected override System.ComponentModel.InheritanceAttribute InheritanceAttribute { get; }


member this.InheritanceAttribute : System.ComponentModel.InheritanceAttribute

Returns
InheritanceAttribute InheritanceAttribute
Inherited if the designer is a root designer; otherwise, the value of the parent designer's InheritanceAttribute property.
ControlDesigner.Initialize ControlDesigner.Initialize
I n this Article
Initializes the designer with the specified component.
public override void Initialize (System.ComponentModel.IComponent component);
override this.Initialize : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to associate the designer with. This component must always be an instance of, or derive from,
Control.

Remarks
This method is called by the designer host to initialize the designer.
See IDesignerIDesigner
Also
ControlDesigner.InitializeExistingComponent Control
Designer.InitializeExistingComponent
I n this Article
Re-initializes an existing component.

public override void InitializeExistingComponent (System.Collections.IDictionary defaultValues);


override this.InitializeExistingComponent : System.Collections.IDictionary -> unit

Parameters
defaultValues IDictionary IDictionary
A name/value dictionary of default values to apply to properties. May be null if no default values are specified.

Remarks
The ControlDesigner class overrides this method to handle after-drop cases.
ControlDesigner.InitializeNewComponent Control
Designer.InitializeNewComponent
I n this Article
Initializes a newly created component.

public override void InitializeNewComponent (System.Collections.IDictionary defaultValues);


override this.InitializeNewComponent : System.Collections.IDictionary -> unit

Parameters
defaultValues IDictionary IDictionary
A name/value dictionary of default values to apply to properties. May be null if no default values are specified.

Remarks
The ControlDesigner class overrides this method. It will look at the default property for the control and, if it is of type
string , it will set this property's value to the name of the component. It only does this if the designer has been
configured with this option in the options service. This method also connects the control to its parent and positions it. If
you override this method, you should always call base.
ControlDesigner.InitializeNonDefault ControlDesigner.
InitializeNonDefault
I n this Article
public override void InitializeNonDefault ();
override this.InitializeNonDefault : unit -> unit
ControlDesigner.InternalControlDesigner Control
Designer.InternalControlDesigner
I n this Article
Returns the internal control designer with the specified index in the ControlDesigner.

public virtual System.Windows.Forms.Design.ControlDesigner InternalControlDesigner (int


internalControlIndex);
abstract member InternalControlDesigner : int -> System.Windows.Forms.Design.ControlDesigner
override this.InternalControlDesigner : int -> System.Windows.Forms.Design.ControlDesigner

Parameters
internalControlIndex Int32 Int32
A specified index to select the internal control designer. This index is zero-based.
Returns
ControlDesigner ControlDesigner
A ControlDesigner at the specified index.

Remarks
An internal control is a control that is not in the Components collection of the Container. SplitterPanel is an example of
one such control.
ControlDesigner.InvalidPoint ControlDesigner.Invalid
Point
I n this Article
Defines a local Point that represents the values of an invalid Point.

protected static readonly System.Drawing.Point InvalidPoint;


staticval mutable InvalidPoint : System.Drawing.Point

Returns
Point Point

Remarks
InvalidPoint has an X and Y property set to the minimum value for the integer data type.
ControlDesigner.NumberOfInternalControlDesigners
ControlDesigner.NumberOfInternalControlDesigners
I n this Article
Returns the number of internal control designers in the ControlDesigner.

public virtual int NumberOfInternalControlDesigners ();


abstract member NumberOfInternalControlDesigners : unit -> int
override this.NumberOfInternalControlDesigners : unit -> int

Returns
Int32 Int32
The number of internal control designers in the ControlDesigner.

Remarks
An internal control is a control that is not in the Components collection of the Container. SplitterPanel is an example of
one such control.
ControlDesigner.OnContextMenu ControlDesigner.On
ContextMenu
I n this Article
Shows the context menu and provides an opportunity to perform additional processing when the context menu is
about to be displayed.
protected virtual void OnContextMenu (int x, int y);
abstract member OnContextMenu : int * int -> unit
override this.OnContextMenu : int * int -> unit

Parameters
x Int32 Int32
The x coordinate at which to display the context menu.
y Int32 Int32
The y coordinate at which to display the context menu.
ControlDesigner.OnCreateHandle ControlDesigner.On
CreateHandle
I n this Article
Provides an opportunity to perform additional processing immediately after the control handle has been created.

protected virtual void OnCreateHandle ();


abstract member OnCreateHandle : unit -> unit
override this.OnCreateHandle : unit -> unit
ControlDesigner.OnDragComplete ControlDesigner.On
DragComplete
I n this Article
Receives a call to clean up a drag-and-drop operation.

protected virtual void OnDragComplete (System.Windows.Forms.DragEventArgs de);


abstract member OnDragComplete : System.Windows.Forms.DragEventArgs -> unit
override this.OnDragComplete : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ControlDesigner.OnDragDrop ControlDesigner.OnDrag
Drop
I n this Article
Receives a call when a drag-and-drop object is dropped onto the control designer view.

protected virtual void OnDragDrop (System.Windows.Forms.DragEventArgs de);


abstract member OnDragDrop : System.Windows.Forms.DragEventArgs -> unit
override this.OnDragDrop : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ControlDesigner.OnDragEnter ControlDesigner.OnDrag
Enter
I n this Article
Receives a call when a drag-and-drop operation enters the control designer view.

protected virtual void OnDragEnter (System.Windows.Forms.DragEventArgs de);


abstract member OnDragEnter : System.Windows.Forms.DragEventArgs -> unit
override this.OnDragEnter : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ControlDesigner.OnDragLeave ControlDesigner.OnDrag
Leave
I n this Article
Receives a call when a drag-and-drop operation leaves the control designer view.

protected virtual void OnDragLeave (EventArgs e);


abstract member OnDragLeave : EventArgs -> unit
override this.OnDragLeave : EventArgs -> unit

Parameters
e EventArgs EventArgs
An EventArgs that provides data for the event.
ControlDesigner.OnDragOver ControlDesigner.OnDrag
Over
I n this Article
Receives a call when a drag-and-drop object is dragged over the control designer view.

protected virtual void OnDragOver (System.Windows.Forms.DragEventArgs de);


abstract member OnDragOver : System.Windows.Forms.DragEventArgs -> unit
override this.OnDragOver : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
ControlDesigner.OnGiveFeedback ControlDesigner.On
GiveFeedback
I n this Article
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.
protected virtual void OnGiveFeedback (System.Windows.Forms.GiveFeedbackEventArgs e);
abstract member OnGiveFeedback : System.Windows.Forms.GiveFeedbackEventArgs -> unit
override this.OnGiveFeedback : System.Windows.Forms.GiveFeedbackEventArgs -> unit

Parameters
e GiveFeedbackEventArgs GiveFeedbackEventArgs
A GiveFeedbackEventArgs that provides data for the event.

Remarks
The designer host calls this method when an OLE drag event occurs.
ControlDesigner.OnMouseDragBegin ControlDesigner.
OnMouseDragBegin
I n this Article
Receives a call in response to the left mouse button being pressed and held while over the component.

protected virtual void OnMouseDragBegin (int x, int y);


abstract member OnMouseDragBegin : int * int -> unit
override this.OnMouseDragBegin : int * int -> unit

Parameters
x Int32 Int32
The x position of the mouse in screen coordinates.
y Int32 Int32
The y position of the mouse in screen coordinates.

Remarks
This method is called at the start of a drag-and-drop operation.
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
ControlDesigner.OnMouseDragEnd ControlDesigner.On
MouseDragEnd
I n this Article
Receives a call at the end of a drag-and-drop operation to complete or cancel the operation.

protected virtual void OnMouseDragEnd (bool cancel);


abstract member OnMouseDragEnd : bool -> unit
override this.OnMouseDragEnd : bool -> unit

Parameters
cancel Boolean Boolean
true to cancel the drag; false to commit it.
ControlDesigner.OnMouseDragMove ControlDesigner.
OnMouseDragMove
I n this Article
Receives a call for each movement of the mouse during a drag-and-drop operation.

protected virtual void OnMouseDragMove (int x, int y);


abstract member OnMouseDragMove : int * int -> unit
override this.OnMouseDragMove : int * int -> unit

Parameters
x Int32 Int32
The x position of the mouse in screen coordinates.
y Int32 Int32
The y position of the mouse in screen coordinates.

Remarks
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
ControlDesigner.OnMouseEnter ControlDesigner.On
MouseEnter
I n this Article
Receives a call when the mouse first enters the control.

protected virtual void OnMouseEnter ();


abstract member OnMouseEnter : unit -> unit
override this.OnMouseEnter : unit -> unit
ControlDesigner.OnMouseHover ControlDesigner.On
MouseHover
I n this Article
Receives a call after the mouse hovers over the control.

protected virtual void OnMouseHover ();


abstract member OnMouseHover : unit -> unit
override this.OnMouseHover : unit -> unit
ControlDesigner.OnMouseLeave ControlDesigner.On
MouseLeave
I n this Article
Receives a call when the mouse first enters the control.

protected virtual void OnMouseLeave ();


abstract member OnMouseLeave : unit -> unit
override this.OnMouseLeave : unit -> unit
ControlDesigner.OnPaintAdornments ControlDesigner.
OnPaintAdornments
I n this Article
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.
protected virtual void OnPaintAdornments (System.Windows.Forms.PaintEventArgs pe);
abstract member OnPaintAdornments : System.Windows.Forms.PaintEventArgs -> unit
override this.OnPaintAdornments : System.Windows.Forms.PaintEventArgs -> unit

Parameters
pe PaintEventArgs PaintEventArgs
A PaintEventArgs the designer can use to draw on the control.
ControlDesigner.OnSetComponentDefaults Control
Designer.OnSetComponentDefaults
I n this Article
Called when the designer is intialized.

[System.Obsolete("This method has been deprecated. Use InitializeNewComponent instead.


http://go.microsoft.com/fwlink/?linkid=14202")]
public override void OnSetComponentDefaults ();
override this.OnSetComponentDefaults : unit -> unit

Attributes ObsoleteAttribute
ControlDesigner.OnSetCursor ControlDesigner.OnSet
Cursor
I n this Article
Receives a call each time the cursor needs to be set.

protected virtual void OnSetCursor ();


abstract member OnSetCursor : unit -> unit
override this.OnSetCursor : unit -> unit

Remarks
This method handles redirection and handling of the set cursor event. If the toolbox service has a tool selected, this
method will allow the toolbox service to set the cursor. If the selection UI service has a locked selection, or if there is no
location property on the control, the default arrow cursor will be set. If a user is dragging a component, the crosshair
cursor will be set. Otherwise, a four headed arrow cursor will be set to indicate that the component can be clicked and
moved.
ControlDesigner.ParentComponent ControlDesigner.
ParentComponent
I n this Article
Gets the parent component for the ControlDesigner.

protected override System.ComponentModel.IComponent ParentComponent { get; }


member this.ParentComponent : System.ComponentModel.IComponent

Returns
IComponent IComponent
The parent component for the ControlDesigner; otherwise, null if there is no parent component.

Remarks
The default implementation simply checks to see if the component being designed is a control and if it is,
ParentComponent returns its parent.
ControlDesigner.ParticipatesWithSnapLines Control
Designer.ParticipatesWithSnapLines
I n this Article
Gets a value indicating whether the ControlDesigner will allow snapline alignment during a drag operation.

public virtual bool ParticipatesWithSnapLines { get; }


member this.ParticipatesWithSnapLines : bool

Returns
Boolean Boolean
true if the ControlDesigner will allow snapline alignment during a drag operation when the primary drag control is
over this designer; otherwise, false .
ControlDesigner.PreFilterProperties ControlDesigner.Pre
FilterProperties
I n this Article
Adjusts the set of properties the component exposes through a TypeDescriptor.

protected override void PreFilterProperties (System.Collections.IDictionary properties);


override this.PreFilterProperties : System.Collections.IDictionary -> unit

Parameters
properties IDictionary IDictionary
An IDictionary containing the properties for the class of the component.

Remarks
This IDesignerFilter interface method override adds a set of properties to this designer's component at design time.
This method adds the following browsable properties: Visible , Enabled , ContextMenu , AllowDrop , Location , Name ,
Controls , and Locked .
ControlDesigner.SelectionRules ControlDesigner.
SelectionRules
I n this Article
Gets the selection rules that indicate the movement capabilities of a component.

public virtual System.Windows.Forms.Design.SelectionRules SelectionRules { get; }


member this.SelectionRules : System.Windows.Forms.Design.SelectionRules

Returns
SelectionRules SelectionRules
A bitwise combination of SelectionRules values.

Remarks
If no designer provides rules for a component, the component will not get any UI services.
See SelectionRulesSelectionRules
Also
ControlDesigner.SnapLines ControlDesigner.SnapLines
I n this Article
Gets a list of SnapLine objects representing significant alignment points for this control.
public virtual System.Collections.IList SnapLines { get; }
member this.SnapLines : System.Collections.IList

Returns
IList IList
A list of SnapLine objects representing significant alignment points for this control.

Remarks
You can use the offered SnapLine objects to assist in positioning the control on a design surface.
ControlDesigner.UnhookChildControls ControlDesigner.
UnhookChildControls
I n this Article
Routes messages for the children of the specified control to each control rather than to a parent designer.

protected void UnhookChildControls (System.Windows.Forms.Control firstChild);


member this.UnhookChildControls : System.Windows.Forms.Control -> unit

Parameters
firstChild Control Control
The first child Control to process. This method may recursively call itself for children of the control.
ControlDesigner.WndProc ControlDesigner.WndProc
I n this Article
Processes Windows messages and optionally routes them to the control.
protected virtual void WndProc (ref System.Windows.Forms.Message m);
abstract member WndProc : -> unit
override this.WndProc : -> unit

Parameters
m Message Message
The Message to process.

Remarks
This method is called for each message the control would usually receive. This allows the designer to preprocess
messages before optionally routing them to the control.
To send the message to the control's Control.WndProc method, call WndProc on the control's designer.
Note

The designer filters messages, so some messages will not be sent to the control. For example, mouse messages are
intercepted by the designer. If this is not the behavior you want, call DefWndProc instead.
Pass m as a parameter. Optionally, you can alter or create a new System.Windows.Forms.Message to pass to the
control's method.
The following table shows the flow of messages.

W ITHO U T A D ES IG NER W ITH A D ES IG NER

USER32 USER32

Control.WndProc Control.Designer. WndProc

Control.DefWndProc DefWndProc
USER32 Control.WndProc

Control.DefWndProc

USER32

The designer intercepts messages by replacing the Control.WindowTarget property on the control. Usually,
WindowTarget points to the NativeWindow contained within the control. During design time, the designer replaces this
with its own window target, and caches the original value.
See DefWndProc(Message)DefWndProc(Message)
Also
ControlDesigner.ControlDesignerAccessibleObject
ControlDesigner.ControlDesignerAccessibleObject Class
Provides an AccessibleObject for ControlDesigner.

D eclaration
[System.Runtime.InteropServices.ComVisible(true)]
public class ControlDesigner.ControlDesignerAccessibleObject :
System.Windows.Forms.AccessibleObject
type ControlDesigner.ControlDesignerAccessibleObject = class
inherit AccessibleObject

I nheritance H ierarchy
Object Object
MarshalByRefObject MarshalByRefObject
AccessibleObject AccessibleObject

Constructors
ControlDesigner.ControlDesignerAccessibleObject(ControlDesigner, Control)
ControlDesigner.ControlDesignerAccessibleObject(ControlDesigner, Control)

Initializes a new instance of the ControlDesigner.ControlDesignerAccessibleObject class using the specified


designer and control.

Properties
Bounds
Bounds

Gets the points that define the boundaries of the accessible object for the designer.

DefaultAction
DefaultAction

Gets a string that describes the default action of the specified object.

Description
Description

Gets a string that describes the visual appearance of the specified object.

Name
Name

Gets or sets the object name.


Parent
Parent

Gets the parent of an accessible object.

Role
Role

Gets the role of this accessible object.

State
State

Gets the state of this accessible object.

Value
Value

Gets or sets the value of an accessible object.

Methods
GetChild(Int32)
GetChild(Int32)

Retrieves the accessible child corresponding to the specified index.

GetChildCount()
GetChildCount()

Retrieves the number of children belonging to an accessible object.

GetFocused()
GetFocused()

Retrieves the object that has the keyboard focus.

GetSelected()
GetSelected()

Retrieves the currently selected child.

HitTest(Int32, Int32)
HitTest(Int32, Int32)

Retrieves the child object at the specified screen coordinates.


ControlDesigner.ControlDesignerAccessibleObject.
Bounds ControlDesigner.ControlDesignerAccessible
Object.Bounds
I n this Article
Gets the points that define the boundaries of the accessible object for the designer.
public override System.Drawing.Rectangle Bounds { get; }
member this.Bounds : System.Drawing.Rectangle

Returns
Rectangle Rectangle
A Rectangle that indicates the boundaries of the accessible object for the designer.
See RectangleRectangle
Also
ControlDesigner.ControlDesignerAccessibleObject
ControlDesigner.ControlDesignerAccessibleObject
I n this Article
Initializes a new instance of the ControlDesigner.ControlDesignerAccessibleObject class using the specified designer
and control.
public ControlDesignerAccessibleObject (System.Windows.Forms.Design.ControlDesigner designer,
System.Windows.Forms.Control control);
new System.Windows.Forms.Design.ControlDesigner.ControlDesignerAccessibleObject :
System.Windows.Forms.Design.ControlDesigner * System.Windows.Forms.Control ->
System.Windows.Forms.Design.ControlDesigner.ControlDesignerAccessibleObject

Parameters
designer ControlDesigner ControlDesigner
The ControlDesigner for the accessible object.
control Control Control
The Control for the accessible object.
ControlDesigner.ControlDesignerAccessibleObject.
DefaultAction ControlDesigner.ControlDesigner
AccessibleObject.DefaultAction
I n this Article
Gets a string that describes the default action of the specified object.
public override string DefaultAction { get; }
member this.DefaultAction : string

Returns
String String
A description of the default action for a specified object.

Remarks
The current implementation returns an empty string value.
ControlDesigner.ControlDesignerAccessibleObject.
Description ControlDesigner.ControlDesignerAccessible
Object.Description
I n this Article
Gets a string that describes the visual appearance of the specified object.
public override string Description { get; }
member this.Description : string

Returns
String String
A description of the object's visual appearance to the user, or null if the object does not have a description.
ControlDesigner.ControlDesignerAccessibleObject.Get
Child ControlDesigner.ControlDesignerAccessibleObject.
GetChild
I n this Article
Retrieves the accessible child corresponding to the specified index.
public override System.Windows.Forms.AccessibleObject GetChild (int index);
override this.GetChild : int -> System.Windows.Forms.AccessibleObject

Parameters
index Int32 Int32
The zero-based index of the accessible child.
Returns
AccessibleObject AccessibleObject
An AccessibleObject that represents the accessible child corresponding to the specified index.
ControlDesigner.ControlDesignerAccessibleObject.Get
ChildCount ControlDesigner.ControlDesignerAccessible
Object.GetChildCount
I n this Article
Retrieves the number of children belonging to an accessible object.
public override int GetChildCount ();
override this.GetChildCount : unit -> int

Returns
Int32 Int32
The number of children belonging to an accessible object.
ControlDesigner.ControlDesignerAccessibleObject.Get
Focused ControlDesigner.ControlDesignerAccessible
Object.GetFocused
I n this Article
Retrieves the object that has the keyboard focus.
public override System.Windows.Forms.AccessibleObject GetFocused ();
override this.GetFocused : unit -> System.Windows.Forms.AccessibleObject

Returns
AccessibleObject AccessibleObject
An AccessibleObject that specifies the currently focused child. This method returns the calling object if the object itself
is focused. Returns null if no object has focus.
ControlDesigner.ControlDesignerAccessibleObject.Get
Selected ControlDesigner.ControlDesignerAccessible
Object.GetSelected
I n this Article
Retrieves the currently selected child.
public override System.Windows.Forms.AccessibleObject GetSelected ();
override this.GetSelected : unit -> System.Windows.Forms.AccessibleObject

Returns
AccessibleObject AccessibleObject
An AccessibleObject that represents the currently selected child. This method returns the calling object if the object
itself is selected. Returns null if is no child is currently selected and the object itself does not have focus.
ControlDesigner.ControlDesignerAccessibleObject.HitTest
ControlDesigner.ControlDesignerAccessibleObject.HitTest
I n this Article
Retrieves the child object at the specified screen coordinates.

public override System.Windows.Forms.AccessibleObject HitTest (int x, int y);


override this.HitTest : int * int -> System.Windows.Forms.AccessibleObject

Parameters
x Int32 Int32
The horizontal screen coordinate.
y Int32 Int32
The vertical screen coordinate.
Returns
AccessibleObject AccessibleObject
An AccessibleObject that represents the child object at the given screen coordinates. This method returns the calling
object if the object itself is at the location specified. Returns null if no object is at the tested location.
ControlDesigner.ControlDesignerAccessibleObject.Name
ControlDesigner.ControlDesignerAccessibleObject.Name
I n this Article
Gets or sets the object name.

public override string Name { get; }


member this.Name : string

Returns
String String
The object name, or null if the property has not been set.
ControlDesigner.ControlDesignerAccessibleObject.Parent
ControlDesigner.ControlDesignerAccessibleObject.Parent
I n this Article
Gets the parent of an accessible object.

public override System.Windows.Forms.AccessibleObject Parent { get; }


member this.Parent : System.Windows.Forms.AccessibleObject

Returns
AccessibleObject AccessibleObject
An AccessibleObject that represents the parent of an accessible object, or null if there is no parent object.
ControlDesigner.ControlDesignerAccessibleObject.Role
ControlDesigner.ControlDesignerAccessibleObject.Role
I n this Article
Gets the role of this accessible object.

public override System.Windows.Forms.AccessibleRole Role { get; }


member this.Role : System.Windows.Forms.AccessibleRole

Returns
AccessibleRole AccessibleRole
One of the AccessibleRole values, or None if no role has been specified.
ControlDesigner.ControlDesignerAccessibleObject.State
ControlDesigner.ControlDesignerAccessibleObject.State
I n this Article
Gets the state of this accessible object.

public override System.Windows.Forms.AccessibleStates State { get; }


member this.State : System.Windows.Forms.AccessibleStates

Returns
AccessibleStates AccessibleStates
One of the AccessibleStates values, or None, if no state has been set.
ControlDesigner.ControlDesignerAccessibleObject.Value
ControlDesigner.ControlDesignerAccessibleObject.Value
I n this Article
Gets or sets the value of an accessible object.

public override string Value { get; }


member this.Value : string

Returns
String String
The value of an accessible object, or null if the object has no value set.
DesignerOptions DesignerOptions Class
Provides access to get and set option values for a designer.

D eclaration
[System.Runtime.InteropServices.ComVisible(true)]
public class DesignerOptions
type DesignerOptions = class

I nheritance H ierarchy
Object Object

Constructors
DesignerOptions()
DesignerOptions()

Initializes a new instance of the DesignerOptions class.

Properties
EnableInSituEditing
EnableInSituEditing

Gets or sets a value that enables or disables in-place editing for ToolStrip controls.

GridSize
GridSize

Gets or sets a Size representing the dimensions of a grid unit.

ObjectBoundSmartTagAutoShow
ObjectBoundSmartTagAutoShow

Gets or sets a value that specifies whether a designer shows a component's smart tag panel automatically on
creation.

ShowGrid
ShowGrid

Gets or sets a value that enables or disables the grid in the designer.

SnapToGrid
SnapToGrid

Gets or sets a value that enables or disables whether controls are automatically placed at grid coordinates.
UseOptimizedCodeGeneration
UseOptimizedCodeGeneration

Gets or sets a value that enables or disables the component cache.

UseSmartTags
UseSmartTags

Gets or sets a value that enables or disables smart tags in the designer.

UseSnapLines
UseSnapLines

Gets or sets a value that enables or disables snaplines in the designer.


DesignerOptions
I n this Article
Initializes a new instance of the DesignerOptions class.
public DesignerOptions ();
DesignerOptions.EnableInSituEditing DesignerOptions.
EnableInSituEditing
I n this Article
Gets or sets a value that enables or disables in-place editing for ToolStrip controls.

[System.ComponentModel.Browsable(false)]
public virtual bool EnableInSituEditing { get; set; }
member this.EnableInSituEditing : bool with get, set

Returns
Boolean Boolean
true if in-place editing for ToolStrip controls is enabled; otherwise, false . The default is true .
Attributes BrowsableAttribute
DesignerOptions.GridSize DesignerOptions.GridSize
I n this Article
Gets or sets a Size representing the dimensions of a grid unit.
public virtual System.Drawing.Size GridSize { get; set; }
member this.GridSize : System.Drawing.Size with get, set

Returns
Size Size
A Size representing the dimensions of a grid unit.
DesignerOptions.ObjectBoundSmartTagAutoShow
DesignerOptions.ObjectBoundSmartTagAutoShow
I n this Article
Gets or sets a value that specifies whether a designer shows a component's smart tag panel automatically on creation.

public virtual bool ObjectBoundSmartTagAutoShow { get; set; }


member this.ObjectBoundSmartTagAutoShow : bool with get, set

Returns
Boolean Boolean
true to allow a component's smart tag panel to open automatically upon creation; otherwise, false . The default is
true .

Remarks
A component's smart tag panel is set to automatically open when the DesignerActionList.AutoShow property is true .
See Walkthrough: Adding Smart Tags to a Windows Forms Component
Also
DesignerOptions.ShowGrid DesignerOptions.ShowGrid
I n this Article
Gets or sets a value that enables or disables the grid in the designer.
public virtual bool ShowGrid { get; set; }
member this.ShowGrid : bool with get, set

Returns
Boolean Boolean
true if the grid is enabled; otherwise, false . The default is true .
DesignerOptions.SnapToGrid DesignerOptions.SnapTo
Grid
I n this Article
Gets or sets a value that enables or disables whether controls are automatically placed at grid coordinates.

public virtual bool SnapToGrid { get; set; }


member this.SnapToGrid : bool with get, set

Returns
Boolean Boolean
true if snapping is enabled; otherwise, false .
DesignerOptions.UseOptimizedCodeGeneration
DesignerOptions.UseOptimizedCodeGeneration
I n this Article
Gets or sets a value that enables or disables the component cache.

public virtual bool UseOptimizedCodeGeneration { get; set; }


member this.UseOptimizedCodeGeneration : bool with get, set

Returns
Boolean Boolean
true if the component cache is enabled; otherwise, false . The default is true .

Remarks
The component cache is a performance enhancement that is incompatible with certain designers. You can disable it
with this property.
DesignerOptions.UseSmartTags DesignerOptions.Use
SmartTags
I n this Article
Gets or sets a value that enables or disables smart tags in the designer.

public virtual bool UseSmartTags { get; set; }


member this.UseSmartTags : bool with get, set

Returns
Boolean Boolean
true if smart tags in the designer are enabled; otherwise, false .

Remarks
This option is not exposed on the Options item of the Tools menu in Visual Studio.
See Walkthrough: Adding Smart Tags to a Windows Forms Component
Also
DesignerOptions.UseSnapLines DesignerOptions.Use
SnapLines
I n this Article
Gets or sets a value that enables or disables snaplines in the designer.

public virtual bool UseSnapLines { get; set; }


member this.UseSnapLines : bool with get, set

Returns
Boolean Boolean
true if snaplines in the designer are enabled; otherwise, false .
DockEditor DockEditor Class
Provides a user interface for specifying a Dock property.

D eclaration
[System.CLSCompliant(false)]
public sealed class DockEditor : System.Drawing.Design.UITypeEditor
type DockEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Constructors
DockEditor()
DockEditor()

Initializes a new instance of the DockEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object value using the editor style provided by GetEditorStyle. A service provider is provided so
that any required editing services can be obtained.

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Retrieves the editing style of the EditValue method. If the method is not supported, this will return None.
DockEditor
I n this Article
Initializes a new instance of the DockEditor class.
public DockEditor ();
DockEditor.EditValue DockEditor.EditValue
I n this Article
Edits the specified object value using the editor style provided by GetEditorStyle. A service provider is provided so that
any required editing services can be obtained.

public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,


IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
A service provider object through which editing services may be obtained.
value Object Object
An instance of the value being edited.
Returns
Object Object
The new value of the object. If the value of the object hasn't changed, this should return the same object it was passed.
DockEditor.GetEditStyle DockEditor.GetEditStyle
I n this Article
Retrieves the editing style of the EditValue method. If the method is not supported, this will return None.
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle
(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
An enum value indicating the provided editing style.
DocumentDesigner DocumentDesigner Class
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.

D eclaration
[System.CLSCompliant(false)]
public class DocumentDesigner : System.Windows.Forms.Design.ScrollableControlDesigner,
IDisposable, System.ComponentModel.Design.IRootDesigner, System.Drawing.Design.IToolboxUser
type DocumentDesigner = class
inherit ScrollableControlDesigner
interface IRootDesigner
interface IDesigner
interface IDisposable
interface IToolboxUser

I nheritance H ierarchy
Object Object
ComponentDesigner ComponentDesigner
ControlDesigner ControlDesigner
ParentControlDesigner ParentControlDesigner
ScrollableControlDesigner ScrollableControlDesigner

Remarks
This designer is a root designer, meaning that it provides the root-level design mode view for the associated document
when it is viewed in design mode.
You can associate a designer with a type using a DesignerAttribute. For an overview of customizing design time
behavior, see Extending Design-Time Support.

Constructors
DocumentDesigner()
DocumentDesigner()

Initializes a new instance of the DocumentDesigner class.

Fields
menuEditorService
menuEditorService

Initializes the menuEditorService variable to null .

Properties
SelectionRules
SelectionRules

Gets the SelectionRules for the designer.


Methods
Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the DocumentDesigner and optionally releases the managed
resources.

EnsureMenuEditorService(IComponent)
EnsureMenuEditorService(IComponent)

Checks for the existence of a menu editor service and creates one if one does not already exist.

GetGlyphs(GlyphSelectionType)
GetGlyphs(GlyphSelectionType)

Gets a GlyphCollection representing the Glyph objects.

GetToolSupported(ToolboxItem)
GetToolSupported(ToolboxItem)

Indicates whether the specified tool is supported by the designer.

Initialize(IComponent)
Initialize(IComponent)

Initializes the designer with the specified component.

OnContextMenu(Int32, Int32)
OnContextMenu(Int32, Int32)

Called when the context menu should be displayed.

OnCreateHandle()
OnCreateHandle()

Called immediately after the handle for the designer has been created.

PreFilterProperties(IDictionary)
PreFilterProperties(IDictionary)

Adjusts the set of properties the component exposes through a TypeDescriptor.

ToolPicked(ToolboxItem)
ToolPicked(ToolboxItem)
Selects the specified tool.

WndProc(Message)
WndProc(Message)

Processes Windows messages.

IRootDesigner.GetView(ViewTechnology)
IRootDesigner.GetView(ViewTechnology)

For a description of this member, see ViewTechnology.

IRootDesigner.SupportedTechnologies
IRootDesigner.SupportedTechnologies

For a description of this member, see SupportedTechnologies.

IToolboxUser.GetToolSupported(ToolboxItem)
IToolboxUser.GetToolSupported(ToolboxItem)

For a description of this member, see GetToolSupported(ToolboxItem).

IToolboxUser.ToolPicked(ToolboxItem)
IToolboxUser.ToolPicked(ToolboxItem)

For a description of this member, see ToolPicked(ToolboxItem).

See Also
ScrollableControlDesigner ScrollableControlDesigner
IDesigner IDesigner
IRootDesigner IRootDesigner
DocumentDesigner.Dispose DocumentDesigner.Dispose
I n this Article
Releases the unmanaged resources used by the DocumentDesigner and optionally releases the managed resources.
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true, this method releases all resources held by any managed objects that this
DocumentDesigner references. This method invokes the Dispose() method of each referenced object.
DocumentDesigner
I n this Article
Initializes a new instance of the DocumentDesigner class.
public DocumentDesigner ();
DocumentDesigner.EnsureMenuEditorService Document
Designer.EnsureMenuEditorService
I n this Article
Checks for the existence of a menu editor service and creates one if one does not already exist.

protected virtual void EnsureMenuEditorService (System.ComponentModel.IComponent c);


abstract member EnsureMenuEditorService : System.ComponentModel.IComponent -> unit
override this.EnsureMenuEditorService : System.ComponentModel.IComponent -> unit

Parameters
c IComponent IComponent
The IComponent to ensure has a context menu service.
DocumentDesigner.GetGlyphs DocumentDesigner.Get
Glyphs
I n this Article
Gets a GlyphCollection representing the Glyph objects.

public override System.Windows.Forms.Design.Behavior.GlyphCollection GetGlyphs


(System.Windows.Forms.Design.Behavior.GlyphSelectionType selectionType);
override this.GetGlyphs : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.GlyphCollection

Parameters
selectionType GlyphSelectionType GlyphSelectionType
A GlyphSelectionType value that specifies the selection state.
Returns
GlyphCollection GlyphCollection
A collection of Glyph objects.
DocumentDesigner.GetToolSupported Document
Designer.GetToolSupported
I n this Article
Indicates whether the specified tool is supported by the designer.

[System.CLSCompliant(false)]
protected virtual bool GetToolSupported (System.Drawing.Design.ToolboxItem tool);
abstract member GetToolSupported : System.Drawing.Design.ToolboxItem -> bool
override this.GetToolSupported : System.Drawing.Design.ToolboxItem -> bool

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to test for toolbox support.
Returns
Boolean Boolean
true if the tool should be enabled on the toolbox; false if the document designer doesn't know how to use the tool.
Attributes CLSCompliantAttribute

Remarks
If a tool is supported, it will be enabled in the toolbox when the designer receives focus. Otherwise, it will be disabled.
Once a tool is marked as enabled or disabled it can not be queried again.
See ToolboxItemToolboxItem
Also
DocumentDesigner.Initialize DocumentDesigner.Initialize
I n this Article
Initializes the designer with the specified component.
public override void Initialize (System.ComponentModel.IComponent component);
override this.Initialize : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to associate with the designer.
See IDesignerIDesigner
Also
DocumentDesigner.IRootDesigner.GetView
I n this Article
For a description of this member, see ViewTechnology.
object IRootDesigner.GetView (System.ComponentModel.Design.ViewTechnology technology);

Parameters
technology ViewTechnology
A ViewTechnology that indicates a particular view technology.
Returns
Object
An object that represents the view for this designer.

Remarks
This member is an explicit interface member implementation. It can be used only when the DocumentDesigner
instance is cast to an IRootDesigner interface.
DocumentDesigner.IRootDesigner.Supported
Technologies
I n this Article
For a description of this member, see SupportedTechnologies.

System.ComponentModel.Design.ViewTechnology[]
System.ComponentModel.Design.IRootDesigner.SupportedTechnologies { get; }

Returns
ViewTechnology[]
An array of supported ViewTechnology values.

Remarks
This member is an explicit interface member implementation. It can be used only when the DocumentDesigner
instance is cast to an IRootDesigner interface.
DocumentDesigner.IToolboxUser.GetToolSupported
I n this Article
For a description of this member, see GetToolSupported(ToolboxItem).
bool IToolboxUser.GetToolSupported (System.Drawing.Design.ToolboxItem tool);

Parameters
tool ToolboxItem
The ToolboxItem to be tested for toolbox support.
Returns
Boolean
true if the tool is supported by the toolbox and can be enabled; false if the document designer does not know how
to use the tool.

Remarks
This member is an explicit interface member implementation. It can be used only when the DocumentDesigner
instance is cast to an IRootDesigner interface.
DocumentDesigner.IToolboxUser.ToolPicked
I n this Article
For a description of this member, see ToolPicked(ToolboxItem).
void IToolboxUser.ToolPicked (System.Drawing.Design.ToolboxItem tool);

Parameters
tool ToolboxItem
The ToolboxItem to select.

Remarks
This member is an explicit interface member implementation. It can be used only when the DocumentDesigner
instance is cast to an IRootDesigner interface.
DocumentDesigner.menuEditorService Document
Designer.menuEditorService
I n this Article
Initializes the menuEditorService variable to null .

protected System.Windows.Forms.Design.IMenuEditorService menuEditorService;


val mutable menuEditorService : System.Windows.Forms.Design.IMenuEditorService

Returns
IMenuEditorService IMenuEditorService
See IMenuEditorServiceIMenuEditorService
Also
DocumentDesigner.OnContextMenu DocumentDesigner.
OnContextMenu
I n this Article
Called when the context menu should be displayed.

protected override void OnContextMenu (int x, int y);


override this.OnContextMenu : int * int -> unit

Parameters
x Int32 Int32
The horizontal screen coordinate to display the context menu at.
y Int32 Int32
The vertical screen coordinate to display the context menu at.

Remarks
This method displays the context menu of the document designer.
DocumentDesigner.OnCreateHandle DocumentDesigner.
OnCreateHandle
I n this Article
Called immediately after the handle for the designer has been created.

protected override void OnCreateHandle ();


override this.OnCreateHandle : unit -> unit
DocumentDesigner.PreFilterProperties Document
Designer.PreFilterProperties
I n this Article
Adjusts the set of properties the component exposes through a TypeDescriptor.

protected override void PreFilterProperties (System.Collections.IDictionary properties);


override this.PreFilterProperties : System.Collections.IDictionary -> unit

Parameters
properties IDictionary IDictionary
An IDictionary that contains the properties for the class of the component.

Remarks
This IDesignerFilter interface method override adds a set of properties to this designer's component at design time.
This method adds the following browsable properties: "Location", and "BackColor".
DocumentDesigner.SelectionRules DocumentDesigner.
SelectionRules
I n this Article
Gets the SelectionRules for the designer.

public override System.Windows.Forms.Design.SelectionRules SelectionRules { get; }


member this.SelectionRules : System.Windows.Forms.Design.SelectionRules

Returns
SelectionRules SelectionRules
A bitwise combination of SelectionRules values.

Remarks
This method returns a SelectionRules that prevents the document from being resized.
See SelectionRulesSelectionRules
Also
DocumentDesigner.ToolPicked DocumentDesigner.Tool
Picked
I n this Article
Selects the specified tool.

[System.CLSCompliant(false)]
protected virtual void ToolPicked (System.Drawing.Design.ToolboxItem tool);
abstract member ToolPicked : System.Drawing.Design.ToolboxItem -> unit
override this.ToolPicked : System.Drawing.Design.ToolboxItem -> unit

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component for.
Attributes CLSCompliantAttribute

Remarks
ToolPicked is called when the user double-clicks on a toolbox item. The document designer should create a component
for the specified tool. Only tools that are enabled in the toolbox will be passed to this method.
See ToolboxItemToolboxItem
Also
DocumentDesigner.WndProc DocumentDesigner.Wnd
Proc
I n this Article
Processes Windows messages.

protected override void WndProc (ref System.Windows.Forms.Message m);


override this.WndProc : -> unit

Parameters
m Message Message
The Message to process.
EventHandlerService EventHandlerService Class
Provides a systematic way to manage event handlers for the current document.

D eclaration
public sealed class EventHandlerService
type EventHandlerService = class

I nheritance H ierarchy
Object Object

Remarks
Developers may want to be able to write code in one place that handles events of a certain type.
Also, developers may need to globally change the behavior of the handlers for specific events or types of events, which
may be distributed among designer components.
The designers for a typical project are many different objects so it can be useful to list and store reference to these
events from a common place.
This service implements an "event stack" that contains the current set of event handlers. The stack may have a variety
of different types of handlers on the stack.
For example, a designer might push, or add, a keyboard handler and a mouse handler onto the stack. When a designer
requests an event handler, the service will find the topmost handler on the stack that matches the class you requested.
This way the service can be extended to any eventing scheme, and it also allows specific types of event handlers to be
replaced. For example, you can replace mouse event handlers without affecting menu event handlers or keyboard
event handlers.

Constructors
EventHandlerService(Control)
EventHandlerService(Control)

Initializes a new instance of the EventHandlerService class.

Properties
FocusWindow
FocusWindow

Gets the control to which event handlers are attached.

Methods
GetHandler(Type)
GetHandler(Type)

Gets the currently active event handler of the specified type.


PopHandler(Object)
PopHandler(Object)

Pops the given handler off of the stack.

PushHandler(Object)
PushHandler(Object)

Pushes a new event handler on the stack.

Events
EventHandlerChanged
EventHandlerChanged

Fires an OnEventHandlerChanged event.


EventHandlerService.EventHandlerChanged Event
HandlerService.EventHandlerChanged
I n this Article
Fires an OnEventHandlerChanged event.

public event EventHandler EventHandlerChanged;


member this.EventHandlerChanged : EventHandler
EventHandlerService EventHandlerService
I n this Article
Initializes a new instance of the EventHandlerService class.
public EventHandlerService (System.Windows.Forms.Control focusWnd);
new System.Windows.Forms.Design.EventHandlerService : System.Windows.Forms.Control ->
System.Windows.Forms.Design.EventHandlerService

Parameters
focusWnd Control Control
The Control which is being designed.
EventHandlerService.FocusWindow EventHandler
Service.FocusWindow
I n this Article
Gets the control to which event handlers are attached.

public System.Windows.Forms.Control FocusWindow { get; }


member this.FocusWindow : System.Windows.Forms.Control

Returns
Control Control
The Control which was attached through the constructor.
EventHandlerService.GetHandler EventHandlerService.
GetHandler
I n this Article
Gets the currently active event handler of the specified type.

public object GetHandler (Type handlerType);


abstract member GetHandler : Type -> obj
override this.GetHandler : Type -> obj

Parameters
handlerType Type Type
The type of the handler to get.
Returns
Object Object
An instance of the handler, or null if there is no handler of the requested type.

Remarks
You should never cache this value because other components are free to change it. This call is fairly quick, however,
especially for cases when you are always asking for the same type of handler.
EventHandlerService.PopHandler EventHandlerService.
PopHandler
I n this Article
Pops the given handler off of the stack.

public void PopHandler (object handler);


abstract member PopHandler : obj -> unit
override this.PopHandler : obj -> unit

Parameters
handler Object Object
The handler to remove from the stack.

Remarks
If the handler is not the topmost component on the stack, this will pop all handlers up to and including handler.
EventHandlerService.PushHandler EventHandlerService.
PushHandler
I n this Article
Pushes a new event handler on the stack.

public void PushHandler (object handler);


abstract member PushHandler : obj -> unit
override this.PushHandler : obj -> unit

Parameters
handler Object Object
The handler to add to the stack.

Remarks
This handler will be used by all components that request a compatible handler type. If this handler does not support
the requested type, the next handler on the stack will be used.
EventsTab EventsTab Class
Provides a PropertyTab that can display events for selection and linking.

D eclaration
public class EventsTab : System.Windows.Forms.Design.PropertyTab
type EventsTab = class
inherit PropertyTab

I nheritance H ierarchy
Object Object
PropertyTab PropertyTab

Constructors
EventsTab(IServiceProvider)
EventsTab(IServiceProvider)

Initializes a new instance of the EventsTab class.

Properties
HelpKeyword
HelpKeyword

Gets the Help keyword for the tab.

TabName
TabName

Gets the name of the tab.

Methods
CanExtend(Object)
CanExtend(Object)

Gets a value indicating whether the specified object can be extended.

GetDefaultProperty(Object)
GetDefaultProperty(Object)

Gets the default property from the specified object.

GetProperties(Object, Attribute[])
GetProperties(Object, Attribute[])
Gets all the properties of the event tab that match the specified attributes.

GetProperties(ITypeDescriptorContext, Object, Attribute[])


GetProperties(ITypeDescriptorContext, Object, Attribute[])

Gets all the properties of the event tab that match the specified attributes and context.
EventsTab.CanExtend EventsTab.CanExtend
I n this Article
Gets a value indicating whether the specified object can be extended.
public override bool CanExtend (object extendee);
override this.CanExtend : obj -> bool

Parameters
extendee Object Object
The object to test for extensibility.
Returns
Boolean Boolean
true if the specified object can be extended; otherwise, false .
EventsTab EventsTab
I n this Article
Initializes a new instance of the EventsTab class.
public EventsTab (IServiceProvider sp);
new System.Windows.Forms.Design.EventsTab : IServiceProvider ->
System.Windows.Forms.Design.EventsTab

Parameters
sp IServiceProvider IServiceProvider
An IServiceProvider to use.
EventsTab.GetDefaultProperty EventsTab.GetDefault
Property
I n this Article
Gets the default property from the specified object.

public override System.ComponentModel.PropertyDescriptor GetDefaultProperty (object obj);


override this.GetDefaultProperty : obj -> System.ComponentModel.PropertyDescriptor

Parameters
obj Object Object
The object to retrieve the default property of.
Returns
PropertyDescriptor PropertyDescriptor
A PropertyDescriptor indicating the default property.
EventsTab.GetProperties EventsTab.GetProperties
I n this Article

Overloads
GetProperties(Object, Attribute[]) GetProperties(Object,
Attribute[]) Gets all the properties of the event tab that match the
specified attributes.

GetProperties(ITypeDescriptorContext, Object, Attribute[]) Get


Properties(ITypeDescriptorContext, Object, Attribute[]) Gets all the properties of the event tab that match the
specified attributes and context.

GetProperties(Object, Attribute[]) GetProperties(Object,


Attribute[])
Gets all the properties of the event tab that match the specified attributes.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties (object component,
Attribute[] attributes);
override this.GetProperties : obj * Attribute[] ->
System.ComponentModel.PropertyDescriptorCollection

Parameters
component Object Object
The component to retrieve the properties of.
attributes Attribute[]
An array of Attribute that indicates the attributes of the event properties to retrieve.
Returns
PropertyDescriptorCollection PropertyDescriptorCollection
A PropertyDescriptorCollection that contains the properties. This will be an empty PropertyDescriptorCollection if the
component does not implement an event service.
Remarks
The event tab properties are determined from the event properties returned from a component's event service.

GetProperties(ITypeDescriptorContext, Object, Attribute[])


GetProperties(ITypeDescriptorContext, Object, Attribute[])
Gets all the properties of the event tab that match the specified attributes and context.
public override System.ComponentModel.PropertyDescriptorCollection GetProperties
(System.ComponentModel.ITypeDescriptorContext context, object component, Attribute[] attributes);
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] ->
System.ComponentModel.PropertyDescriptorCollection

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain context information.
component Object Object
The component to retrieve the properties of.
attributes Attribute[]
An array of type Attribute that indicates the attributes of the event properties to retrieve.
Returns
PropertyDescriptorCollection PropertyDescriptorCollection
A PropertyDescriptorCollection that contains the properties. This will be an empty PropertyDescriptorCollection if the
component does not implement an event service.
EventsTab.HelpKeyword EventsTab.HelpKeyword
I n this Article
Gets the Help keyword for the tab.
public override string HelpKeyword { get; }
member this.HelpKeyword : string

Returns
String String
The Help keyword for the tab.
EventsTab.TabName EventsTab.TabName
I n this Article
Gets the name of the tab.
public override string TabName { get; }
member this.TabName : string

Returns
String String
The name of the tab.
FileNameEditor FileNameEditor Class
Provides a user interface for selecting a file name.

D eclaration
[System.CLSCompliant(false)]
public class FileNameEditor : System.Drawing.Design.UITypeEditor
type FileNameEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Remarks
FileNameEditor provides a file selection dialog box for file name selection and editing.

Constructors
FileNameEditor()
FileNameEditor()

Initializes a new instance of the FileNameEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object using the editor style provided by the GetEditStyle(ITypeDescriptorContext) method.

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Gets the editing style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.

InitializeDialog(OpenFileDialog)
InitializeDialog(OpenFileDialog)

Initializes the open file dialog when it is created.


FileNameEditor.EditValue FileNameEditor.EditValue
I n this Article
Edits the specified object using the editor style provided by the GetEditStyle(ITypeDescriptorContext) method.
public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,
IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
A service provider object through which editing services may be obtained.
value Object Object
An instance of the value being edited.
Returns
Object Object
The new value of the object. If the value of the object hasn't changed, this should return the same object it was passed.

Remarks
A service provider is provided so that any required editing services can be obtained.
FileNameEditor
I n this Article
Initializes a new instance of the FileNameEditor class.
public FileNameEditor ();
FileNameEditor.GetEditStyle FileNameEditor.GetEditStyle
I n this Article
Gets the editing style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.
public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle
(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
One of the UITypeEditorEditStyle values indicating the provided editing style.

Remarks
If the EditValue method is not supported, this method will return None.
See UITypeEditorEditStyleUITypeEditorEditStyle
Also
FileNameEditor.InitializeDialog FileNameEditor.Initialize
Dialog
I n this Article
Initializes the open file dialog when it is created.

protected virtual void InitializeDialog (System.Windows.Forms.OpenFileDialog openFileDialog);


abstract member InitializeDialog : System.Windows.Forms.OpenFileDialog -> unit
override this.InitializeDialog : System.Windows.Forms.OpenFileDialog -> unit

Parameters
openFileDialog OpenFileDialog OpenFileDialog
The OpenFileDialog to use to select a file name.

Remarks
This method configures the dialog box with a generic file filter and title.
See OpenFileDialogOpenFileDialog
Also
FolderNameEditor FolderNameEditor Class
Provides a user interface for choosing a folder from the file system.

D eclaration
[System.CLSCompliant(false)]
public class FolderNameEditor : System.Drawing.Design.UITypeEditor
type FolderNameEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Remarks
You may customize the folder options by inheriting from this class and overriding InitializeDialog.

Constructors
FolderNameEditor()
FolderNameEditor()

Initializes a new instance of the FolderNameEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object using the editor style provided by GetEditStyle(ITypeDescriptorContext).

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Gets the editing style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.

InitializeDialog(FolderNameEditor+FolderBrowser)
InitializeDialog(FolderNameEditor+FolderBrowser)

Initializes the folder browser dialog.


FolderNameEditor.EditValue FolderNameEditor.EditValue
I n this Article
Edits the specified object using the editor style provided by GetEditStyle(ITypeDescriptorContext).
public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,
IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
A service object provider.
value Object Object
The value to set.
Returns
Object Object
The new value of the object, or the old value if the object couldn't be updated.
FolderNameEditor
I n this Article
Initializes a new instance of the FolderNameEditor class.
public FolderNameEditor ();
FolderNameEditor.GetEditStyle FolderNameEditor.Get
EditStyle
I n this Article
Gets the editing style used by the EditValue(ITypeDescriptorContext, IServiceProvider, Object) method.

public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle


(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
A UITypeEditorEditStyle enumeration value indicating the provided editing style.

Remarks
If the EditValue method is not supported, this will return None.
See UITypeEditorEditStyleUITypeEditorEditStyle
Also
FolderNameEditor.InitializeDialog FolderNameEditor.
InitializeDialog
I n this Article
Initializes the folder browser dialog.

protected virtual void InitializeDialog (System.Windows.Forms.Design.FolderNameEditor.FolderBrowser


folderBrowser);
abstract member InitializeDialog : System.Windows.Forms.Design.FolderNameEditor.FolderBrowser ->
unit
override this.InitializeDialog : System.Windows.Forms.Design.FolderNameEditor.FolderBrowser -> unit

Parameters
folderBrowser FolderNameEditor.FolderBrowser FolderNameEditor.FolderBrowser
A FolderNameEditor.FolderBrowser to choose a folder.

Remarks
The default implementation provides a generic folder browser.
See FolderNameEditor.FolderBrowserFolderNameEditor.FolderBrowser
Also
FolderNameEditor.FolderBrowser Class
Represents a dialog box that allows the user to choose a folder. This class cannot be inherited.

D eclaration
protected sealed class FolderNameEditor.FolderBrowser : System.ComponentModel.Component

I nheritance H ierarchy
Object
MarshalByRefObject
Component

Constructors
FolderNameEditor.FolderBrowser()

Initializes a new instance of the FolderNameEditor.FolderBrowser class.

Properties
Description

Gets or sets a description to show above the folders.

DirectoryPath

Gets the directory path to the object the user picked.

StartLocation

Gets or sets the start location of the root node.

Style

The styles the folder browser will use when browsing folders. This should be a combination of flags from the
FolderNameEditor.FolderBrowserStyles enumeration.

Methods
ShowDialog()

Shows the folder browser dialog.

ShowDialog(IWin32Window)

Shows the folder browser dialog with the specified owner.


FolderNameEditor.FolderBrowser.Description Folder
NameEditor.FolderBrowser.Description
I n this Article
Gets or sets a description to show above the folders.

public string Description { get; set; }


member this.Description : string with get, set

Returns
String String
The description to show above the folders.

Remarks
This description can provide instructions about selecting a folder.
FolderNameEditor.FolderBrowser.DirectoryPath Folder
NameEditor.FolderBrowser.DirectoryPath
I n this Article
Gets the directory path to the object the user picked.

public string DirectoryPath { get; }


member this.DirectoryPath : string

Returns
String String
The directory path to the object the user picked.
FolderNameEditor.FolderBrowser
I n this Article
Initializes a new instance of the FolderNameEditor.FolderBrowser class.
public FolderBrowser ();
FolderNameEditor.FolderBrowser.ShowDialog Folder
NameEditor.FolderBrowser.ShowDialog
I n this Article

Overloads
ShowDialog() ShowDialog()
Shows the folder browser dialog.

ShowDialog(IWin32Window) ShowDialog(IWin32Window)
Shows the folder browser dialog with the specified owner.

ShowDialog() ShowDialog()
Shows the folder browser dialog.
public System.Windows.Forms.DialogResult ShowDialog ();
member this.ShowDialog : unit -> System.Windows.Forms.DialogResult

Returns
DialogResult DialogResult
The DialogResult from the form.

ShowDialog(IWin32Window) ShowDialog(IWin32Window)
Shows the folder browser dialog with the specified owner.
public System.Windows.Forms.DialogResult ShowDialog (System.Windows.Forms.IWin32Window owner);
member this.ShowDialog : System.Windows.Forms.IWin32Window -> System.Windows.Forms.DialogResult

Parameters
owner IWin32Window IWin32Window
Top-level window that will own the modal dialog (e.g.: System.Windows.Forms.Form).
Returns
DialogResult DialogResult
The DialogResult from the form.
FolderNameEditor.FolderBrowser.StartLocation Folder
NameEditor.FolderBrowser.StartLocation
I n this Article
Gets or sets the start location of the root node.

public System.Windows.Forms.Design.FolderNameEditor.FolderBrowserFolder StartLocation { get; set; }


member this.StartLocation : System.Windows.Forms.Design.FolderNameEditor.FolderBrowserFolder with
get, set

Returns
FolderNameEditor.FolderBrowserFolder FolderNameEditor.FolderBrowserFolder
A FolderNameEditor.FolderBrowserFolder that indicates the location for the folder browser to initially browse to.
FolderNameEditor.FolderBrowser.Style FolderName
Editor.FolderBrowser.Style
I n this Article
The styles the folder browser will use when browsing folders. This should be a combination of flags from the
FolderNameEditor.FolderBrowserStyles enumeration.
public System.Windows.Forms.Design.FolderNameEditor.FolderBrowserStyles Style { get; set; }
member this.Style : System.Windows.Forms.Design.FolderNameEditor.FolderBrowserStyles with get, set

Returns
FolderNameEditor.FolderBrowserStyles FolderNameEditor.FolderBrowserStyles
A FolderNameEditor.FolderBrowserStyles enumeration member that indicates behavior for the
FolderNameEditor.FolderBrowser to use.
FolderNameEditor.FolderBrowserFolder Enum
Defines identifiers used to indicate the root folder for a folder browser to initially browse to.

D eclaration
protected enum FolderNameEditor.FolderBrowserFolder

I nheritance H ierarchy
Object
ValueType
Enum

Fields
Desktop Desktop The user's desktop.

Favorites Favorites The user's favorites list.

MyComputer MyComputer The contents of the My Computer icon.

MyDocuments MyDocuments The user's My Documents folder.

MyPictures MyPictures User's location to store pictures.

NetAndDialUpConnections Network and dial-up connections.


NetAndDialUpConnections

NetworkNeighborhood NetworkNeighborhood The network neighborhood.

Printers Printers A folder containing installed printers.

Recent Recent A folder containing shortcuts to recently opened files.

SendTo SendTo A folder containing shortcuts to applications to send documents


to.

StartMenu StartMenu The user's start menu.


Templates Templates The user's file templates.
FolderNameEditor.FolderBrowserStyles Enum
Defines identifiers used to specify behavior of a FolderNameEditor.FolderBrowser.

D eclaration
[System.Flags]
protected enum FolderNameEditor.FolderBrowserStyles

I nheritance H ierarchy
Object
ValueType
Enum

Fields
BrowseForComputer The folder browser can only return computers. If the user selects anything other than a computer,
BrowseForComputer the OK button is grayed.

BrowseForEverything The folder browser can return any object that it can return.
BrowseForEverything

BrowseForPrinter The folder browser can only return printers. If the user selects anything other than a printer, the
BrowseForPrinter OK button is grayed.

RestrictToDomain The folder browser will not include network folders below the domain level in the dialog box's tree
RestrictToDomain view control, or allow navigation to network locations outside of the domain.

RestrictToFilesystem The folder browser will only return local file system directories. If the user selects folders that are
RestrictToFilesystem not part of the local file system, the OK button is grayed.

RestrictToSubfolders The folder browser will only return obejcts of the local file system that are within the root folder or
RestrictToSubfolders a subfolder of the root folder. If the user selects a subfolder of the root folder that is not part of
the local file system, the OK button is grayed.

ShowTextBox The folder browser includes a TextBox control in the browse dialog box that allows the user to type
ShowTextBox the name of an item.
IContainsThemedScrollbarWindows IContainsThemed
ScrollbarWindows Interface
Defines a method for getting information about how the scrollbars of windows need to be themed when displayed in
the Visual Studio designer.

D eclaration
public interface IContainsThemedScrollbarWindows
type IContainsThemedScrollbarWindows = interface

I nheritance H ierarchy
None

Methods
ThemedScrollbarWindows()
ThemedScrollbarWindows()

Gets an enumeration of ThemedScrollbarWindow objects that represent windows and how their scrollbars need
to be themed when displayed in the Visual Studio designer.
IContainsThemedScrollbarWindows.ThemedScrollbar
Windows IContainsThemedScrollbarWindows.Themed
ScrollbarWindows
I n this Article
Gets an enumeration of ThemedScrollbarWindow objects that represent windows and how their scrollbars need to be
themed when displayed in the Visual Studio designer.

public System.Collections.IEnumerable ThemedScrollbarWindows ();


abstract member ThemedScrollbarWindows : unit -> System.Collections.IEnumerable

Returns
IEnumerable IEnumerable
An enumeration of objects that represent windows and how their scrollbars need to be themed when displayed in the
Visual Studio designer.
ImageListCodeDomSerializer ImageListCodeDom
Serializer Class
Serializes string dictionaries.

D eclaration
[System.CLSCompliant(false)]
public class ImageListCodeDomSerializer :
System.ComponentModel.Design.Serialization.CodeDomSerializer
type ImageListCodeDomSerializer = class
inherit CodeDomSerializer

I nheritance H ierarchy
Object Object
CodeDomSerializer CodeDomSerializer

Constructors
ImageListCodeDomSerializer()
ImageListCodeDomSerializer()

Initializes a new instance of the ImageListCodeDomSerializer class.

Methods
Deserialize(IDesignerSerializationManager, Object)
Deserialize(IDesignerSerializationManager, Object)

Deserializes the specified serialized Code Document Object Model (CodeDOM ) object into an object.

Serialize(IDesignerSerializationManager, Object)
Serialize(IDesignerSerializationManager, Object)

Serializes the specified object into a Code Document Object Model (CodeDOM ) object.
ImageListCodeDomSerializer.Deserialize ImageListCode
DomSerializer.Deserialize
I n this Article
Deserializes the specified serialized Code Document Object Model (CodeDOM ) object into an object.

public override object Deserialize


(System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object
codeObject);
override this.Deserialize : System.ComponentModel.Design.Serialization.IDesignerSerializationManager
* obj -> obj

Parameters
manager IDesignerSerializationManager IDesignerSerializationManager
A serialization manager interface that is used during the deserialization process.
codeObject Object Object
A serialized CodeDOM object to deserialize.
Returns
Object Object
The deserialized CodeDOM object.
Exceptions
ArgumentNullException ArgumentNullException
manager or codeObject is null .

Remarks
The Deserialize method uses the serialization manager to create objects and resolve data types.
ImageListCodeDomSerializer
I n this Article
Initializes a new instance of the ImageListCodeDomSerializer class.
public ImageListCodeDomSerializer ();
ImageListCodeDomSerializer.Serialize ImageListCode
DomSerializer.Serialize
I n this Article
Serializes the specified object into a Code Document Object Model (CodeDOM ) object.

public override object Serialize


(System.ComponentModel.Design.Serialization.IDesignerSerializationManager manager, object value);
override this.Serialize : System.ComponentModel.Design.Serialization.IDesignerSerializationManager *
obj -> obj

Parameters
manager IDesignerSerializationManager IDesignerSerializationManager
The serialization manager to use during serialization.
value Object Object
The object to serialize.
Returns
Object Object
A CodeDOM object representing the object that has been serialized.
ImageListImageEditor ImageListImageEditor Class
Provides an editor that can perform default file searching for bitmap (.bmp) files.

D eclaration
public class ImageListImageEditor : System.Drawing.Design.ImageEditor
type ImageListImageEditor = class
inherit ImageEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor
ImageEditor ImageEditor

Constructors
ImageListImageEditor()
ImageListImageEditor()

Initializes a new instance of the ImageListImageEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the specified object value using the edit style provided by the GetEditStyle(ITypeDescriptorContext) method.

GetFileDialogDescription()
GetFileDialogDescription()

Gets the description for the default file-list filter provided by this editor.

GetImageExtenders()
GetImageExtenders()

Gets an array of supported image types.

GetPaintValueSupported(ITypeDescriptorContext)
GetPaintValueSupported(ITypeDescriptorContext)

Gets a value indicating whether this editor supports painting a representation of an object's value.

PaintValue(PaintValueEventArgs)
PaintValue(PaintValueEventArgs)

Paints a value indicated by the specified PaintValueEventArgs.


ImageListImageEditor.EditValue ImageListImageEditor.
EditValue
I n this Article
Edits the specified object value using the edit style provided by the GetEditStyle(ITypeDescriptorContext) method.

public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,


IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
An IServiceProvider through which editing services can be obtained.
value Object Object
An Object being edited.
Returns
Object Object
An Object representing the new value. If the value of the object has not changed, the
EditValue(ITypeDescriptorContext, IServiceProvider, Object) method returns the object that was passed to it.

Remarks
This editor uses a service provider to obtain any necessary editing services.
ImageListImageEditor.GetFileDialogDescription Image
ListImageEditor.GetFileDialogDescription
I n this Article
Gets the description for the default file-list filter provided by this editor.

protected override string GetFileDialogDescription ();


override this.GetFileDialogDescription : unit -> string

Returns
String String
The description for the default file-list filter.

Remarks
The file dialog box description appears in the file-list filter drop-down list box.
ImageListImageEditor.GetImageExtenders ImageList
ImageEditor.GetImageExtenders
I n this Article
Gets an array of supported image types.

protected override Type[] GetImageExtenders ();


override this.GetImageExtenders : unit -> Type[]

Returns
Type[]
An array of Type representing supported image types.
ImageListImageEditor.GetPaintValueSupported ImageList
ImageEditor.GetPaintValueSupported
I n this Article
Gets a value indicating whether this editor supports painting a representation of an object's value.

public override bool GetPaintValueSupported (System.ComponentModel.ITypeDescriptorContext context);


override this.GetPaintValueSupported : System.ComponentModel.ITypeDescriptorContext -> bool

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
Boolean Boolean
true if PaintValue(PaintValueEventArgs) is implemented; otherwise, false .
ImageListImageEditor
I n this Article
Initializes a new instance of the ImageListImageEditor class.
public ImageListImageEditor ();
ImageListImageEditor.PaintValue ImageListImageEditor.
PaintValue
I n this Article
Paints a value indicated by the specified PaintValueEventArgs.

public override void PaintValue (System.Drawing.Design.PaintValueEventArgs e);


override this.PaintValue : System.Drawing.Design.PaintValueEventArgs -> unit

Parameters
e PaintValueEventArgs PaintValueEventArgs
A PaintValueEventArgs indicating what to paint and where to paint it.

Remarks
To display the representation of the value in the typical property sheet format, paint within the boundaries of the
Rectangle contained within the specified PaintValueEventArgs.
IMenuEditorService IMenuEditorService Interface
Provides access to the menu editing service.

D eclaration
public interface IMenuEditorService
type IMenuEditorService = interface

I nheritance H ierarchy
None

Remarks
Most of the implementation of this service is provided by the host environment.

Methods
GetMenu()
GetMenu()

Gets the current menu.

IsActive()
IsActive()

Indicates whether the current menu is active.

MessageFilter(Message)
MessageFilter(Message)

Allows the editor service to intercept Win32 messages.

SetMenu(Menu)
SetMenu(Menu)

Sets the specified menu visible on the form.

SetSelection(MenuItem)
SetSelection(MenuItem)

Sets the selected menu item of the current menu.


IMenuEditorService.GetMenu IMenuEditorService.Get
Menu
I n this Article
Gets the current menu.

public System.Windows.Forms.Menu GetMenu ();


abstract member GetMenu : unit -> System.Windows.Forms.Menu

Returns
Menu Menu
The current Menu.
IMenuEditorService.IsActive IMenuEditorService.IsActive
I n this Article
Indicates whether the current menu is active.
public bool IsActive ();
abstract member IsActive : unit -> bool

Returns
Boolean Boolean
true if the current menu is currently active; otherwise, false .
IMenuEditorService.MessageFilter IMenuEditorService.
MessageFilter
I n this Article
Allows the editor service to intercept Win32 messages.

public bool MessageFilter (ref System.Windows.Forms.Message m);


abstract member MessageFilter : -> bool

Parameters
m Message Message
The Message to process.
Returns
Boolean Boolean
true if the message is for the control; otherwise, false .
IMenuEditorService.SetMenu IMenuEditorService.Set
Menu
I n this Article
Sets the specified menu visible on the form.

public void SetMenu (System.Windows.Forms.Menu menu);


abstract member SetMenu : System.Windows.Forms.Menu -> unit

Parameters
menu Menu Menu
The Menu to render.

Remarks
The menu is painted at the top of a form's window frame and can be directly edited by the user.
IMenuEditorService.SetSelection IMenuEditorService.Set
Selection
I n this Article
Sets the selected menu item of the current menu.

public void SetSelection (System.Windows.Forms.MenuItem item);


abstract member SetSelection : System.Windows.Forms.MenuItem -> unit

Parameters
item MenuItem MenuItem
A MenuItem to set as the currently selected menu item.
IUIService IUIService Interface
Enables interaction with the user interface of the development environment object that is hosting the designer.

D eclaration
[System.Runtime.InteropServices.Guid("06A9C74B-5E32-4561-BE73-381B37869F4F")]
public interface IUIService
type IUIService = interface

I nheritance H ierarchy
None

Remarks
IUIService can display error messages, show dialog boxes, and get ambient properties of the host, such as the font for
dialog boxes and color schemes, through the Styles dictionary property.

Properties
Styles
Styles

Gets the collection of styles that are specific to the host's environment.

Methods
CanShowComponentEditor(Object)
CanShowComponentEditor(Object)

Indicates whether the component can display a ComponentEditorForm.

GetDialogOwnerWindow()
GetDialogOwnerWindow()

Gets the window that should be used as the owner when showing dialog boxes.

SetUIDirty()
SetUIDirty()

Sets a flag indicating the UI has changed.

ShowComponentEditor(Object, IWin32Window)
ShowComponentEditor(Object, IWin32Window)

Attempts to display a ComponentEditorForm for a component.


ShowDialog(Form)
ShowDialog(Form)

Attempts to display the specified form in a dialog box.

ShowError(Exception)
ShowError(Exception)

Displays the specified exception and information about the exception in a message box.

ShowError(String)
ShowError(String)

Displays the specified error message in a message box.

ShowError(Exception, String)
ShowError(Exception, String)

Displays the specified exception and information about the exception in a message box.

ShowMessage(String)
ShowMessage(String)

Displays the specified message in a message box.

ShowMessage(String, String)
ShowMessage(String, String)

Displays the specified message in a message box with the specified caption.

ShowMessage(String, String, MessageBoxButtons)


ShowMessage(String, String, MessageBoxButtons)

Displays the specified message in a message box with the specified caption and buttons to place on the dialog box.

ShowToolWindow(Guid)
ShowToolWindow(Guid)

Displays the specified tool window.


IUIService.CanShowComponentEditor IUIService.Can
ShowComponentEditor
I n this Article
Indicates whether the component can display a ComponentEditorForm.

public bool CanShowComponentEditor (object component);


abstract member CanShowComponentEditor : obj -> bool

Parameters
component Object Object
The component to check for support for displaying a ComponentEditorForm.
Returns
Boolean Boolean
true if the specified component can display a component editor form; otherwise, false .

Remarks
Component editors can display a component editor form that is similar to a property page from the Component
Object Model (COM ).
This method checks to determine whether the specified component has a ComponentEditor that can display a
ComponentEditorForm.
See ShowComponentEditor(Object, IWin32Window )ShowComponentEditor(Object, IWin32Window )
Also
IUIService.GetDialogOwnerWindow IUIService.GetDialog
OwnerWindow
I n this Article
Gets the window that should be used as the owner when showing dialog boxes.

public System.Windows.Forms.IWin32Window GetDialogOwnerWindow ();


abstract member GetDialogOwnerWindow : unit -> System.Windows.Forms.IWin32Window

Returns
IWin32Window IWin32Window
An IWin32Window that indicates the window to own any child dialog boxes.

Remarks
Some dialog boxes are parented to an owner application and are not visible in the task list. This method returns an
IWin32Window that indicates the window that should be the owner for dialog boxes of this sort that are spawned from
an integrated development environment.
IUIService.SetUIDirty IUIService.SetUIDirty
I n this Article
Sets a flag indicating the UI has changed.
public void SetUIDirty ();
abstract member SetUIDirty : unit -> unit

Remarks
This method indicates that the UI has been changed and should be refreshed. It is important to indicate the need for a
refresh whenever a toolbar or menu item's status changes. Most development environments cache the status of these
elements for speed, and need to know when they need to be updated. This method is called, for example, after objects
have been selected within designer view to enable the cut and copy menu items.
IUIService.ShowComponentEditor IUIService.Show
ComponentEditor
I n this Article
Attempts to display a ComponentEditorForm for a component.

public bool ShowComponentEditor (object component, System.Windows.Forms.IWin32Window parent);


abstract member ShowComponentEditor : obj * System.Windows.Forms.IWin32Window -> bool

Parameters
component Object Object
The component for which to display a ComponentEditorForm.
parent IWin32Window IWin32Window
The IWin32Window to parent any dialog boxes to.
Returns
Boolean Boolean
true if the attempt is successful; otherwise, false .
Exceptions
ArgumentException ArgumentException
The component does not support component editors.

Remarks
A ComponentEditorForm is similar to a property page from the Component Object Model (COM ).
If the component does not support component editors, an ArgumentException is thrown. To avoid this, be sure to call
CanShowComponentEditor first.
See CanShowComponentEditor(Object)CanShowComponentEditor(Object)
Also
IUIService.ShowDialog IUIService.ShowDialog
I n this Article
Attempts to display the specified form in a dialog box.
public System.Windows.Forms.DialogResult ShowDialog (System.Windows.Forms.Form form);
abstract member ShowDialog : System.Windows.Forms.Form -> System.Windows.Forms.DialogResult

Parameters
form Form Form
The Form to display.
Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned by the dialog box.

Examples
The following code example attempts to obtain an instance of the IUIService class and invoke the service's ShowDialog
method.
IUIService UIservice = (IUIService)this.GetService(
typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowDialog(new ExampleForm());

See DialogResultDialogResult
Also
IUIService.ShowError IUIService.ShowError
I n this Article

Overloads
ShowError(Exception) ShowError(Exception)
Displays the specified exception and information about the
exception in a message box.

ShowError(String) ShowError(String)
Displays the specified error message in a message box.

ShowError(Exception, String) ShowError(Exception, String)


Displays the specified exception and information about the
exception in a message box.

ShowError(Exception) ShowError(Exception)
Displays the specified exception and information about the exception in a message box.
public void ShowError (Exception ex);
abstract member ShowError : Exception -> unit

Parameters
ex Exception Exception
The Exception to display.
Remarks
Using this method enables the message box display to be properly integrated with the development environment.

ShowError(String) ShowError(String)
Displays the specified error message in a message box.
public void ShowError (string message);
abstract member ShowError : string -> unit

Parameters
message String String
The error message to display.
Remarks
Using this method enables the message box display to be properly integrated with the development environment.

ShowError(Exception, String) ShowError(Exception, String)


Displays the specified exception and information about the exception in a message box.
public void ShowError (Exception ex, string message);
abstract member ShowError : Exception * string -> unit

Parameters
ex Exception Exception
The Exception to display.
message String String
A message to display that provides information about the exception.
Examples
The following code example attempts to obtain an instance of the IUIService and invoke the service's ShowError
method.

IUIService UIservice = (IUIService)this.GetService(


typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowError( new Exception(
"This is a message in a test exception, " +
"displayed by the IUIService",
new ArgumentException("Test inner exception")));

Remarks
Using this method enables the message box display to be properly integrated with the development environment.
IUIService.ShowMessage IUIService.ShowMessage
I n this Article

Overloads
ShowMessage(String) ShowMessage(String)
Displays the specified message in a message box.

ShowMessage(String, String) ShowMessage(String, String)


Displays the specified message in a message box with the
specified caption.

ShowMessage(String, String, MessageBoxButtons) Show


Message(String, String, MessageBoxButtons) Displays the specified message in a message box with the
specified caption and buttons to place on the dialog box.

ShowMessage(String) ShowMessage(String)
Displays the specified message in a message box.
public void ShowMessage (string message);
abstract member ShowMessage : string -> unit

Parameters
message String String
The message to display
Examples
The following code example demonstrates how to use the ShowMessage method to display a message box.

IUIService UIservice = (IUIService)this.GetService(


typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowMessage("Test message", "Test caption",
System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);

Remarks
This method ensures that the display of the message box is properly integrated with the development environment.

ShowMessage(String, String) ShowMessage(String, String)


Displays the specified message in a message box with the specified caption.
public void ShowMessage (string message, string caption);
abstract member ShowMessage : string * string -> unit

Parameters
message String String
The message to display.
caption String String
The caption for the message box.
Examples
The following code example attempts to obtain an instance of the IUIService and invoke the service's ShowMessage
method.
IUIService UIservice = (IUIService)this.GetService(
typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowMessage("Test message", "Test caption",
System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);

Remarks
This method ensures that the display of the message box is properly integrated with the development environment.

ShowMessage(String, String, MessageBoxButtons)


ShowMessage(String, String, MessageBoxButtons)
Displays the specified message in a message box with the specified caption and buttons to place on the dialog box.

public System.Windows.Forms.DialogResult ShowMessage (string message, string caption,


System.Windows.Forms.MessageBoxButtons buttons);
abstract member ShowMessage : string * string * System.Windows.Forms.MessageBoxButtons ->
System.Windows.Forms.DialogResult

Parameters
message String String
The message to display.
caption String String
The caption for the dialog box.
buttons MessageBoxButtons MessageBoxButtons
One of the MessageBoxButtons values: OK, OKCancel, YesNo, or YesNoCancel.
Returns
DialogResult DialogResult
One of the DialogResult values indicating the result code returned by the dialog box.
Examples
The following code example demonstrates how to use the ShowMessage method to display a message box.

IUIService UIservice = (IUIService)this.GetService(


typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowMessage("Test message", "Test caption",
System.Windows.Forms.MessageBoxButtons.AbortRetryIgnore);

Remarks
This method ensures that the display of the message box is properly integrated with the development environment.
See DialogResultDialogResult
Also
IUIService.ShowToolWindow IUIService.ShowTool
Window
I n this Article
Displays the specified tool window.

public bool ShowToolWindow (Guid toolWindow);


abstract member ShowToolWindow : Guid -> bool

Parameters
toolWindow Guid Guid
A Guid identifier for the tool window. This can be a custom Guid or one of the predefined values from
StandardToolWindows.
Returns
Boolean Boolean
true if the tool window was successfully shown; false if it could not be shown or found.

Examples
The following code example attempts to obtain an instance of the IUIService and invoke the service's
ShowToolWindow method.
IUIService UIservice = (IUIService)this.GetService(
typeof( System.Windows.Forms.Design.IUIService ) );
if( UIservice != null )
UIservice.ShowToolWindow(StandardToolWindows.TaskList);
IUIService.Styles IUIService.Styles
I n this Article
Gets the collection of styles that are specific to the host's environment.
public System.Collections.IDictionary Styles { get; }
member this.Styles : System.Collections.IDictionary

Returns
IDictionary IDictionary
An IDictionary containing style settings.

Examples
The following code example gets the dialog box font from the host environment.
// The specified IDesigner implements IUIService.
Font GetFont(IDesigner designer)
{
Font hostfont;

// Gets the dialog box font from the host environment.


hostfont = (Font)((IUIService)designer).Styles["DialogFont"];

return hostfont;
}

Remarks
The dictionary can provide information from the host environment. At a minimum, this consists of the font that should
be used for standard UI text, and the color to use for highlighting. These required styles are "DialogFont" and
"HighlightColor".
The values for these styles may be retrieved by using the style as a key for the dictionary, accessing the dictionary
using the key as an indexer. For example: (object implementing IUIService).Styles[(style name string in quotes)].
IWindowsFormsEditorService IWindowsFormsEditor
Service Interface
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.

D eclaration
public interface IWindowsFormsEditorService
type IWindowsFormsEditorService = interface

I nheritance H ierarchy
None

Remarks
The IWindowsFormsEditorService is only available through the GetService method of the PropertyGrid control.
This service is typically used to display a form from the EditValue method of a UITypeEditor. When a PropertyGrid
invokes the EditValue method of a UITypeEditor to provide a user interface for editing the value of a property, the
EditValue method is passed a reference to an IServiceProvider that can typically provide an instance of the
IWindowsFormsEditorService. The methods of this service can be used to display dialog boxes and forms, or to show a
Control within a drop down container that is shown on top of the property grid near the area of the value field whose
value is being edited.

Methods
CloseDropDown()
CloseDropDown()

Closes any previously opened drop down control area.

DropDownControl(Control)
DropDownControl(Control)

Displays the specified control in a drop down area below a value field of the property grid that provides this
service.

ShowDialog(Form)
ShowDialog(Form)

Shows the specified Form.


IWindowsFormsEditorService.CloseDropDown IWindows
FormsEditorService.CloseDropDown
I n this Article
Closes any previously opened drop down control area.

public void CloseDropDown ();


abstract member CloseDropDown : unit -> unit

Remarks
This method closes the drop down container area for a control that has been shown using the DropDownControl
method, and releases the drop down container's reference to the control.
IWindowsFormsEditorService.DropDownControl I
WindowsFormsEditorService.DropDownControl
I n this Article
Displays the specified control in a drop down area below a value field of the property grid that provides this service.

public void DropDownControl (System.Windows.Forms.Control control);


abstract member DropDownControl : System.Windows.Forms.Control -> unit

Parameters
control Control Control
The drop down list Control to open.

Remarks
The EditValue method of a UITypeEditor can call this method to display a specified control in a drop down area over
the property grid hosting the editor which uses this service.
When possible, the dimensions of the control will be maintained. If this is not possible due to the screen layout, the
control may be resized. To ensure that the control resizes neatly, you should implement docking and anchoring, and
possibly any resize event-handler update code. If the user performs an action that causes the drop down to close, the
control will be hidden and disposed by garbage collection if there is no other stored reference to the control.
IWindowsFormsEditorService.ShowDialog IWindows
FormsEditorService.ShowDialog
I n this Article
Shows the specified Form.

public System.Windows.Forms.DialogResult ShowDialog (System.Windows.Forms.Form dialog);


abstract member ShowDialog : System.Windows.Forms.Form -> System.Windows.Forms.DialogResult

Parameters
dialog Form Form
The Form to display.
Returns
DialogResult DialogResult
A DialogResult indicating the result code returned by the Form.

Remarks
This method displays the specified form.
See DialogResultDialogResult
Also
MaskDescriptor MaskDescriptor Class
Defines a set of members for derived classes to provide options for the masked text box UI type editor.

D eclaration
public abstract class MaskDescriptor
type MaskDescriptor = class

I nheritance H ierarchy
Object Object

Remarks
The MaskDescriptor abstract class defines the common set of properties that all mask descriptors must implement.
You can use mask descriptors to create predefined mask options for use in the UI type editor for the MaskedTextBox.
For example, Visual Studio provides predefined masks for data such as the Postal Code, time, different date formats,
and telephone number. All predefined masks will be associated with the MaskedTextProvider parsing engine.
You can discover MaskDescriptor types at design time by querying the ITypeDiscoveryService service provider.

Constructors
MaskDescriptor()
MaskDescriptor()

Initializes a new instance of the MaskDescriptor class.

Properties
Culture
Culture

Gets the CultureInfo representing the locale the mask is authored for.

Mask
Mask

Gets the mask being defined.

Name
Name

Gets the user-friendly name of the mask.

Sample
Sample

Gets a sample of a formatted string for the mask.


ValidatingType
ValidatingType

Gets the type providing validation associated with the mask.

Methods
Equals(Object)
Equals(Object)

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

GetHashCode()
GetHashCode()

Serves as a hash function for a particular type.

IsValidMaskDescriptor(MaskDescriptor)
IsValidMaskDescriptor(MaskDescriptor)

Returns a value indicating whether the specified mask descriptor is valid and can be added to the masks list.

IsValidMaskDescriptor(MaskDescriptor, String)
IsValidMaskDescriptor(MaskDescriptor, String)

Returns a value indicating whether the specified mask descriptor is valid, and provides an error description if it is
not valid.

ToString()
ToString()

Returns a string that represents the current object.


MaskDescriptor.Culture MaskDescriptor.Culture
I n this Article
Gets the CultureInfo representing the locale the mask is authored for.
public virtual System.Globalization.CultureInfo Culture { get; }
member this.Culture : System.Globalization.CultureInfo

Returns
CultureInfo CultureInfo
A CultureInfo representing the locale the mask is authored for.
See CultureInfoCultureInfo
Also
MaskDescriptor.Equals MaskDescriptor.Equals
I n this Article
Determines whether the specified MaskDescriptor is equal to the current MaskDescriptor.
public override bool Equals (object maskDescriptor);
override this.Equals : obj -> bool

Parameters
maskDescriptor Object Object
The MaskDescriptor to compare with the current MaskDescriptor.
Returns
Boolean Boolean
true if the specified MaskDescriptor is equal to the current MaskDescriptor; otherwise, false .

Remarks
The Equals method determines whether maskDescriptor and the current mask descriptor describe the same mask.
This method returns true if the following conditions are met in both mask descriptors.
1. The Mask property is the same for both mask descriptors.
2. The validating type is the same for both mask descriptors.
Note

The Name property is not considered, because the MaskedTextProvider and MaskedTextBox classes do not use it.
See CultureInfoCultureInfo
Also
MaskDescriptor.GetHashCode MaskDescriptor.GetHash
Code
I n this Article
Serves as a hash function for a particular type.

public override int GetHashCode ();


override this.GetHashCode : unit -> int

Returns
Int32 Int32
A hash code for the current Object.
MaskDescriptor.IsValidMaskDescriptor MaskDescriptor.Is
ValidMaskDescriptor
I n this Article

Overloads
IsValidMaskDescriptor(MaskDescriptor) IsValidMaskDescriptor(
MaskDescriptor) Returns a value indicating whether the specified mask
descriptor is valid and can be added to the masks list.

IsValidMaskDescriptor(MaskDescriptor, String) IsValidMask


Descriptor(MaskDescriptor, String) Returns a value indicating whether the specified mask
descriptor is valid, and provides an error description if it is not
valid.

IsValidMaskDescriptor(MaskDescriptor)
IsValidMaskDescriptor(MaskDescriptor)
Returns a value indicating whether the specified mask descriptor is valid and can be added to the masks list.
public static bool IsValidMaskDescriptor (System.Windows.Forms.Design.MaskDescriptor
maskDescriptor);
static member IsValidMaskDescriptor : System.Windows.Forms.Design.MaskDescriptor -> bool

Parameters
maskDescriptor MaskDescriptor MaskDescriptor
The mask descriptor to test for validity.
Returns
Boolean Boolean
true if maskDescriptor is valid; otherwise, false .
Remarks
The IsValidMaskDescriptor method determines whether maskDescriptor is valid and can be added to the masks list.
A valid MaskDescriptor must meet the following conditions.
Not null .
Not null or an empty mask.
Not null or an empty name.
Not null or an empty sample.

The sample is correct based on the mask and all required edit characters have been provided. This means the mask is
completed but not necessarily full.
The sample is valid based on the ValidatingType object, if any.
See ValidatingTypeValidatingType
Also

IsValidMaskDescriptor(MaskDescriptor, String)
IsValidMaskDescriptor(MaskDescriptor, String)
Returns a value indicating whether the specified mask descriptor is valid, and provides an error description if it is not
valid.
public static bool IsValidMaskDescriptor (System.Windows.Forms.Design.MaskDescriptor maskDescriptor,
out string validationErrorDescription);
static member IsValidMaskDescriptor : System.Windows.Forms.Design.MaskDescriptor * -> bool

Parameters
maskDescriptor MaskDescriptor MaskDescriptor
The mask descriptor to test for validity.
validationErrorDescription String String
A string representing a validation error. If no validation error occurred, the validationErrorDescription is Empty.

Returns
Boolean Boolean
true if maskDescriptor is valid; otherwise, false .
Remarks
The IsValidMaskDescriptor method determines whether maskDescriptor is valid and can be added to the masks list.

A valid MaskDescriptor must meet the following conditions.


Not null .
Not null or an empty mask.

Not null or an empty name.


Not null or an empty sample.

The sample is correct based on the mask and all required edit characters have been provided. This means the mask is
completed but not necessarily full.
The sample is valid based on the ValidatingType object, if any.
See ValidatingTypeValidatingType
Also
MaskDescriptor.Mask MaskDescriptor.Mask
I n this Article
Gets the mask being defined.
public abstract string Mask { get; }
member this.Mask : string

Returns
String String
A String containing the mask being defined.

Remarks
The mask must contain only valid characters, as defined by the IsValidMaskChar method of the MaskedTextProvider
class. When a predefined mask is selected in Visual Studio, its Mask property is displayed.
See NameName
Also SampleSample
MaskDescriptor
I n this Article
Initializes a new instance of the MaskDescriptor class.
protected MaskDescriptor ();

Remarks
MaskDescriptor is a compiler-supplied default constructor. A default constructor is required by the
ITypeDiscoveryService service provider.
MaskDescriptor.Name MaskDescriptor.Name
I n this Article
Gets the user-friendly name of the mask.
public abstract string Name { get; }
member this.Name : string

Returns
String String
A String containing the name or brief description of the Mask.

Remarks
The Name property is displayed in the Mask Description column in the visual editor for the MaskedTextBox control.
See MaskMask
Also
MaskDescriptor.Sample MaskDescriptor.Sample
I n this Article
Gets a sample of a formatted string for the mask.
public abstract string Sample { get; }
member this.Sample : string

Returns
String String
A String containing text that is formatted by using the Mask.

Remarks
The Sample property is displayed in the Data Format column in the visual editor for the MaskedTextBox control.
See MaskMask
Also
MaskDescriptor.ToString MaskDescriptor.ToString
I n this Article
Returns a string that represents the current object.
public override string ToString ();
override this.ToString : unit -> string

Returns
String String
A string that represents the current object.
MaskDescriptor.ValidatingType MaskDescriptor.Validating
Type
I n this Article
Gets the type providing validation associated with the mask.

public abstract Type ValidatingType { get; }


member this.ValidatingType : Type

Returns
Type Type
The Type that the formatted string is validated against.

Remarks
The ValidatingType property is used to validate the input string after the mask has been applied to it. It directly
corresponds to the MaskedTextBox.ValidatingType property of the MaskedTextBox class.
See MaskMask
Also
MenuCommands MenuCommands Class
Defines a set of CommandID fields that each correspond to a command function provided by the host environment.

D eclaration
public sealed class MenuCommands : System.ComponentModel.Design.StandardCommands
type MenuCommands = class
inherit StandardCommands

I nheritance H ierarchy
Object Object
StandardCommands StandardCommands

Remarks
MenuCommands contains a set of CommandID fields that can be used to specify a command to link when adding a
command using the AddCommand method of the IMenuCommandService.

Constructors
MenuCommands()
MenuCommands()

Initializes a new instance of the MenuCommands class.

Fields
ComponentTrayMenu
ComponentTrayMenu

A CommandID that can be used to access the component tray menu.

ContainerMenu
ContainerMenu

A CommandID that can be used to access the container menu.

DesignerProperties
DesignerProperties

A CommandID that can be used to access the properties page for the designer.

EditLabel
EditLabel

A CommandID that can be used to access the edit label handler.


KeyCancel
KeyCancel

A CommandID that can be used to access the cancel key handler.

KeyDefaultAction
KeyDefaultAction

A CommandID that can be used to access the default key handler.

KeyEnd
KeyEnd

A CommandID that can be used to access the end key handler.

KeyHome
KeyHome

A CommandID that can be used to access the home key handler.

KeyInvokeSmartTag
KeyInvokeSmartTag

A CommandID that can be used to access the smart tag invocation handler.

KeyMoveDown
KeyMoveDown

A CommandID that can be used to access the move down key handler.

KeyMoveLeft
KeyMoveLeft

A CommandID that can be used to access the move left key handler.

KeyMoveRight
KeyMoveRight

A CommandID that can be used to access the move right key handler.

KeyMoveUp
KeyMoveUp

A CommandID that can be used to access the move up key handler.


KeyNudgeDown
KeyNudgeDown

A CommandID that can be used to access the nudge down key handler.

KeyNudgeHeightDecrease
KeyNudgeHeightDecrease

A CommandID that can be used to access the nudge height decrease key handler.

KeyNudgeHeightIncrease
KeyNudgeHeightIncrease

A CommandID that can be used to access the nudge height increase key handler.

KeyNudgeLeft
KeyNudgeLeft

A CommandID that can be used to access the nudge left key handler.

KeyNudgeRight
KeyNudgeRight

A CommandID that can be used to access the nudge right key handler.

KeyNudgeUp
KeyNudgeUp

A CommandID that can be used to access the nudge up key handler.

KeyNudgeWidthDecrease
KeyNudgeWidthDecrease

A CommandID that can be used to access the nudge width decrease key handler.

KeyNudgeWidthIncrease
KeyNudgeWidthIncrease

A CommandID that can be used to access the nudge width increase key handler.

KeyReverseCancel
KeyReverseCancel

A CommandID that can be used to access the reverse cancel key handler.
KeySelectNext
KeySelectNext

A CommandID that can be used to access the select next key handler.

KeySelectPrevious
KeySelectPrevious

A CommandID that can be used to access the select previous key handler.

KeyShiftEnd
KeyShiftEnd

A CommandID that can be used to access the SHIFT-END key handler.

KeyShiftHome
KeyShiftHome

A CommandID that can be used to access the SHIFT-HOME key handler.

KeySizeHeightDecrease
KeySizeHeightDecrease

A CommandID that can be used to access the size height decrease key handler.

KeySizeHeightIncrease
KeySizeHeightIncrease

A CommandID that can be used to access the size height increase key handler.

KeySizeWidthDecrease
KeySizeWidthDecrease

A CommandID that can be used to access the size width decrease key handler.

KeySizeWidthIncrease
KeySizeWidthIncrease

A CommandID that can be used to access the size width increase key handler.

KeyTabOrderSelect
KeyTabOrderSelect

A CommandID that can be used to access the tab order select key handler.
SelectionMenu
SelectionMenu

A CommandID that can be used to access the selection menu.

SetStatusRectangle
SetStatusRectangle

A CommandID that can be used to set the status rectangle.

SetStatusText
SetStatusText

A CommandID that can be used to set the status rectangle text.

TraySelectionMenu
TraySelectionMenu

A CommandID that can be used to access the tray selection menu.


MenuCommands.ComponentTrayMenu Menu
Commands.ComponentTrayMenu
I n this Article
A CommandID that can be used to access the component tray menu.

public static readonly System.ComponentModel.Design.CommandID ComponentTrayMenu;


staticval mutable ComponentTrayMenu : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.ContainerMenu MenuCommands.
ContainerMenu
I n this Article
A CommandID that can be used to access the container menu.

public static readonly System.ComponentModel.Design.CommandID ContainerMenu;


staticval mutable ContainerMenu : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.DesignerProperties MenuCommands.
DesignerProperties
I n this Article
A CommandID that can be used to access the properties page for the designer.

public static readonly System.ComponentModel.Design.CommandID DesignerProperties;


staticval mutable DesignerProperties : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.EditLabel MenuCommands.EditLabel
I n this Article
A CommandID that can be used to access the edit label handler.
public static readonly System.ComponentModel.Design.CommandID EditLabel;
staticval mutable EditLabel : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyCancel MenuCommands.KeyCancel
I n this Article
A CommandID that can be used to access the cancel key handler.
public static readonly System.ComponentModel.Design.CommandID KeyCancel;
staticval mutable KeyCancel : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyDefaultAction MenuCommands.Key
DefaultAction
I n this Article
A CommandID that can be used to access the default key handler.

public static readonly System.ComponentModel.Design.CommandID KeyDefaultAction;


staticval mutable KeyDefaultAction : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyEnd MenuCommands.KeyEnd
I n this Article
A CommandID that can be used to access the end key handler.
public static readonly System.ComponentModel.Design.CommandID KeyEnd;
staticval mutable KeyEnd : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyHome MenuCommands.KeyHome
I n this Article
A CommandID that can be used to access the home key handler.
public static readonly System.ComponentModel.Design.CommandID KeyHome;
staticval mutable KeyHome : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyInvokeSmartTag MenuCommands.
KeyInvokeSmartTag
I n this Article
A CommandID that can be used to access the smart tag invocation handler.

public static readonly System.ComponentModel.Design.CommandID KeyInvokeSmartTag;


staticval mutable KeyInvokeSmartTag : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyMoveDown MenuCommands.Key
MoveDown
I n this Article
A CommandID that can be used to access the move down key handler.

public static readonly System.ComponentModel.Design.CommandID KeyMoveDown;


staticval mutable KeyMoveDown : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyMoveLeft MenuCommands.Key
MoveLeft
I n this Article
A CommandID that can be used to access the move left key handler.

public static readonly System.ComponentModel.Design.CommandID KeyMoveLeft;


staticval mutable KeyMoveLeft : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyMoveRight MenuCommands.Key
MoveRight
I n this Article
A CommandID that can be used to access the move right key handler.

public static readonly System.ComponentModel.Design.CommandID KeyMoveRight;


staticval mutable KeyMoveRight : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyMoveUp MenuCommands.KeyMove
Up
I n this Article
A CommandID that can be used to access the move up key handler.

public static readonly System.ComponentModel.Design.CommandID KeyMoveUp;


staticval mutable KeyMoveUp : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeDown MenuCommands.Key
NudgeDown
I n this Article
A CommandID that can be used to access the nudge down key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeDown;


staticval mutable KeyNudgeDown : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeHeightDecrease Menu
Commands.KeyNudgeHeightDecrease
I n this Article
A CommandID that can be used to access the nudge height decrease key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeHeightDecrease;


staticval mutable KeyNudgeHeightDecrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeHeightIncrease Menu
Commands.KeyNudgeHeightIncrease
I n this Article
A CommandID that can be used to access the nudge height increase key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeHeightIncrease;


staticval mutable KeyNudgeHeightIncrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeLeft MenuCommands.Key
NudgeLeft
I n this Article
A CommandID that can be used to access the nudge left key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeLeft;


staticval mutable KeyNudgeLeft : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeRight MenuCommands.Key
NudgeRight
I n this Article
A CommandID that can be used to access the nudge right key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeRight;


staticval mutable KeyNudgeRight : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeUp MenuCommands.Key
NudgeUp
I n this Article
A CommandID that can be used to access the nudge up key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeUp;


staticval mutable KeyNudgeUp : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeWidthDecrease Menu
Commands.KeyNudgeWidthDecrease
I n this Article
A CommandID that can be used to access the nudge width decrease key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeWidthDecrease;


staticval mutable KeyNudgeWidthDecrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyNudgeWidthIncrease Menu
Commands.KeyNudgeWidthIncrease
I n this Article
A CommandID that can be used to access the nudge width increase key handler.

public static readonly System.ComponentModel.Design.CommandID KeyNudgeWidthIncrease;


staticval mutable KeyNudgeWidthIncrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyReverseCancel MenuCommands.
KeyReverseCancel
I n this Article
A CommandID that can be used to access the reverse cancel key handler.

public static readonly System.ComponentModel.Design.CommandID KeyReverseCancel;


staticval mutable KeyReverseCancel : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySelectNext MenuCommands.Key
SelectNext
I n this Article
A CommandID that can be used to access the select next key handler.

public static readonly System.ComponentModel.Design.CommandID KeySelectNext;


staticval mutable KeySelectNext : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySelectPrevious MenuCommands.Key
SelectPrevious
I n this Article
A CommandID that can be used to access the select previous key handler.

public static readonly System.ComponentModel.Design.CommandID KeySelectPrevious;


staticval mutable KeySelectPrevious : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyShiftEnd MenuCommands.KeyShift
End
I n this Article
A CommandID that can be used to access the SHIFT-END key handler.

public static readonly System.ComponentModel.Design.CommandID KeyShiftEnd;


staticval mutable KeyShiftEnd : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyShiftHome MenuCommands.Key
ShiftHome
I n this Article
A CommandID that can be used to access the SHIFT-HOME key handler.

public static readonly System.ComponentModel.Design.CommandID KeyShiftHome;


staticval mutable KeyShiftHome : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySizeHeightDecrease Menu
Commands.KeySizeHeightDecrease
I n this Article
A CommandID that can be used to access the size height decrease key handler.

public static readonly System.ComponentModel.Design.CommandID KeySizeHeightDecrease;


staticval mutable KeySizeHeightDecrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySizeHeightIncrease Menu
Commands.KeySizeHeightIncrease
I n this Article
A CommandID that can be used to access the size height increase key handler.

public static readonly System.ComponentModel.Design.CommandID KeySizeHeightIncrease;


staticval mutable KeySizeHeightIncrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySizeWidthDecrease Menu
Commands.KeySizeWidthDecrease
I n this Article
A CommandID that can be used to access the size width decrease key handler.

public static readonly System.ComponentModel.Design.CommandID KeySizeWidthDecrease;


staticval mutable KeySizeWidthDecrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeySizeWidthIncrease Menu
Commands.KeySizeWidthIncrease
I n this Article
A CommandID that can be used to access the size width increase key handler.

public static readonly System.ComponentModel.Design.CommandID KeySizeWidthIncrease;


staticval mutable KeySizeWidthIncrease : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.KeyTabOrderSelect MenuCommands.
KeyTabOrderSelect
I n this Article
A CommandID that can be used to access the tab order select key handler.

public static readonly System.ComponentModel.Design.CommandID KeyTabOrderSelect;


staticval mutable KeyTabOrderSelect : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands
I n this Article
Initializes a new instance of the MenuCommands class.
public MenuCommands ();
MenuCommands.SelectionMenu MenuCommands.
SelectionMenu
I n this Article
A CommandID that can be used to access the selection menu.

public static readonly System.ComponentModel.Design.CommandID SelectionMenu;


staticval mutable SelectionMenu : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.SetStatusRectangle MenuCommands.
SetStatusRectangle
I n this Article
A CommandID that can be used to set the status rectangle.

public static readonly System.ComponentModel.Design.CommandID SetStatusRectangle;


staticval mutable SetStatusRectangle : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.SetStatusText MenuCommands.Set
StatusText
I n this Article
A CommandID that can be used to set the status rectangle text.

public static readonly System.ComponentModel.Design.CommandID SetStatusText;


staticval mutable SetStatusText : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
MenuCommands.TraySelectionMenu MenuCommands.
TraySelectionMenu
I n this Article
A CommandID that can be used to access the tray selection menu.

public static readonly System.ComponentModel.Design.CommandID TraySelectionMenu;


staticval mutable TraySelectionMenu : System.ComponentModel.Design.CommandID

Returns
CommandID CommandID
ParentControlDesigner ParentControlDesigner Class
Extends the design mode behavior of a Control that supports nested controls.

D eclaration
[System.CLSCompliant(false)]
public class ParentControlDesigner : System.Windows.Forms.Design.ControlDesigner
type ParentControlDesigner = class
inherit ControlDesigner

I nheritance H ierarchy
Object Object
ComponentDesigner ComponentDesigner
ControlDesigner ControlDesigner

Remarks
ParentControlDesigner provides a base class for designers of controls that can contain child controls. In addition to the
methods and functionality inherited from the ControlDesigner and ComponentDesigner classes,
ParentControlDesigner enables child controls to be added to, removed from, selected within, and arranged within the
control whose behavior it extends at design time.
You can associate a designer with a type using a DesignerAttribute. For an overview of customizing design time
behavior, see Extending Design-Time Support.

Constructors
ParentControlDesigner()
ParentControlDesigner()

Initializes a new instance of the ParentControlDesigner class.

Properties
AllowControlLasso
AllowControlLasso

Gets a value indicating whether selected controls will be re-parented.

AllowGenericDragBox
AllowGenericDragBox

Gets a value indicating whether a generic drag box should be drawn when dragging a toolbox item over the
designer's surface.

AllowSetChildIndexOnDrop
AllowSetChildIndexOnDrop

Gets a value indicating whether the z-order of dragged controls should be maintained when dropped on a
ParentControlDesigner.

DefaultControlLocation
DefaultControlLocation

Gets the default location for a control added to the designer.

DrawGrid
DrawGrid

Gets or sets a value indicating whether a grid should be drawn on the control for this designer.

EnableDragRect
EnableDragRect

Gets a value indicating whether drag rectangles are drawn by the designer.

GridSize
GridSize

Gets or sets the size of each square of the grid that is drawn when the designer is in grid draw mode.

MouseDragTool
MouseDragTool

Gets a value indicating whether the designer has a valid tool during a drag operation.

SnapLines
SnapLines

Gets a list of SnapLine objects representing significant alignment points for this control.

Methods
AddPaddingSnapLines(ArrayList)
AddPaddingSnapLines(ArrayList)

Adds padding snaplines.

CanAddComponent(IComponent)
CanAddComponent(IComponent)

Called when a component is added to the parent container.


CanParent(Control)
CanParent(Control)

Indicates whether the specified control can be a child of the control managed by this designer.

CanParent(ControlDesigner)
CanParent(ControlDesigner)

Indicates whether the control managed by the specified designer can be a child of the control managed by this
designer.

CreateTool(ToolboxItem, Point)
CreateTool(ToolboxItem, Point)

Creates a component or control from the specified tool and adds it to the current design document at the specified
location.

CreateTool(ToolboxItem, Rectangle)
CreateTool(ToolboxItem, Rectangle)

Creates a component or control from the specified tool and adds it to the current design document within the
bounds of the specified rectangle.

CreateTool(ToolboxItem)
CreateTool(ToolboxItem)

Creates a component or control from the specified tool and adds it to the current design document.

CreateToolCore(ToolboxItem, Int32, Int32, Int32, Int32, Boolean, Boolean)


CreateToolCore(ToolboxItem, Int32, Int32, Int32, Int32, Boolean, Boolean)

Provides core functionality for all the CreateTool(ToolboxItem) methods.

Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the ParentControlDesigner, and optionally releases the managed
resources.

GetControl(Object)
GetControl(Object)

Gets the control from the designer of the specified component.

GetControlGlyph(GlyphSelectionType)
GetControlGlyph(GlyphSelectionType)

Gets a body glyph that represents the bounds of the control.

GetGlyphs(GlyphSelectionType)
GetGlyphs(GlyphSelectionType)

Gets a collection of Glyph objects representing the selection borders and grab handles for a standard control.

GetParentForComponent(IComponent)
GetParentForComponent(IComponent)

Used by deriving classes to determine if it returns the control being designed or some other Container while
adding a component to it.

GetUpdatedRect(Rectangle, Rectangle, Boolean)


GetUpdatedRect(Rectangle, Rectangle, Boolean)

Updates the position of the specified rectangle, adjusting it for grid alignment if grid alignment mode is enabled.

Initialize(IComponent)
Initialize(IComponent)

Initializes the designer with the specified component.

InitializeNewComponent(IDictionary)
InitializeNewComponent(IDictionary)

Initializes a newly created component.

InvokeCreateTool(ParentControlDesigner, ToolboxItem)
InvokeCreateTool(ParentControlDesigner, ToolboxItem)

Creates a tool from the specified ToolboxItem.

OnDragComplete(DragEventArgs)
OnDragComplete(DragEventArgs)

Called in order to clean up a drag-and-drop operation.

OnDragDrop(DragEventArgs)
OnDragDrop(DragEventArgs)

Called when a drag-and-drop object is dropped onto the control designer view.
OnDragEnter(DragEventArgs)
OnDragEnter(DragEventArgs)

Called when a drag-and-drop operation enters the control designer view.

OnDragLeave(EventArgs)
OnDragLeave(EventArgs)

Called when a drag-and-drop operation leaves the control designer view.

OnDragOver(DragEventArgs)
OnDragOver(DragEventArgs)

Called when a drag-and-drop object is dragged over the control designer view.

OnGiveFeedback(GiveFeedbackEventArgs)
OnGiveFeedback(GiveFeedbackEventArgs)

OnMouseDragBegin(Int32, Int32)
OnMouseDragBegin(Int32, Int32)

Called in response to the left mouse button being pressed and held while over the component.

OnMouseDragEnd(Boolean)
OnMouseDragEnd(Boolean)

Called at the end of a drag-and-drop operation to complete or cancel the operation.

OnMouseDragMove(Int32, Int32)
OnMouseDragMove(Int32, Int32)

Called for each movement of the mouse during a drag-and-drop operation.

OnMouseEnter()
OnMouseEnter()

OnMouseHover()
OnMouseHover()

OnMouseLeave()
OnMouseLeave()
OnPaintAdornments(PaintEventArgs)
OnPaintAdornments(PaintEventArgs)

Called 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.

OnSetCursor()
OnSetCursor()

Provides an opportunity to change the current mouse cursor.

PreFilterProperties(IDictionary)
PreFilterProperties(IDictionary)

Adjusts the set of properties the component will expose through a TypeDescriptor.

WndProc(Message)
WndProc(Message)

See Also
ControlDesigner ControlDesigner
ControlDesigner ControlDesigner
ParentControlDesigner.AddPaddingSnapLines Parent
ControlDesigner.AddPaddingSnapLines
I n this Article
Adds padding snaplines.

protected void AddPaddingSnapLines (ref System.Collections.ArrayList snapLines);


member this.AddPaddingSnapLines : -> unit

Parameters
snapLines ArrayList ArrayList
An ArrayList that contains SnapLine objects.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.AllowControlLasso ParentControl
Designer.AllowControlLasso
I n this Article
Gets a value indicating whether selected controls will be re-parented.

protected virtual bool AllowControlLasso { get; }


member this.AllowControlLasso : bool

Returns
Boolean Boolean
true if the controls that were selected by lassoing on the designer's surface will be re-parented to this designer's
control.

Remarks
The AllowControlLasso method is called after the user selects a toolbox item that has a ParentControlDesigner
associated with it. It draws a reversible rectangle on a designer's surface.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.AllowGenericDragBox Parent
ControlDesigner.AllowGenericDragBox
I n this Article
Gets a value indicating whether a generic drag box should be drawn when dragging a toolbox item over the designer's
surface.
protected virtual bool AllowGenericDragBox { get; }
member this.AllowGenericDragBox : bool

Returns
Boolean Boolean
true if a generic drag box should be drawn when dragging a toolbox item over the designer's surface; otherwise,
false . The default is true .

See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.AllowSetChildIndexOnDrop
ParentControlDesigner.AllowSetChildIndexOnDrop
I n this Article
Gets a value indicating whether the z-order of dragged controls should be maintained when dropped on a
ParentControlDesigner.
protected internal virtual bool AllowSetChildIndexOnDrop { get; }
member this.AllowSetChildIndexOnDrop : bool

Returns
Boolean Boolean
true if the z-order of dragged controls should be maintained when dropped on a ParentControlDesigner; otherwise,
false .

Remarks
By default the z-order of dragged controls is maintained when dropped on a ParentControlDesigner.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.CanAddComponent Parent
ControlDesigner.CanAddComponent
I n this Article
Called when a component is added to the parent container.

protected internal virtual bool CanAddComponent (System.ComponentModel.IComponent component);


abstract member CanAddComponent : System.ComponentModel.IComponent -> bool
override this.CanAddComponent : System.ComponentModel.IComponent -> bool

Parameters
component IComponent IComponent
The component to test for errors.
Returns
Boolean Boolean
true if component can be added; otherwise, false .

Remarks
Similar to the IsDropOK method, but allows for specific error messages. This method provides a chance to display the
same error as is displayed at runtime.
ParentControlDesigner.CanParent ParentControlDesigner.
CanParent
I n this Article

Overloads
CanParent(Control) CanParent(Control)
Indicates whether the specified control can be a child of the
control managed by this designer.

CanParent(ControlDesigner) CanParent(ControlDesigner)
Indicates whether the control managed by the specified
designer can be a child of the control managed by this
designer.

CanParent(Control) CanParent(Control)
Indicates whether the specified control can be a child of the control managed by this designer.
public virtual bool CanParent (System.Windows.Forms.Control control);
abstract member CanParent : System.Windows.Forms.Control -> bool
override this.CanParent : System.Windows.Forms.Control -> bool

Parameters
control Control Control
The Control to test.
Returns
Boolean Boolean
true if the specified control can be a child of the control managed by this designer; otherwise, false .
Remarks
This method indicates whether the control managed by the designer can parent the specified ControlDesigner.
See ControlDesignerControlDesigner
Also Extending Design-Time Support

CanParent(ControlDesigner) CanParent(ControlDesigner)
Indicates whether the control managed by the specified designer can be a child of the control managed by this
designer.
public virtual bool CanParent (System.Windows.Forms.Design.ControlDesigner controlDesigner);
abstract member CanParent : System.Windows.Forms.Design.ControlDesigner -> bool
override this.CanParent : System.Windows.Forms.Design.ControlDesigner -> bool

Parameters
controlDesigner ControlDesigner ControlDesigner
The designer for the control to test.
Returns
Boolean Boolean
true if the control managed by the specified designer can be a child of the control managed by this designer;
otherwise, false .
Remarks
This method indicates whether the control managed by this designer can parent the control of the specified
ControlDesigner.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.CreateTool ParentControl
Designer.CreateTool
I n this Article

Overloads
CreateTool(ToolboxItem, Point) CreateTool(ToolboxItem, Point)
Creates a component or control from the specified tool and
adds it to the current design document at the specified
location.

CreateTool(ToolboxItem, Rectangle) CreateTool(ToolboxItem,


Rectangle) Creates a component or control from the specified tool and
adds it to the current design document within the bounds of
the specified rectangle.

CreateTool(ToolboxItem) CreateTool(ToolboxItem)
Creates a component or control from the specified tool and
adds it to the current design document.

CreateTool(ToolboxItem, Point) CreateTool(ToolboxItem, Point)


Creates a component or control from the specified tool and adds it to the current design document at the specified
location.
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Point location);
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Point -> unit

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component from.
location Point Point
The Point, in design-time view screen coordinates, at which to center the component.
Attributes CLSCompliantAttribute
Remarks
The new component or control is positioned around the location specified by the location parameter. This method
uses the default size for the tool's component, if the component has a default size.
To specify a location and size for the component or control, use the appropriate overloaded CreateTool method.
See ControlDesignerControlDesigner
Also Extending Design-Time Support

CreateTool(ToolboxItem, Rectangle) CreateTool(ToolboxItem,


Rectangle)
Creates a component or control from the specified tool and adds it to the current design document within the bounds
of the specified rectangle.
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Rectangle bounds);
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Rectangle -> unit

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component from.
bounds Rectangle Rectangle
A Rectangle indicating the location and size for the component created from the tool. The X and Y values of the
Rectangle indicate the design-time view screen coordinates of the upper-left corner of the component.
Attributes CLSCompliantAttribute
Remarks
The new component or control is positioned with its upper left corner at the location specified by the X and Y values of
the bounds parameter. The size of the new component or control will be set to the values specified by the Height and
Width properties of the bounds parameter.
See ControlDesignerControlDesigner
Also Extending Design-Time Support

CreateTool(ToolboxItem) CreateTool(ToolboxItem)
Creates a component or control from the specified tool and adds it to the current design document.
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool);
member this.CreateTool : System.Drawing.Design.ToolboxItem -> unit

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component from.
Attributes CLSCompliantAttribute
Remarks
The new component or control is positioned at the center of the currently selected control. This method uses the
default size for the tool, if the tool has a default size specified.
To specify a location or location and size for the component or control, use one of the other overloaded CreateTool
methods.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.CreateToolCore ParentControl
Designer.CreateToolCore
I n this Article
Provides core functionality for all the CreateTool(ToolboxItem) methods.

[System.CLSCompliant(false)]
protected virtual System.ComponentModel.IComponent[] CreateToolCore
(System.Drawing.Design.ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool
hasSize);
abstract member CreateToolCore : System.Drawing.Design.ToolboxItem * int * int * int * int * bool *
bool -> System.ComponentModel.IComponent[]
override this.CreateToolCore : System.Drawing.Design.ToolboxItem * int * int * int * int * bool *
bool -> System.ComponentModel.IComponent[]

Parameters
tool ToolboxItem ToolboxItem
The ToolboxItem to create a component from.
x Int32 Int32
The horizontal position, in design-time view coordinates, of the location of the left edge of the tool, if a size is specified;
the horizontal position of the center of the tool, if no size is specified.
y Int32 Int32
The vertical position, in design-time view coordinates, of the location of the top edge of the tool, if a size is specified;
the vertical position of the center of the tool, if no size is specified.
width Int32 Int32
The width of the tool. This parameter is ignored if the hasSize parameter is set to false .
height Int32 Int32
The height of the tool. This parameter is ignored if the hasSize parameter is set to false .
hasLocation Boolean Boolean
true if a location for the component is specified; false if the component is to be positioned in the center of the
currently selected control.
hasSize Boolean Boolean
true if a size for the component is specified; false if the default height and width values for the component are to be
used.
Returns
IComponent[]
An array of components created from the tool.
Attributes CLSCompliantAttribute

Remarks
This is the only CreateTool method that can be overridden.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.DefaultControlLocation Parent
ControlDesigner.DefaultControlLocation
I n this Article
Gets the default location for a control added to the designer.

protected virtual System.Drawing.Point DefaultControlLocation { get; }


member this.DefaultControlLocation : System.Drawing.Point

Returns
Point Point
A Point that indicates the default location for a control added to the designer.

Remarks
The default location is usually (0,0). The default location is typically changed if the container has special borders, or for
other reasons.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.Dispose ParentControlDesigner.
Dispose
I n this Article
Releases the unmanaged resources used by the ParentControlDesigner, and optionally releases the managed
resources.
protected override void Dispose (bool disposing);
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.

Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true, this method releases all resources held by any managed objects that this
ParentControlDesigner references. This method invokes the Dispose() method of each referenced object.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.DrawGrid ParentControlDesigner.
DrawGrid
I n this Article
Gets or sets a value indicating whether a grid should be drawn on the control for this designer.

protected virtual bool DrawGrid { get; set; }


member this.DrawGrid : bool with get, set

Returns
Boolean Boolean
true if a grid should be drawn on the control in the designer; otherwise, false .

See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.EnableDragRect ParentControl
Designer.EnableDragRect
I n this Article
Gets a value indicating whether drag rectangles are drawn by the designer.

protected override bool EnableDragRect { get; }


member this.EnableDragRect : bool

Returns
Boolean Boolean
true if drag rectangles are drawn; otherwise, false . The default is true .

See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GetControl ParentControl
Designer.GetControl
I n this Article
Gets the control from the designer of the specified component.

protected System.Windows.Forms.Control GetControl (object component);


member this.GetControl : obj -> System.Windows.Forms.Control

Parameters
component Object Object
The component to retrieve the control for.
Returns
Control Control
The Control that the specified component belongs to.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GetControlGlyph ParentControl
Designer.GetControlGlyph
I n this Article
Gets a body glyph that represents the bounds of the control.

protected override System.Windows.Forms.Design.Behavior.ControlBodyGlyph GetControlGlyph


(System.Windows.Forms.Design.Behavior.GlyphSelectionType selectionType);
override this.GetControlGlyph : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.ControlBodyGlyph

Parameters
selectionType GlyphSelectionType GlyphSelectionType
A GlyphSelectionType value that specifies the selection state.
Returns
ControlBodyGlyph ControlBodyGlyph
A body glyph that represents the bounds of the control.

Remarks
The body glyph is responsible for hit testing the control's designer and forwarding messages directly to the designer.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GetGlyphs ParentControlDesigner.
GetGlyphs
I n this Article
Gets a collection of Glyph objects representing the selection borders and grab handles for a standard control.

public override System.Windows.Forms.Design.Behavior.GlyphCollection GetGlyphs


(System.Windows.Forms.Design.Behavior.GlyphSelectionType selectionType);
override this.GetGlyphs : System.Windows.Forms.Design.Behavior.GlyphSelectionType ->
System.Windows.Forms.Design.Behavior.GlyphCollection

Parameters
selectionType GlyphSelectionType GlyphSelectionType
A GlyphSelectionType value that specifies the selection state.
Returns
GlyphCollection GlyphCollection
A collection of Glyph objects.

Remarks
The GetGlyphs method adds a container selector Glyph to the selection glyphs collection.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GetParentForComponent Parent
ControlDesigner.GetParentForComponent
I n this Article
Used by deriving classes to determine if it returns the control being designed or some other Container while adding a
component to it.
protected virtual System.Windows.Forms.Control GetParentForComponent
(System.ComponentModel.IComponent component);
abstract member GetParentForComponent : System.ComponentModel.IComponent ->
System.Windows.Forms.Control
override this.GetParentForComponent : System.ComponentModel.IComponent ->
System.Windows.Forms.Control

Parameters
component IComponent IComponent
The component for which to retrieve the parent Control.
Returns
Control Control
The parent Control for the component.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GetUpdatedRect ParentControl
Designer.GetUpdatedRect
I n this Article
Updates the position of the specified rectangle, adjusting it for grid alignment if grid alignment mode is enabled.

protected System.Drawing.Rectangle GetUpdatedRect (System.Drawing.Rectangle originalRect,


System.Drawing.Rectangle dragRect, bool updateSize);
member this.GetUpdatedRect : System.Drawing.Rectangle * System.Drawing.Rectangle * bool ->
System.Drawing.Rectangle

Parameters
originalRect Rectangle Rectangle
A Rectangle indicating the initial position of the component being updated.
dragRect Rectangle Rectangle
A Rectangle indicating the new position of the component.
updateSize Boolean Boolean
true to update the size of the rectangle, if there has been any change; otherwise, false .
Returns
Rectangle Rectangle
A rectangle indicating the position of the component in design-time view screen coordinates. If no changes have been
made, this method returns the original rectangle.

Remarks
This method aligns the specified rectangle to the grid if grid alignment is enabled.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.GridSize ParentControlDesigner.
GridSize
I n this Article
Gets or sets the size of each square of the grid that is drawn when the designer is in grid draw mode.

protected System.Drawing.Size GridSize { get; set; }


member this.GridSize : System.Drawing.Size with get, set

Returns
Size Size
A Size that represents the size of each square of the grid drawn on a form or user control.
Exceptions
ArgumentException ArgumentException
Size is outside the allowed range for GridSize. The default minimum value is 2, and the default maximum value is 200.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.Initialize ParentControlDesigner.
Initialize
I n this Article
Initializes the designer with the specified component.

public override void Initialize (System.ComponentModel.IComponent component);


override this.Initialize : System.ComponentModel.IComponent -> unit

Parameters
component IComponent IComponent
The IComponent to associate with the designer.

Remarks
This method is called to initialize the designer with the specified primary component.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.InitializeNewComponent Parent
ControlDesigner.InitializeNewComponent
I n this Article
Initializes a newly created component.

public override void InitializeNewComponent (System.Collections.IDictionary defaultValues);


override this.InitializeNewComponent : System.Collections.IDictionary -> unit

Parameters
defaultValues IDictionary IDictionary
A name/value dictionary of default values to apply to properties. May be null if no default values are specified.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.InvokeCreateTool ParentControl
Designer.InvokeCreateTool
I n this Article
Creates a tool from the specified ToolboxItem.

[System.CLSCompliant(false)]
protected static void InvokeCreateTool (System.Windows.Forms.Design.ParentControlDesigner toInvoke,
System.Drawing.Design.ToolboxItem tool);
static member InvokeCreateTool : System.Windows.Forms.Design.ParentControlDesigner *
System.Drawing.Design.ToolboxItem -> unit

Parameters
toInvoke ParentControlDesigner ParentControlDesigner
The ParentControlDesigner that the tool is to be used with.
tool ToolboxItem ToolboxItem
The ToolboxItem to create a tool from.
Attributes CLSCompliantAttribute
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.MouseDragTool ParentControl
Designer.MouseDragTool
I n this Article
Gets a value indicating whether the designer has a valid tool during a drag operation.

[System.CLSCompliant(false)]
protected System.Drawing.Design.ToolboxItem MouseDragTool { get; }
member this.MouseDragTool : System.Drawing.Design.ToolboxItem

Returns
ToolboxItem ToolboxItem
The tool being dragged, if creating a component, or null if there is no tool.
Attributes CLSCompliantAttribute
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnDragComplete ParentControl
Designer.OnDragComplete
I n this Article
Called in order to clean up a drag-and-drop operation.

protected override void OnDragComplete (System.Windows.Forms.DragEventArgs de);


override this.OnDragComplete : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.

Remarks
OnDragComplete is used to clean up any operations that were performed at the beginning of a drag-and-drop
operation.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnDragDrop ParentControl
Designer.OnDragDrop
I n this Article
Called when a drag-and-drop object is dropped onto the control designer view.

protected override void OnDragDrop (System.Windows.Forms.DragEventArgs de);


override this.OnDragDrop : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.

Remarks
This method checks any parent control for a drag-and-drop handler that can handle the operation instead. If one exists,
this method passes the DragEventArgs to the method and returns. If no parent drag-and-drop handler exists, this
method attempts to create a tool if a toolbox item has been dropped on the designer control.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnDragEnter ParentControl
Designer.OnDragEnter
I n this Article
Called when a drag-and-drop operation enters the control designer view.

protected override void OnDragEnter (System.Windows.Forms.DragEventArgs de);


override this.OnDragEnter : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnDragLeave ParentControl
Designer.OnDragLeave
I n this Article
Called when a drag-and-drop operation leaves the control designer view.

protected override void OnDragLeave (EventArgs e);


override this.OnDragLeave : EventArgs -> unit

Parameters
e EventArgs EventArgs
An EventArgs that provides data for the event.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnDragOver ParentControl
Designer.OnDragOver
I n this Article
Called when a drag-and-drop object is dragged over the control designer view.

protected override void OnDragOver (System.Windows.Forms.DragEventArgs de);


override this.OnDragOver : System.Windows.Forms.DragEventArgs -> unit

Parameters
de DragEventArgs DragEventArgs
A DragEventArgs that provides data for the event.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnGiveFeedback ParentControl
Designer.OnGiveFeedback
I n this Article
protected override void OnGiveFeedback (System.Windows.Forms.GiveFeedbackEventArgs e);
override this.OnGiveFeedback : System.Windows.Forms.GiveFeedbackEventArgs -> unit

Parameters
e GiveFeedbackEventArgs GiveFeedbackEventArgs
ParentControlDesigner.OnMouseDragBegin Parent
ControlDesigner.OnMouseDragBegin
I n this Article
Called in response to the left mouse button being pressed and held while over the component.

protected override void OnMouseDragBegin (int x, int y);


override this.OnMouseDragBegin : int * int -> unit

Parameters
x Int32 Int32
The x-coordinate of the mouse in screen coordinates.
y Int32 Int32
The y-coordinate of the mouse in screen coordinates.

Remarks
This method is called in response to the left mouse button being pressed on a component. The designer overrides the
base form of this method to provide a "lasso" selection mechanism for components within the control.
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnMouseDragEnd ParentControl
Designer.OnMouseDragEnd
I n this Article
Called at the end of a drag-and-drop operation to complete or cancel the operation.

protected override void OnMouseDragEnd (bool cancel);


override this.OnMouseDragEnd : bool -> unit

Parameters
cancel Boolean Boolean
true to cancel the drag operation; false to commit it.

Remarks
This method is called at the end of a drag operation. This method either commits to or cancels the drag operation.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnMouseDragMove Parent
ControlDesigner.OnMouseDragMove
I n this Article
Called for each movement of the mouse during a drag-and-drop operation.

protected override void OnMouseDragMove (int x, int y);


override this.OnMouseDragMove : int * int -> unit

Parameters
x Int32 Int32
The x-coordinate of the mouse in screen coordinates.
y Int32 Int32
The y-coordinate of the mouse in screen coordinates.

Remarks
This method is called at the start of a drag-and-drop operation.
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnMouseEnter ParentControl
Designer.OnMouseEnter
I n this Article
protected override void OnMouseEnter ();
override this.OnMouseEnter : unit -> unit
ParentControlDesigner.OnMouseHover ParentControl
Designer.OnMouseHover
I n this Article
protected override void OnMouseHover ();
override this.OnMouseHover : unit -> unit
ParentControlDesigner.OnMouseLeave ParentControl
Designer.OnMouseLeave
I n this Article
protected override void OnMouseLeave ();
override this.OnMouseLeave : unit -> unit
ParentControlDesigner.OnPaintAdornments Parent
ControlDesigner.OnPaintAdornments
I n this Article
Called 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.
protected override void OnPaintAdornments (System.Windows.Forms.PaintEventArgs pe);
override this.OnPaintAdornments : System.Windows.Forms.PaintEventArgs -> unit

Parameters
pe PaintEventArgs PaintEventArgs
A PaintEventArgs that provides data for the event.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.OnSetCursor ParentControl
Designer.OnSetCursor
I n this Article
Provides an opportunity to change the current mouse cursor.

protected override void OnSetCursor ();


override this.OnSetCursor : unit -> unit

Remarks
This method sets the mouse cursor according to the following rules: If the toolbox service has a tool selected, it allows
the toolbox service to set the cursor. Otherwise, the mouse cursor is set to the default mouse cursor.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner
I n this Article
Initializes a new instance of the ParentControlDesigner class.
public ParentControlDesigner ();

See ControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.PreFilterProperties ParentControl
Designer.PreFilterProperties
I n this Article
Adjusts the set of properties the component will expose through a TypeDescriptor.

protected override void PreFilterProperties (System.Collections.IDictionary properties);


override this.PreFilterProperties : System.Collections.IDictionary -> unit

Parameters
properties IDictionary IDictionary
An IDictionary that contains the properties for the class of the component.

Remarks
This IDesignerFilter interface method override adds a set of properties to this designer's control that allow a user to set
options related to the grid display and child control alignment. This method adds the following browsable properties:
DrawGrid , SnapToGrid , and GridSize .

See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.SnapLines ParentControlDesigner.
SnapLines
I n this Article
Gets a list of SnapLine objects representing significant alignment points for this control.

public override System.Collections.IList SnapLines { get; }


member this.SnapLines : System.Collections.IList

Returns
IList IList
A list of SnapLine objects representing significant alignment points for this control.
See ControlDesignerControlDesigner
Also Extending Design-Time Support
ParentControlDesigner.WndProc ParentControlDesigner.
WndProc
I n this Article
protected override void WndProc (ref System.Windows.Forms.Message m);
override this.WndProc : -> unit

Parameters
m Message Message
PropertyTab PropertyTab Class
Provides a base class for property tabs.

D eclaration
public abstract class PropertyTab : System.ComponentModel.IExtenderProvider
type PropertyTab = class
interface IExtenderProvider

I nheritance H ierarchy
Object Object

Remarks
The PropertyTab class provides the base class behavior for a property tab. Property tabs are displayed on the toolbar of
the PropertyGrid control of the Properties window, and allow a component to display different views of its properties
or other data.
User code will usually not create an instance of a PropertyTab directly. Instead, a PropertyTabAttribute that indicates
the type of the property tab or property tabs to display for a component can be associated with the properties or types
that the PropertyTab should be displayed for.
The PropertyGrid will instantiate a PropertyTab of the type specified by a PropertyTabAttribute associated with the type
or property field of the component that is being browsed.

Constructors
PropertyTab()
PropertyTab()

Initializes a new instance of the PropertyTab class.

Properties
Bitmap
Bitmap

Gets the bitmap that is displayed for the PropertyTab.

Components
Components

Gets or sets the array of components the property tab is associated with.

HelpKeyword
HelpKeyword

Gets the Help keyword that is to be associated with this tab.


TabName
TabName

Gets the name for the property tab.

Methods
CanExtend(Object)
CanExtend(Object)

Gets a value indicating whether this PropertyTab can display properties for the specified component.

Dispose()
Dispose()

Releases all the resources used by the PropertyTab.

Dispose(Boolean)
Dispose(Boolean)

Releases the unmanaged resources used by the PropertyTab and optionally releases the managed resources.

Finalize()
Finalize()

Allows a PropertyTab to attempt to free resources and perform other cleanup operations before the PropertyTab is
reclaimed by garbage collection.

GetDefaultProperty(Object)
GetDefaultProperty(Object)

Gets the default property of the specified component.

GetProperties(Object)
GetProperties(Object)

Gets the properties of the specified component.

GetProperties(Object, Attribute[])
GetProperties(Object, Attribute[])

Gets the properties of the specified component that match the specified attributes.

GetProperties(ITypeDescriptorContext, Object, Attribute[])


GetProperties(ITypeDescriptorContext, Object, Attribute[])
Gets the properties of the specified component that match the specified attributes and context.
PropertyTab.Bitmap PropertyTab.Bitmap
I n this Article
Gets the bitmap that is displayed for the PropertyTab.
public virtual System.Drawing.Bitmap Bitmap { get; }
member this.Bitmap : System.Drawing.Bitmap

Returns
Bitmap Bitmap
The Bitmap to display for the PropertyTab.
PropertyTab.CanExtend PropertyTab.CanExtend
I n this Article
Gets a value indicating whether this PropertyTab can display properties for the specified component.
public virtual bool CanExtend (object extendee);
abstract member CanExtend : obj -> bool
override this.CanExtend : obj -> bool

Parameters
extendee Object Object
The object to test.
Returns
Boolean Boolean
true if the object can be extended; otherwise, false .
PropertyTab.Components PropertyTab.Components
I n this Article
Gets or sets the array of components the property tab is associated with.
public virtual object[] Components { get; set; }
member this.Components : obj[] with get, set

Returns
Object[]
The array of components the property tab is associated with.
PropertyTab.Dispose PropertyTab.Dispose
I n this Article

Overloads
Dispose() Dispose()
Releases all the resources used by the PropertyTab.

Dispose(Boolean) Dispose(Boolean)
Releases the unmanaged resources used by the PropertyTab
and optionally releases the managed resources.

Dispose() Dispose()
Releases all the resources used by the PropertyTab.
public virtual void Dispose ();
abstract member Dispose : unit -> unit
override this.Dispose : unit -> unit

Remarks
Call Dispose when you are finished using the PropertyTab. The Dispose method leaves the PropertyTab in an unusable
state. After calling Dispose, you must release all references to the PropertyTab so the garbage collector can reclaim the
memory that the PropertyTab was occupying. For more information, see Cleaning Up Unmanaged Resources and
Implementing a Dispose Method.
Note

Always call Dispose before you release your last reference to the PropertyTab. Otherwise, the resources it is using will
not be freed until the garbage collector calls the PropertyTab object's Finalize method.

Dispose(Boolean) Dispose(Boolean)
Releases the unmanaged resources used by the PropertyTab and optionally releases the managed resources.
protected virtual void Dispose (bool disposing);
abstract member Dispose : bool -> unit
override this.Dispose : bool -> unit

Parameters
disposing Boolean Boolean
true to release both managed and unmanaged resources; false to release only unmanaged resources.
Remarks
This method is called by the public Dispose() method and the Finalize method. Dispose() invokes the protected
Dispose(Boolean) method with the disposing parameter set to true . Finalize invokes Dispose with disposing set
to false .
When the disposing parameter is true, this method releases all resources held by any managed objects that this
PropertyTab references. This method invokes the Dispose() method of each referenced object.
PropertyTab.Finalize PropertyTab.Finalize
I n this Article
Allows a PropertyTab to attempt to free resources and perform other cleanup operations before the PropertyTab is
reclaimed by garbage collection.

~PropertyTab ();
override this.Finalize : unit -> unit
PropertyTab.GetDefaultProperty PropertyTab.GetDefault
Property
I n this Article
Gets the default property of the specified component.

public virtual System.ComponentModel.PropertyDescriptor GetDefaultProperty (object component);


abstract member GetDefaultProperty : obj -> System.ComponentModel.PropertyDescriptor
override this.GetDefaultProperty : obj -> System.ComponentModel.PropertyDescriptor

Parameters
component Object Object
The component to retrieve the default property of.
Returns
PropertyDescriptor PropertyDescriptor
A PropertyDescriptor that represents the default property.
PropertyTab.GetProperties PropertyTab.GetProperties
I n this Article

Overloads
GetProperties(Object) GetProperties(Object)
Gets the properties of the specified component.

GetProperties(Object, Attribute[]) GetProperties(Object,


Attribute[]) Gets the properties of the specified component that match
the specified attributes.

GetProperties(ITypeDescriptorContext, Object, Attribute[]) Get


Properties(ITypeDescriptorContext, Object, Attribute[]) Gets the properties of the specified component that match
the specified attributes and context.

GetProperties(Object) GetProperties(Object)
Gets the properties of the specified component.
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties (object component);
abstract member GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : obj -> System.ComponentModel.PropertyDescriptorCollection

Parameters
component Object Object
The component to retrieve the properties of.
Returns
PropertyDescriptorCollection PropertyDescriptorCollection
A PropertyDescriptorCollection that contains the properties of the component.

GetProperties(Object, Attribute[]) GetProperties(Object,


Attribute[])
Gets the properties of the specified component that match the specified attributes.
public abstract System.ComponentModel.PropertyDescriptorCollection GetProperties (object component,
Attribute[] attributes);
abstract member GetProperties : obj * Attribute[] ->
System.ComponentModel.PropertyDescriptorCollection

Parameters
component Object Object
The component to retrieve properties from.
attributes Attribute[]
An array of type Attribute that indicates the attributes of the properties to retrieve.
Returns
PropertyDescriptorCollection PropertyDescriptorCollection
A PropertyDescriptorCollection that contains the properties.

GetProperties(ITypeDescriptorContext, Object, Attribute[])


GetProperties(ITypeDescriptorContext, Object, Attribute[])
Gets the properties of the specified component that match the specified attributes and context.
public virtual System.ComponentModel.PropertyDescriptorCollection GetProperties
(System.ComponentModel.ITypeDescriptorContext context, object component, Attribute[] attributes);
abstract member GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] ->
System.ComponentModel.PropertyDescriptorCollection
override this.GetProperties : System.ComponentModel.ITypeDescriptorContext * obj * Attribute[] ->
System.ComponentModel.PropertyDescriptorCollection

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that indicates the context to retrieve properties from.
component Object Object
The component to retrieve properties from.
attributes Attribute[]
An array of type Attribute that indicates the attributes of the properties to retrieve.
Returns
PropertyDescriptorCollection PropertyDescriptorCollection
A PropertyDescriptorCollection that contains the properties matching the specified context and attributes.
PropertyTab.HelpKeyword PropertyTab.HelpKeyword
I n this Article
Gets the Help keyword that is to be associated with this tab.
public virtual string HelpKeyword { get; }
member this.HelpKeyword : string

Returns
String String
The Help keyword to be associated with this tab.

Remarks
By default, this is set to the tab name.
PropertyTab
I n this Article
Initializes a new instance of the PropertyTab class.
protected PropertyTab ();
PropertyTab.TabName PropertyTab.TabName
I n this Article
Gets the name for the property tab.
public abstract string TabName { get; }
member this.TabName : string

Returns
String String
The name for the property tab.
ScrollableControlDesigner ScrollableControlDesigner
Class
Base designer class for extending the design mode behavior of a Control which should receive scroll messages.

D eclaration
[System.CLSCompliant(false)]
public class ScrollableControlDesigner : System.Windows.Forms.Design.ParentControlDesigner
type ScrollableControlDesigner = class
inherit ParentControlDesigner

I nheritance H ierarchy
Object Object
ComponentDesigner ComponentDesigner
ControlDesigner ControlDesigner
ParentControlDesigner ParentControlDesigner

Remarks
ScrollableControlDesigner provides a base class for designers of controls that respond to scroll messages. In addition
to the methods and functionality inherited from the ParentControlDesigner, ControlDesigner, and
ComponentDesigner classes, ScrollableControlDesigner provides a WndProc method override that passes
WM_HSCROLL and WM_VSCROLL messages to the control at design time.
Note

If a form has its AutoScroll property set to active, the scroll bars are always active in the design-time environment.
You can associate a designer with a type using a DesignerAttribute. For an overview of customizing design time
behavior, see Extending Design-Time Support.

Constructors
ScrollableControlDesigner()
ScrollableControlDesigner()

Initializes a new instance of the ScrollableControlDesigner class.

Methods
GetHitTest(Point)
GetHitTest(Point)

Indicates whether a mouse click at the specified point should be handled by the control.

WndProc(Message)
WndProc(Message)

Processes Windows messages and passes WM_HSCROLL and WM_VSCROLL messages to the control at design
time.
See Also
ParentControlDesigner ParentControlDesigner
ParentControlDesigner ParentControlDesigner
ScrollableControlDesigner.GetHitTest ScrollableControl
Designer.GetHitTest
I n this Article
Indicates whether a mouse click at the specified point should be handled by the control.

protected override bool GetHitTest (System.Drawing.Point pt);


override this.GetHitTest : System.Drawing.Point -> bool

Parameters
pt Point Point
A Point indicating the position at which the mouse was clicked, in screen coordinates.
Returns
Boolean Boolean
true if a click at the specified point is to be handled by the control; otherwise, false .

Remarks
The GetHitTest method determines whether a click at the specified point should be passed to the control, while the
control is in design mode. You can override and implement this method to enable your control to receive clicks in the
design-time environment.
Note

You can pass a point in screen coordinates to the PointToClient method of the Control class to obtain the coordinates of
the point relative to the upper-left corner of the control.
ScrollableControlDesigner
I n this Article
Initializes a new instance of the ScrollableControlDesigner class.
public ScrollableControlDesigner ();
ScrollableControlDesigner.WndProc ScrollableControl
Designer.WndProc
I n this Article
Processes Windows messages and passes WM_HSCROLL and WM_VSCROLL messages to the control at design
time.
protected override void WndProc (ref System.Windows.Forms.Message m);
override this.WndProc : -> unit

Parameters
m Message Message
The Message to process.

Remarks
This override of the WndProc method passes any WM_HSCROLL and WM_VSCROLL messages to the control at
design time. All messages are first passed to the base WndProc method.
SelectionRules SelectionRules Enum
Defines identifiers that are used to indicate selection rules for a component.

D eclaration
[System.Flags]
public enum SelectionRules
type SelectionRules =

I nheritance H ierarchy
Object Object
ValueType ValueType
Enum Enum

Remarks
These identifiers indicate whether a component has some form of visible user interface and whether the user can take
actions to move or alter the size of the component.

Fields
AllSizeable Indicates the component supports sizing in all directions.
AllSizeable

BottomSizeable Indicates the component supports resize from the bottom.


BottomSizeable

LeftSizeable Indicates the component supports resize from the left.


LeftSizeable

Locked Locked Indicates the component is locked to its container. Overrides the Moveable, AllSizeable, BottomSizeable,
LeftSizeable, RightSizeable, and TopSizeable bit flags of this enumeration.

Moveable Indicates the component supports a location property that allows it to be moved on the screen.
Moveable

None None Indicates no special selection attributes.

RightSizeable Indicates the component supports resize from the right.


RightSizeable

TopSizeable Indicates the component supports resize from the top.


TopSizeable
Visible Indicates the component has some form of visible user interface and the selection service is drawing a
Visible selection border around this user interface. If a selected component has this rule set, you can assume that
the component implements IComponent and that it is associated with a corresponding designer instance.
ShortcutKeysEditor ShortcutKeysEditor Class
Provides an editor for picking shortcut keys.

D eclaration
[System.Security.SecurityCritical]
[System.CLSCompliant(false)]
public class ShortcutKeysEditor : System.Drawing.Design.UITypeEditor
type ShortcutKeysEditor = class
inherit UITypeEditor

I nheritance H ierarchy
Object Object
UITypeEditor UITypeEditor

Constructors
ShortcutKeysEditor()
ShortcutKeysEditor()

Initializes a new instance of the ShortcutKeysEditor class.

Methods
EditValue(ITypeDescriptorContext, IServiceProvider, Object)
EditValue(ITypeDescriptorContext, IServiceProvider, Object)

Edits the given object value using the editor style provided by the GetEditStyle(ITypeDescriptorContext) method.

GetEditStyle(ITypeDescriptorContext)
GetEditStyle(ITypeDescriptorContext)

Gets the editor style used by the EditValue method.


ShortcutKeysEditor.EditValue ShortcutKeysEditor.Edit
Value
I n this Article
Edits the given object value using the editor style provided by the GetEditStyle(ITypeDescriptorContext) method.

public override object EditValue (System.ComponentModel.ITypeDescriptorContext context,


IServiceProvider provider, object value);
override this.EditValue : System.ComponentModel.ITypeDescriptorContext * IServiceProvider * obj ->
obj

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
provider IServiceProvider IServiceProvider
An IServiceProvider that this editor can use to obtain services.
value Object Object
The Object to edit.
Returns
Object Object
The new value of the Object.
ShortcutKeysEditor.GetEditStyle ShortcutKeysEditor.Get
EditStyle
I n this Article
Gets the editor style used by the EditValue method.

public override System.Drawing.Design.UITypeEditorEditStyle GetEditStyle


(System.ComponentModel.ITypeDescriptorContext context);
override this.GetEditStyle : System.ComponentModel.ITypeDescriptorContext ->
System.Drawing.Design.UITypeEditorEditStyle

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
Returns
UITypeEditorEditStyle UITypeEditorEditStyle
A UITypeEditorEditStyle value that indicates the style of editor used by the EditValue method.

Remarks
If the method is not supported, this method will return None.
ShortcutKeysEditor
I n this Article
Initializes a new instance of the ShortcutKeysEditor class.
public ShortcutKeysEditor ();
ThemedScrollbarMode ThemedScrollbarMode Enum
A value that indicates whether the scrollbars of a window and its children will be themed when displayed in the Visual
Studio designer.

D eclaration
public enum ThemedScrollbarMode
type ThemedScrollbarMode =

I nheritance H ierarchy
Object Object
ValueType ValueType
Enum Enum

Fields
All All The window and all of its children will have themed scrollbars.

None None The window and all of its children will not be themed.

OnlyTopLevel OnlyTopLevel The window will have themed scrollbars but all of its children will not be themed.
ThemedScrollbarWindow ThemedScrollbarWindow
Struct
Represents a window and a value that indicates how its scrollbars should be themed when displayed in the Visual
Studio designer.

D eclaration
public struct ThemedScrollbarWindow
type ThemedScrollbarWindow = struct

I nheritance H ierarchy
Object Object
ValueType ValueType

Fields
Handle
Handle

The window handle.

Mode
Mode

A value that indicates how the window scrollbars should be themed when displayed in the Visual Studio designer.
ThemedScrollbarWindow.Handle ThemedScrollbar
Window.Handle
I n this Article
The window handle.

public IntPtr Handle;


val mutable Handle : nativeint

Returns
IntPtr IntPtr
ThemedScrollbarWindow.Mode ThemedScrollbar
Window.Mode
I n this Article
A value that indicates how the window scrollbars should be themed when displayed in the Visual Studio designer.

public System.Windows.Forms.Design.ThemedScrollbarMode Mode;


val mutable Mode : System.Windows.Forms.Design.ThemedScrollbarMode

Returns
ThemedScrollbarMode ThemedScrollbarMode
ToolStripItemDesignerAvailability ToolStripItemDesigner
Availability Enum
Specifies controls that are visible in the designer.

D eclaration
[System.Flags]
public enum ToolStripItemDesignerAvailability
type ToolStripItemDesignerAvailability =

I nheritance H ierarchy
Object Object
ValueType ValueType
Enum Enum

Fields
All All Specifies that all controls are visible.

ContextMenuStrip ContextMenuStrip Specifies that ContextMenuStrip is visible.

MenuStrip MenuStrip Specifies that MenuStrip is visible.

None None Specifies that no controls are visible.

StatusStrip StatusStrip Specifies that StatusStrip is visible.

ToolStrip ToolStrip Specifies that ToolStrip is visible.


ToolStripItemDesignerAvailabilityAttribute ToolStripItem
DesignerAvailabilityAttribute Class
Specifies which types a ToolStripItem can appear in. This class cannot be inherited.

D eclaration
[System.AttributeUsage(System.AttributeTargets.Class)]
public sealed class ToolStripItemDesignerAvailabilityAttribute : Attribute
type ToolStripItemDesignerAvailabilityAttribute = class
inherit Attribute

I nheritance H ierarchy
Object Object
Attribute Attribute

Remarks
Available types are ToolStrip, MenuStrip, ContextMenuStrip, and StatusStrip.

Constructors
ToolStripItemDesignerAvailabilityAttribute()
ToolStripItemDesignerAvailabilityAttribute()

Initializes a new default instance of the ToolStripItemDesignerAvailabilityAttribute class.

ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesignerAvailability)
ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesignerAvailability)

Initializes a new instance of the ToolStripItemDesignerAvailabilityAttribute class with the specified visibility.

Fields
Default
Default

Specifies the default value of the ToolStripItemDesignerAvailabilityAttribute. This field is read-only.

Properties
ItemAdditionVisibility
ItemAdditionVisibility

Gets the visibility of a ToolStripItem.

Methods
Equals(Object)
Equals(Object)

Returns a value that indicates whether this instance is equal to a specified object.

GetHashCode()
GetHashCode()

Returns the hash code for this instance.

IsDefaultAttribute()
IsDefaultAttribute()

When overriden in a derived class, indicates whether the value of this instance is the default value for the derived
class.
ToolStripItemDesignerAvailabilityAttribute.Default Tool
StripItemDesignerAvailabilityAttribute.Default
I n this Article
Specifies the default value of the ToolStripItemDesignerAvailabilityAttribute. This field is read-only.

public static readonly System.Windows.Forms.Design.ToolStripItemDesignerAvailabilityAttribute


Default;
staticval mutable Default : System.Windows.Forms.Design.ToolStripItemDesignerAvailabilityAttribute

Returns
ToolStripItemDesignerAvailabilityAttribute ToolStripItemDesignerAvailabilityAttribute
ToolStripItemDesignerAvailabilityAttribute.Equals Tool
StripItemDesignerAvailabilityAttribute.Equals
I n this Article
Returns a value that indicates whether this instance is equal to a specified object.

public override bool Equals (object obj);


override this.Equals : obj -> bool

Parameters
obj Object Object
An Object to compare with this instance or a null reference ( Nothing in Visual Basic).
Returns
Boolean Boolean
true if obj equals the type and value of this instance; otherwise, false .
ToolStripItemDesignerAvailabilityAttribute.GetHashCode
ToolStripItemDesignerAvailabilityAttribute.GetHashCode
I n this Article
Returns the hash code for this instance.

public override int GetHashCode ();


override this.GetHashCode : unit -> int

Returns
Int32 Int32
A 32-bit signed integer hash code.
ToolStripItemDesignerAvailabilityAttribute.IsDefault
Attribute ToolStripItemDesignerAvailabilityAttribute.Is
DefaultAttribute
I n this Article
When overriden in a derived class, indicates whether the value of this instance is the default value for the derived class.
public override bool IsDefaultAttribute ();
override this.IsDefaultAttribute : unit -> bool

Returns
Boolean Boolean
true if this instance is the default attribute for the class; otherwise, false .
ToolStripItemDesignerAvailabilityAttribute.ItemAddition
Visibility ToolStripItemDesignerAvailabilityAttribute.Item
AdditionVisibility
I n this Article
Gets the visibility of a ToolStripItem.
public System.Windows.Forms.Design.ToolStripItemDesignerAvailability ItemAdditionVisibility { get; }
member this.ItemAdditionVisibility : System.Windows.Forms.Design.ToolStripItemDesignerAvailability

Returns
ToolStripItemDesignerAvailability ToolStripItemDesignerAvailability
A ToolStripItemDesignerAvailability representing the visibility.
ToolStripItemDesignerAvailabilityAttribute ToolStripItem
DesignerAvailabilityAttribute
I n this Article

Overloads
ToolStripItemDesignerAvailabilityAttribute()
Initializes a new default instance of the
ToolStripItemDesignerAvailabilityAttribute class.

ToolStripItemDesignerAvailabilityAttribute(ToolStripItem
DesignerAvailability) ToolStripItemDesignerAvailability Initializes a new instance of the
Attribute(ToolStripItemDesignerAvailability) ToolStripItemDesignerAvailabilityAttribute class with the
specified visibility.

ToolStripItemDesignerAvailabilityAttribute()
Initializes a new default instance of the ToolStripItemDesignerAvailabilityAttribute class.
public ToolStripItemDesignerAvailabilityAttribute ();

ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesigner
Availability)
ToolStripItemDesignerAvailabilityAttribute(ToolStripItemDesigner
Availability)
Initializes a new instance of the ToolStripItemDesignerAvailabilityAttribute class with the specified visibility.
public ToolStripItemDesignerAvailabilityAttribute
(System.Windows.Forms.Design.ToolStripItemDesignerAvailability visibility);
new System.Windows.Forms.Design.ToolStripItemDesignerAvailabilityAttribute :
System.Windows.Forms.Design.ToolStripItemDesignerAvailability ->
System.Windows.Forms.Design.ToolStripItemDesignerAvailabilityAttribute

Parameters
visibility ToolStripItemDesignerAvailability ToolStripItemDesignerAvailability
A ToolStripItemDesignerAvailability value specifying the visibility.
WindowsFormsComponentEditor WindowsForms
ComponentEditor Class
Provides a base class for editors that use a modal dialog to display a properties page similar to an ActiveX control's
property page.

D eclaration
public abstract class WindowsFormsComponentEditor : System.ComponentModel.ComponentEditor
type WindowsFormsComponentEditor = class
inherit ComponentEditor

I nheritance H ierarchy
Object Object
ComponentEditor ComponentEditor

Constructors
WindowsFormsComponentEditor()
WindowsFormsComponentEditor()

Initializes a new instance of the WindowsFormsComponentEditor class.

Methods
EditComponent(ITypeDescriptorContext, Object)
EditComponent(ITypeDescriptorContext, Object)

Creates an editor window that allows the user to edit the specified component, using the specified context
information.

EditComponent(Object, IWin32Window)
EditComponent(Object, IWin32Window)

Creates an editor window that allows the user to edit the specified component, using the specified window that
owns the component.

EditComponent(ITypeDescriptorContext, Object, IWin32Window)


EditComponent(ITypeDescriptorContext, Object, IWin32Window)

Creates an editor window that allows the user to edit the specified component.

GetComponentEditorPages()
GetComponentEditorPages()

Gets the component editor pages associated with the component editor.
GetInitialComponentEditorPageIndex()
GetInitialComponentEditorPageIndex()

Gets the index of the initial component editor page for the component editor to display.
WindowsFormsComponentEditor.EditComponent
WindowsFormsComponentEditor.EditComponent
I n this Article

Overloads
EditComponent(ITypeDescriptorContext, Object) Edit
Component(ITypeDescriptorContext, Object) Creates an editor window that allows the user to edit the
specified component, using the specified context information.

EditComponent(Object, IWin32Window) EditComponent(


Object, IWin32Window) Creates an editor window that allows the user to edit the
specified component, using the specified window that owns
the component.

EditComponent(ITypeDescriptorContext, Object, IWin32


Window) EditComponent(ITypeDescriptorContext, Object, Creates an editor window that allows the user to edit the
IWin32Window) specified component.

EditComponent(ITypeDescriptorContext, Object)
EditComponent(ITypeDescriptorContext, Object)
Creates an editor window that allows the user to edit the specified component, using the specified context information.
public override bool EditComponent (System.ComponentModel.ITypeDescriptorContext context, object
component);
override this.EditComponent : System.ComponentModel.ITypeDescriptorContext * obj -> bool

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
component Object Object
The component to edit.
Returns
Boolean Boolean
true if the component was changed during editing; otherwise, false .

EditComponent(Object, IWin32Window) EditComponent(Object,


IWin32Window)
Creates an editor window that allows the user to edit the specified component, using the specified window that owns
the component.
public bool EditComponent (object component, System.Windows.Forms.IWin32Window owner);
override this.EditComponent : obj * System.Windows.Forms.IWin32Window -> bool
Parameters
component Object Object
The component to edit.
owner IWin32Window IWin32Window
An IWin32Window that the component belongs to.
Returns
Boolean Boolean
true if the component was changed during editing; otherwise, false .

EditComponent(ITypeDescriptorContext, Object, IWin32Window)


EditComponent(ITypeDescriptorContext, Object, IWin32Window)
Creates an editor window that allows the user to edit the specified component.
public virtual bool EditComponent (System.ComponentModel.ITypeDescriptorContext context, object
component, System.Windows.Forms.IWin32Window owner);
override this.EditComponent : System.ComponentModel.ITypeDescriptorContext * obj *
System.Windows.Forms.IWin32Window -> bool

Parameters
context ITypeDescriptorContext ITypeDescriptorContext
An ITypeDescriptorContext that can be used to gain additional context information.
component Object Object
The component to edit.
owner IWin32Window IWin32Window
An IWin32Window that the component belongs to.
Returns
Boolean Boolean
true if the component was changed during editing; otherwise, false .
WindowsFormsComponentEditor.GetComponentEditor
Pages WindowsFormsComponentEditor.GetComponent
EditorPages
I n this Article
Gets the component editor pages associated with the component editor.
protected virtual Type[] GetComponentEditorPages ();
abstract member GetComponentEditorPages : unit -> Type[]
override this.GetComponentEditorPages : unit -> Type[]

Returns
Type[]
An array of component editor pages.

Examples
The following code example demonstrates an example implementation of a GetComponentEditorPages method
override.
// This method override returns an type array containing the type of
// each component editor page to display.
protected override Type[] GetComponentEditorPages()
{
return new Type[] { typeof(ExampleComponentEditorPage),
typeof(ExampleComponentEditorPage) };
}
WindowsFormsComponentEditor.GetInitialComponent
EditorPageIndex WindowsFormsComponentEditor.Get
InitialComponentEditorPageIndex
I n this Article
Gets the index of the initial component editor page for the component editor to display.
protected virtual int GetInitialComponentEditorPageIndex ();
abstract member GetInitialComponentEditorPageIndex : unit -> int
override this.GetInitialComponentEditorPageIndex : unit -> int

Returns
Int32 Int32
The index of the component editor page that the component editor will initially display.

Examples
The following code example demonstrates an example implementation of a GetInitialComponentEditorPageIndex
method override.
// This method override returns the index of the page to display when the
// component editor is first displayed.
protected override int GetInitialComponentEditorPageIndex()
{
return 1;
}
WindowsFormsComponentEditor
I n this Article
Initializes a new instance of the WindowsFormsComponentEditor class.
protected WindowsFormsComponentEditor ();
WindowsFormsDesignerOptionService WindowsForms
DesignerOptionService Class
Provides access to get and set option values for a Windows Forms designer.

D eclaration
public class WindowsFormsDesignerOptionService :
System.ComponentModel.Design.DesignerOptionService
type WindowsFormsDesignerOptionService = class
inherit DesignerOptionService

I nheritance H ierarchy
Object Object
DesignerOptionService DesignerOptionService

Constructors
WindowsFormsDesignerOptionService()
WindowsFormsDesignerOptionService()

Initializes a new instance of the WindowsFormsDesignerOptionService class.

Properties
CompatibilityOptions
CompatibilityOptions

Gets the DesignerOptions exposed by the WindowsFormsDesignerOptionService.

Methods
PopulateOptionCollection(DesignerOptionService+DesignerOptionCollection)
PopulateOptionCollection(DesignerOptionService+DesignerOptionCollection)

Populates a DesignerOptionService.DesignerOptionCollection.
WindowsFormsDesignerOptionService.Compatibility
Options WindowsFormsDesignerOptionService.
CompatibilityOptions
I n this Article
Gets the DesignerOptions exposed by the WindowsFormsDesignerOptionService.
public virtual System.Windows.Forms.Design.DesignerOptions CompatibilityOptions { get; }
member this.CompatibilityOptions : System.Windows.Forms.Design.DesignerOptions

Returns
DesignerOptions DesignerOptions
The DesignerOptions exposed by the WindowsFormsDesignerOptionService.
WindowsFormsDesignerOptionService.PopulateOption
Collection WindowsFormsDesignerOptionService.
PopulateOptionCollection
I n this Article
Populates a DesignerOptionService.DesignerOptionCollection.
protected override void PopulateOptionCollection
(System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection options);
override this.PopulateOptionCollection :
System.ComponentModel.Design.DesignerOptionService.DesignerOptionCollection -> unit

Parameters
options DesignerOptionService.DesignerOptionCollection DesignerOptionService.DesignerOptionCollection
The collection to populate.

Remarks
The PopulateOptionCollection method is called on demand the first time a user asks for child options or properties of
an options collection.
WindowsFormsDesignerOptionService
I n this Article
Initializes a new instance of the WindowsFormsDesignerOptionService class.
public WindowsFormsDesignerOptionService ();

You might also like