diff --git a/xml/System.ComponentModel.Design/BinaryEditor.xml b/xml/System.ComponentModel.Design/BinaryEditor.xml
index cf191ade208..b7f83799315 100644
--- a/xml/System.ComponentModel.Design/BinaryEditor.xml
+++ b/xml/System.ComponentModel.Design/BinaryEditor.xml
@@ -141,6 +141,7 @@
Gets the editor style used by the method.
An value indicating the provided editing style.
To be added.
+
diff --git a/xml/System.ComponentModel.Design/CollectionEditor.xml b/xml/System.ComponentModel.Design/CollectionEditor.xml
index 4f76cbeaad5..a6c9060ed4c 100644
--- a/xml/System.ComponentModel.Design/CollectionEditor.xml
+++ b/xml/System.ComponentModel.Design/CollectionEditor.xml
@@ -664,6 +664,7 @@
Gets the edit style used by the method.
A enumeration value indicating the provided editing style. If the method is not supported in the specified context, this method will return the identifier.
To be added.
+
diff --git a/xml/System.ComponentModel.Design/DateTimeEditor.xml b/xml/System.ComponentModel.Design/DateTimeEditor.xml
index 21848f4a6a5..dc90f36d3d3 100644
--- a/xml/System.ComponentModel.Design/DateTimeEditor.xml
+++ b/xml/System.ComponentModel.Design/DateTimeEditor.xml
@@ -146,6 +146,7 @@
Retrieves the editing style of the method. If the method is not supported, this will return None.
An value indicating the provided editing style.
To be added.
+
diff --git a/xml/System.ComponentModel.Design/MultilineStringEditor.xml b/xml/System.ComponentModel.Design/MultilineStringEditor.xml
index fd0d20cf626..3b334655064 100644
--- a/xml/System.ComponentModel.Design/MultilineStringEditor.xml
+++ b/xml/System.ComponentModel.Design/MultilineStringEditor.xml
@@ -110,6 +110,7 @@
Edits the specified object value using the edit style provided by .
The new value of the object. If the value of the object has not changed, this method should return the same object passed to it.
To be added.
+
diff --git a/xml/System.ComponentModel.Design/ObjectSelectorEditor.xml b/xml/System.ComponentModel.Design/ObjectSelectorEditor.xml
index 80e666aa2f2..838e456d65b 100644
--- a/xml/System.ComponentModel.Design/ObjectSelectorEditor.xml
+++ b/xml/System.ComponentModel.Design/ObjectSelectorEditor.xml
@@ -234,6 +234,7 @@
]]>
+
@@ -421,6 +422,7 @@
The specified value.
Sets the current to the specified value.
To be added.
+
diff --git a/xml/System.Drawing.Design/ColorEditor.xml b/xml/System.Drawing.Design/ColorEditor.xml
index 43ac8b21695..b05dd954403 100644
--- a/xml/System.Drawing.Design/ColorEditor.xml
+++ b/xml/System.Drawing.Design/ColorEditor.xml
@@ -163,6 +163,7 @@
Gets the editing style of the Edit method. If the method is not supported, this will return .
An enum value indicating the provided editing style.
To be added.
+
@@ -201,6 +202,7 @@
if is implemented; otherwise, .
To be added.
+
@@ -244,6 +246,7 @@
]]>
+
diff --git a/xml/System.Drawing.Design/ContentAlignmentEditor.xml b/xml/System.Drawing.Design/ContentAlignmentEditor.xml
index 3d42bc5b1d8..2cf82761d32 100644
--- a/xml/System.Drawing.Design/ContentAlignmentEditor.xml
+++ b/xml/System.Drawing.Design/ContentAlignmentEditor.xml
@@ -161,6 +161,7 @@
Gets the editing style of the method.
A value indicating the provided editing style. If the method to retrieve the edit style is not supported, this will return .
To be added.
+
diff --git a/xml/System.Drawing.Design/CursorEditor.xml b/xml/System.Drawing.Design/CursorEditor.xml
index 9575cdfc0f0..32e5305ed0d 100644
--- a/xml/System.Drawing.Design/CursorEditor.xml
+++ b/xml/System.Drawing.Design/CursorEditor.xml
@@ -167,6 +167,7 @@
Retrieves the editing style of the method.
An enum value indicating the provided editing style. If the method is not supported, this will return .
To be added.
+
diff --git a/xml/System.Drawing.Design/FontEditor.xml b/xml/System.Drawing.Design/FontEditor.xml
index c345ff9a59c..d6e57d33ae6 100644
--- a/xml/System.Drawing.Design/FontEditor.xml
+++ b/xml/System.Drawing.Design/FontEditor.xml
@@ -184,6 +184,7 @@
Gets the editor style used by the method.
A value that indicates the style of editor used by .
To be added.
+
diff --git a/xml/System.Drawing.Design/FontNameEditor.xml b/xml/System.Drawing.Design/FontNameEditor.xml
index 1fa8d4f2f28..a9d2f5a4be1 100644
--- a/xml/System.Drawing.Design/FontNameEditor.xml
+++ b/xml/System.Drawing.Design/FontNameEditor.xml
@@ -116,6 +116,7 @@
if is implemented; otherwise, .
To be added.
+
@@ -152,6 +153,7 @@
What to paint and where to paint it.
Paints a representative value of the given object to the provided canvas. Painting should be done within the boundaries of the provided rectangle.
To be added.
+
diff --git a/xml/System.Drawing.Design/IconEditor.xml b/xml/System.Drawing.Design/IconEditor.xml
index 37ed29dd65b..a7f8473f6e0 100644
--- a/xml/System.Drawing.Design/IconEditor.xml
+++ b/xml/System.Drawing.Design/IconEditor.xml
@@ -363,6 +363,7 @@
if is implemented; otherwise, .
To be added.
+
@@ -443,6 +444,7 @@
]]>
+
diff --git a/xml/System.Drawing.Design/ImageEditor.xml b/xml/System.Drawing.Design/ImageEditor.xml
index 13bb6f414c4..2a12a9a7bc7 100644
--- a/xml/System.Drawing.Design/ImageEditor.xml
+++ b/xml/System.Drawing.Design/ImageEditor.xml
@@ -270,6 +270,7 @@
]]>
+
@@ -419,6 +420,7 @@
if is implemented; otherwise, .
To be added.
+
@@ -499,6 +501,7 @@
]]>
+
diff --git a/xml/System.Windows.Forms.Design/AnchorEditor.xml b/xml/System.Windows.Forms.Design/AnchorEditor.xml
index 2df2f2914ce..4f90a3be9ff 100644
--- a/xml/System.Windows.Forms.Design/AnchorEditor.xml
+++ b/xml/System.Windows.Forms.Design/AnchorEditor.xml
@@ -180,6 +180,7 @@
Gets the editor style used by the method.
One of the values indicating the provided editing style. If the method is not supported, this method will return .
To be added.
+
diff --git a/xml/System.Windows.Forms.Design/BorderSidesEditor.xml b/xml/System.Windows.Forms.Design/BorderSidesEditor.xml
index 976b60844f9..db93e665981 100644
--- a/xml/System.Windows.Forms.Design/BorderSidesEditor.xml
+++ b/xml/System.Windows.Forms.Design/BorderSidesEditor.xml
@@ -116,6 +116,7 @@
Edits the given object value using the editor style provided by .
The edited object.
To be added.
+
@@ -152,6 +153,7 @@
Retrieves the editing style of the method.
One of the values. If the method is not supported, this method returns .
To be added.
+
diff --git a/xml/System.Windows.Forms.Design/DockEditor.xml b/xml/System.Windows.Forms.Design/DockEditor.xml
index ac6014eacd8..9a3811db966 100644
--- a/xml/System.Windows.Forms.Design/DockEditor.xml
+++ b/xml/System.Windows.Forms.Design/DockEditor.xml
@@ -156,6 +156,7 @@
Retrieves the editing style of the EditValue method. If the method is not supported, this will return None.
An enum value indicating the provided editing style.
To be added.
+
diff --git a/xml/System.Windows.Forms.Design/EventsTab.xml b/xml/System.Windows.Forms.Design/EventsTab.xml
index 0d5ae9a699c..d9c99b8b2fc 100644
--- a/xml/System.Windows.Forms.Design/EventsTab.xml
+++ b/xml/System.Windows.Forms.Design/EventsTab.xml
@@ -210,6 +210,7 @@
Gets all the properties of the event tab that match the specified attributes and context.
A that contains the properties. This will be an empty if the component does not implement an event service.
To be added.
+
diff --git a/xml/System.Windows.Forms.Design/FileNameEditor.xml b/xml/System.Windows.Forms.Design/FileNameEditor.xml
index a68d353d27f..93612493518 100644
--- a/xml/System.Windows.Forms.Design/FileNameEditor.xml
+++ b/xml/System.Windows.Forms.Design/FileNameEditor.xml
@@ -190,6 +190,7 @@
]]>
+
diff --git a/xml/System.Windows.Forms.Design/FolderNameEditor.xml b/xml/System.Windows.Forms.Design/FolderNameEditor.xml
index 47fd9a9a151..6b9c93de917 100644
--- a/xml/System.Windows.Forms.Design/FolderNameEditor.xml
+++ b/xml/System.Windows.Forms.Design/FolderNameEditor.xml
@@ -171,6 +171,7 @@
]]>
+
diff --git a/xml/System.Windows.Forms.Design/ShortcutKeysEditor.xml b/xml/System.Windows.Forms.Design/ShortcutKeysEditor.xml
index 7e855b34de1..38ea8572b7c 100644
--- a/xml/System.Windows.Forms.Design/ShortcutKeysEditor.xml
+++ b/xml/System.Windows.Forms.Design/ShortcutKeysEditor.xml
@@ -163,6 +163,7 @@
]]>
+
diff --git a/xml/System.Windows.Forms/BindableComponent.xml b/xml/System.Windows.Forms/BindableComponent.xml
index 1e247791dd9..9cb7410dde2 100644
--- a/xml/System.Windows.Forms/BindableComponent.xml
+++ b/xml/System.Windows.Forms/BindableComponent.xml
@@ -30,7 +30,7 @@
- To be added.
+ Base class for components that provide properties that can be data bound with the Windows Forms Designer.
To be added.
@@ -111,7 +111,7 @@
System.EventHandler
- To be added.
+ Occurs when the binding context has changed.
To be added.
@@ -179,7 +179,7 @@
To be added.
- To be added.
+ Raises the event.
To be added.
diff --git a/xml/System.Windows.Forms/ButtonBase.xml b/xml/System.Windows.Forms/ButtonBase.xml
index eff58d70799..5459c6e2e4d 100644
--- a/xml/System.Windows.Forms/ButtonBase.xml
+++ b/xml/System.Windows.Forms/ButtonBase.xml
@@ -280,7 +280,7 @@
System.Windows.Input.ICommand
- To be added.
+ Gets or sets the whose method will be called when the event is invoked.
To be added.
To be added.
@@ -311,7 +311,7 @@
System.EventHandler
- To be added.
+ Occurs when the status of the that's assigned to the property has changed.
To be added.
@@ -341,7 +341,7 @@
System.EventHandler
- To be added.
+ Occurs when the assigned of the property has changed.
To be added.
@@ -383,7 +383,7 @@
System.Object
- To be added.
+ Gets or sets the parameter that is passed to the that's assigned to the property.
To be added.
To be added.
@@ -414,7 +414,7 @@
System.EventHandler
- To be added.
+ Occurs when the value of the property has changed.
To be added.
@@ -1216,8 +1216,8 @@ If you set the property, the
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -1250,8 +1250,8 @@ If you set the property, the
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -1284,8 +1284,8 @@ If you set the property, the
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -1804,8 +1804,8 @@ If you set the property, the
- To be added.
- To be added.
+ An empty instance.
+ Called in the context of to invoke if the context allows.
To be added.
diff --git a/xml/System.Windows.Forms/ContainerControl.xml b/xml/System.Windows.Forms/ContainerControl.xml
index a5af2543fed..d6dc7c06ecd 100644
--- a/xml/System.Windows.Forms/ContainerControl.xml
+++ b/xml/System.Windows.Forms/ContainerControl.xml
@@ -1195,10 +1195,11 @@
- To be added.
- To be added.
- To be added.
- To be added.
+ The scale factor to be applied on the width of the property being scaled.
+ The scale factor to be applied on the height of the property being scaled.
+
+ to resize the container control along with properties being scaled; otherwise, .
+ Scales the size of the container's and properties with the scale factor provided.
To be added.
diff --git a/xml/System.Windows.Forms/Control.xml b/xml/System.Windows.Forms/Control.xml
index 35877116baf..5e7af8743b3 100644
--- a/xml/System.Windows.Forms/Control.xml
+++ b/xml/System.Windows.Forms/Control.xml
@@ -96,32 +96,32 @@
Defines the base class for controls, which are components with visual representation.
- , classes, or from the other Windows Forms provided controls. For more information about authoring custom controls, see [Developing Custom Windows Forms Controls with the .NET Framework](/dotnet/framework/winforms/controls/developing-custom-windows-forms-controls).
-
- The class implements very basic functionality required by classes that display information to the user. It handles user input through the keyboard and pointing devices. It handles message routing and security. It defines the bounds of a control (its position and size), although it does not implement painting. It provides a window handle (`hWnd`).
-
- Windows Forms controls use ambient properties so child controls can appear like their surrounding environment. An *ambient property* is a control property that, if not set, is retrieved from the parent control. If the control does not have a , and the property is not set, the control attempts to determine the value of the ambient property through the property. If the control is not sited, if the site does not support ambient properties, or if the property is not set on the , the control uses its own default values. Typically, an ambient property represents a characteristic of a control, such as , that is communicated to a child control. For example, a will have the same as its parent by default. Ambient properties provided by the class include: , , , , and .
-
+ , classes, or from the other Windows Forms provided controls. For more information about authoring custom controls, see [Developing Custom Windows Forms Controls with the .NET Framework](/dotnet/framework/winforms/controls/developing-custom-windows-forms-controls).
+
+ The class implements very basic functionality required by classes that display information to the user. It handles user input through the keyboard and pointing devices. It handles message routing and security. It defines the bounds of a control (its position and size), although it does not implement painting. It provides a window handle (`hWnd`).
+
+ Windows Forms controls use ambient properties so child controls can appear like their surrounding environment. An *ambient property* is a control property that, if not set, is retrieved from the parent control. If the control does not have a , and the property is not set, the control attempts to determine the value of the ambient property through the property. If the control is not sited, if the site does not support ambient properties, or if the property is not set on the , the control uses its own default values. Typically, an ambient property represents a characteristic of a control, such as , that is communicated to a child control. For example, a will have the same as its parent by default. Ambient properties provided by the class include: , , , , and .
+
> [!NOTE]
-> To make your Windows Forms application support visual styles, be sure to set the property to `System` and include a manifest with your executable. A manifest is an XML file that is included either as a resource within your application executable or as a separate file that resides in the same directory as the executable file. For an example of a manifest, see the Example section of the enumeration. For more information about using visual styles, see [Visual Styles](/windows/win32/controls/themes-overview).
-
- Windows Forms has accessibility support built in, and provides information about your application that enables it to work with accessibility client applications such as screen enlarger and reviewer utilities, voice input utilities, on-screen keyboards, alternative input devices, and keyboard enhancement utilities. Sometimes you will want to provide additional information to accessibility client applications. There are two ways of providing this additional information. You can set the , , , and property values, which will be reported to accessibility client applications. This method is typically used to provide limited accessibility information for existing controls. Alternatively, you can write your own class deriving from the or classes, providing as much accessibility information as needed.
-
+> To make your Windows Forms application support visual styles, be sure to set the property to `System` and include a manifest with your executable. A manifest is an XML file that is included either as a resource within your application executable or as a separate file that resides in the same directory as the executable file. For an example of a manifest, see the Example section of the enumeration. For more information about using visual styles, see [Visual Styles](/windows/win32/controls/themes-overview).
+
+ Windows Forms has accessibility support built in, and provides information about your application that enables it to work with accessibility client applications such as screen enlarger and reviewer utilities, voice input utilities, on-screen keyboards, alternative input devices, and keyboard enhancement utilities. Sometimes you will want to provide additional information to accessibility client applications. There are two ways of providing this additional information. You can set the , , , and property values, which will be reported to accessibility client applications. This method is typically used to provide limited accessibility information for existing controls. Alternatively, you can write your own class deriving from the or classes, providing as much accessibility information as needed.
+
> [!NOTE]
-> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
-
+> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
+
> [!NOTE]
-> Do not add data bindings for a in its constructor. Doing so will cause errors in code generation and can cause unwanted behavior.
-
- The majority of the controls in the namespace use the underlying Windows common control as a base to build on. For more information about the Windows common controls, see [General Control Reference](/windows/win32/controls/common-control-reference).
-
- To identify Windows Forms controls from a separate process, use a standard `SendMessage` call to pass the WM_GETCONTROLNAME message. WM_GETCONTROLNAME is independent of the language and Windows hierarchy. For more information, see the "Recommended Solution for Windows Forms" topic in [Automating Windows Forms](https://docs.microsoft.com/previous-versions/dotnet/articles/ms996405(v=msdn.10)).
-
- Use the property to synchronize access to the control from multiple threads. For more information about multithreaded Windows Forms controls, see [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls)
-
+> Do not add data bindings for a in its constructor. Doing so will cause errors in code generation and can cause unwanted behavior.
+
+ The majority of the controls in the namespace use the underlying Windows common control as a base to build on. For more information about the Windows common controls, see [General Control Reference](/windows/win32/controls/common-control-reference).
+
+ To identify Windows Forms controls from a separate process, use a standard `SendMessage` call to pass the WM_GETCONTROLNAME message. WM_GETCONTROLNAME is independent of the language and Windows hierarchy. For more information, see the "Recommended Solution for Windows Forms" topic in [Automating Windows Forms](https://docs.microsoft.com/previous-versions/dotnet/articles/ms996405(v=msdn.10)).
+
+ Use the property to synchronize access to the control from multiple threads. For more information about multithreaded Windows Forms controls, see [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls)
+
]]>
Only the following members are thread safe: , , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls.
@@ -166,11 +166,11 @@
Initializes a new instance of the class with default settings.
- class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
-
+ class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
+
]]>
@@ -206,13 +206,13 @@
The text displayed by the control.
Initializes a new instance of the class with specific text.
- class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
-
- This version of the constructor sets the initial property value to the `text` parameter value.
-
+ class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
+
+ This version of the constructor sets the initial property value to the `text` parameter value.
+
]]>
@@ -244,13 +244,13 @@
The text displayed by the control.
Initializes a new instance of the class as a child control, with specific text.
- class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
-
- This version of the constructor sets the initial property value to the `text` parameter value. The constructor also adds the control to the parent control's .
-
+ class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
+
+ This version of the constructor sets the initial property value to the `text` parameter value. The constructor also adds the control to the parent control's .
+
]]>
@@ -294,16 +294,16 @@
The height of the control, in pixels. The value is assigned to the property.
Initializes a new instance of the class with specific text, size, and location.
- class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
-
- This version of the constructor sets the initial property value to the `text` parameter value. The initial and of the control are determined by the `left`, `top`, `width` and `height` parameter values.
-
+ class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
+
+ This version of the constructor sets the initial property value to the `text` parameter value. The initial and of the control are determined by the `left`, `top`, `width` and `height` parameter values.
+
> [!NOTE]
-> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
-
+> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
+
]]>
@@ -343,16 +343,16 @@
The height of the control, in pixels. The value is assigned to the property.
Initializes a new instance of the class as a child control, with specific text, size, and location.
- class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
-
- This version of the constructor sets the initial property value to the `text` parameter value. The constructor also adds the control to the parent control's . The initial and of the control are determined by the `left`, `top`, `width` and `height` parameter values.
-
+ class is the base class for all controls used in a Windows Forms application. Because this class is not typically used to create an instance of the class, this constructor is typically not called directly but is instead called by a derived class.
+
+ This version of the constructor sets the initial property value to the `text` parameter value. The constructor also adds the control to the parent control's . The initial and of the control are determined by the `left`, `top`, `width` and `height` parameter values.
+
> [!NOTE]
-> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
-
+> To maintain better performance, do not set the size of a control in its constructor. The preferred method is to override the property.
+
]]>
@@ -409,22 +409,22 @@
The child to notify of the accessible event.
Notifies the accessibility client applications of the specified for the specified child control.
- method for each the accessibility client applications are to be notified of. The method is typically called when a property is set or from within an event handler. For example, you might call the method and pass in an value of `Hide` from within the event handler for the event.
-
-
-
-## Examples
- The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
-
- This code excerpt demonstrates calling the method. See the class overview for the complete code example.
-
+ method for each the accessibility client applications are to be notified of. The method is typically called when a property is set or from within an event handler. For example, you might call the method and pass in an value of `Hide` from within the event handler for the event.
+
+
+
+## Examples
+ The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
+
+ This code excerpt demonstrates calling the method. See the class overview for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/CPP/chartcontrol.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AccessibleEvents/Overview/chartcontrol.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet5":::
+
]]>
@@ -507,18 +507,18 @@
Gets the assigned to the control.
The assigned to the control.
- method.
-
- If no is currently assigned to the control, a new instance of one is created.
-
+ method.
+
+ If no is currently assigned to the control, a new instance of one is created.
+
> [!NOTE]
-> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the.NET Framework.
-
- For more information about accessible objects, see [Active Accessibility](/windows/win32/winauto/microsoft-active-accessibility).
-
+> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the.NET Framework.
+
+ For more information about accessible objects, see [Active Accessibility](/windows/win32/winauto/microsoft-active-accessibility).
+
]]>
@@ -565,24 +565,24 @@
Gets or sets the default action description of the control for use by accessibility client applications.
The default action description of the control for use by accessibility client applications.
- property describes the object's primary method of manipulation from the user's viewpoint. This property should be a verb or a short verb phrase.
-
+ property describes the object's primary method of manipulation from the user's viewpoint. This property should be a verb or a short verb phrase.
+
> [!NOTE]
-> Not all objects have default actions, and some objects might have a default action that is related to its property, such as in the following examples:
-
-- A selected check box has a default action of "Uncheck" and a value of "Checked."
-
-- A cleared check box has a default action of "Check" and a value of "Unchecked."
-
-- A button labeled "Print" has a default action of "Press," with no value.
-
-- A label or a text box control that shows "Printer" has no default action, but would have a value of "Printer."
-
- For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
-
+> Not all objects have default actions, and some objects might have a default action that is related to its property, such as in the following examples:
+
+- A selected check box has a default action of "Uncheck" and a value of "Checked."
+
+- A cleared check box has a default action of "Check" and a value of "Unchecked."
+
+- A button labeled "Print" has a default action of "Press," with no value.
+
+- A label or a text box control that shows "Printer" has no default action, but would have a value of "Printer."
+
+ For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
+
]]>
@@ -626,24 +626,24 @@
Gets or sets the description of the control used by accessibility client applications.
The description of the control used by accessibility client applications. The default is .
- property provides a textual description about an object's visual appearance. The description is primarily used to provide greater context for low-vision or blind users, but can also be used for context searching or other applications.
-
- The property is needed if the description is not obvious, or if it is redundant based on the object's , , , and properties. For example, a button with "OK" would not need additional information, but a button that shows a picture of a cactus would. The , and (and perhaps ) properties for the cactus button would describe its purpose, but the property would convey information that is less tangible, such as "A button that shows a picture of a cactus."
-
- For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
-
-
-
-## Examples
- The following code example creates an instance of a derived class, `MyCheckBox`, assigns it an to its property and sets the and properties, because the property is `null`. This example requires that you have a named `MyForm`.
-
+ property provides a textual description about an object's visual appearance. The description is primarily used to provide greater context for low-vision or blind users, but can also be used for context searching or other applications.
+
+ The property is needed if the description is not obvious, or if it is redundant based on the object's , , , and properties. For example, a button with "OK" would not need additional information, but a button that shows a picture of a cactus would. The , and (and perhaps ) properties for the cactus button would describe its purpose, but the property would convey information that is less tangible, such as "A button that shows a picture of a cactus."
+
+ For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
+
+
+
+## Examples
+ The following code example creates an instance of a derived class, `MyCheckBox`, assigns it an to its property and sets the and properties, because the property is `null`. This example requires that you have a named `MyForm`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/CPP/controlaccessibility.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control+ControlAccessibleObject/Overview/controlaccessibility.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/VB/controlaccessibility.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/VB/controlaccessibility.vb" id="Snippet2":::
+
]]>
@@ -687,22 +687,22 @@
Gets or sets the name of the control used by accessibility client applications.
The name of the control used by accessibility client applications. The default is .
- property is a label that briefly describes and identifies the object within its container, such as the text in a , the name of a , or a label displayed next to a control.
-
- For more information about properties of accessible objects, see the "[Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
-
-
-
-## Examples
- The following code example creates an instance of a derived class, `MyCheckBox`, assigns it an to its property and sets the and properties since the property is `null`. This example requires that you have a named `MyForm`.
-
+ property is a label that briefly describes and identifies the object within its container, such as the text in a , the name of a , or a label displayed next to a control.
+
+ For more information about properties of accessible objects, see the "[Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
+
+
+
+## Examples
+ The following code example creates an instance of a derived class, `MyCheckBox`, assigns it an to its property and sets the and properties since the property is `null`. This example requires that you have a named `MyForm`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/CPP/controlaccessibility.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control+ControlAccessibleObject/Overview/controlaccessibility.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/VB/controlaccessibility.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.ControlAccessibleObject/VB/controlaccessibility.vb" id="Snippet2":::
+
]]>
@@ -741,13 +741,13 @@
Gets or sets the accessible role of the control.
One of the values of . The default is .
- property describes what kind of user interface element an object is. If the control's role cannot be determined, the property is set to `Default`.
-
- For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
-
+ property describes what kind of user interface element an object is. If the control's role cannot be determined, the property is set to `Default`.
+
+ For more information about properties of accessible objects, see [Content of Descriptive Properties](/windows/win32/winauto/content-of-descriptive-properties).
+
]]>
The value assigned is not one of the values.
@@ -793,15 +793,15 @@
if drag-and-drop operations are allowed in the control; otherwise, . The default is .
- method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
-
+ method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/CPP/imagedrag.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/AllowDrop/imagedrag.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
+
]]>
@@ -853,25 +853,25 @@
Gets or sets the edges of the container to which a control is bound and determines how a control is resized with its parent.
A bitwise combination of the values. The default is and .
- property to define how a control is automatically resized as its parent control is resized. Anchoring a control to its parent control ensures that the anchored edges remain in the same position relative to the edges of the parent control when the parent control is resized.
-
- You can anchor a control to one or more edges of its container. For example, if you have a with a whose property value is set to `Top` and `Bottom`, the is stretched to maintain the anchored distance to the top and bottom edges of the as the of the is increased.
-
+ property to define how a control is automatically resized as its parent control is resized. Anchoring a control to its parent control ensures that the anchored edges remain in the same position relative to the edges of the parent control when the parent control is resized.
+
+ You can anchor a control to one or more edges of its container. For example, if you have a with a whose property value is set to `Top` and `Bottom`, the is stretched to maintain the anchored distance to the top and bottom edges of the as the of the is increased.
+
> [!NOTE]
-> The and properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.
-
-
-
-## Examples
- The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
-
+> The and properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.
+
+
+
+## Examples
+ The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
+
]]>
@@ -971,11 +971,11 @@
if enabled; otherwise, .
-
@@ -1013,11 +1013,11 @@
This event is not relevant for this class.
-
@@ -1052,22 +1052,22 @@
Gets or sets the background color for the control.
A that represents the background color of the control. The default is the value of the property.
- property does not support transparent colors unless the `SupportsTransparentBackColor` value of is set to `true`.
-
- The property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
-
-
-
-## Examples
- The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
-
+ property does not support transparent colors unless the `SupportsTransparentBackColor` value of is set to `true`.
+
+ The property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
+
+
+
+## Examples
+ The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
+
]]>
@@ -1101,24 +1101,24 @@
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -1161,26 +1161,26 @@
Gets or sets the background image displayed in the control.
An that represents the image to display in the background of the control.
- property to place a graphic image onto a control.
-
+ property to place a graphic image onto a control.
+
> [!NOTE]
-> Images with translucent or transparent colors are not supported by Windows Forms controls as background images.
->
-> This property is not supported on child controls whose property is `true`.
-
-
-
-## Examples
- The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
-
+> Images with translucent or transparent colors are not supported by Windows Forms controls as background images.
+>
+> This property is not supported on child controls whose property is `true`.
+
+
+
+## Examples
+ The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
+
]]>
@@ -1218,24 +1218,24 @@
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -1279,13 +1279,13 @@
Gets or sets the background image layout as defined in the enumeration.
One of the values of ( , , , , or ). is the default value.
- property to specify the position and behavior of an image you have placed onto a control. takes effect only if the property is set.
-
- You can increase performance for large images if you set to something other than .
-
+ property to specify the position and behavior of an image you have placed onto a control. takes effect only if the property is set.
+
+ You can increase performance for large images if you set to something other than .
+
]]>
The specified enumeration value does not exist.
@@ -1319,23 +1319,23 @@
Occurs when the property changes.
- property changes either programmatically or by user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ property changes either programmatically or by user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet9":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet9":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet9":::
+
]]>
@@ -1424,28 +1424,28 @@
Executes the specified delegate asynchronously on the thread that the control's underlying handle was created on.
An that represents the result of the operation.
- will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.
-
- You can call to retrieve the return value from the delegate, if neccesary, but this is not required. will block until the return value can be retrieved.
-
+ will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.
+
+ You can call to retrieve the return value from the delegate, if neccesary, but this is not required. will block until the return value can be retrieved.
+
> [!NOTE]
-> Most methods on a control can only be called from the thread where the control was created. In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. The invoke methods always invoke their callbacks on the control's thread.
-
+> Most methods on a control can only be called from the thread where the control was created. In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. The invoke methods always invoke their callbacks on the control's thread.
+
> [!NOTE]
-> An exception might be thrown if the thread that should process the message is no longer active.
-
-
-
-## Examples
- The following code example demonstrates a use of the method.
-
+> An exception might be thrown if the thread that should process the message is no longer active.
+
+
+
+## Examples
+ The following code example demonstrates a use of the method.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_BeginInvoke/CPP/control_begininvoke.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BeginInvoke/control_begininvoke.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_BeginInvoke/VB/control_begininvoke.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_BeginInvoke/VB/control_begininvoke.vb" id="Snippet2":::
+
]]>
No appropriate window handle can be found.
@@ -1506,28 +1506,28 @@
Executes the specified delegate asynchronously with the specified arguments, on the thread that the control's underlying handle was created on.
An that represents the result of the operation.
- will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.
-
- You can call to retrieve the return value from the delegate, if neccesary, but this is not required. will block until the return value can be retrieved.
-
+ will throw an exception. Exceptions within the delegate method are considered untrapped and will be sent to the application's untrapped exception handler.
+
+ You can call to retrieve the return value from the delegate, if neccesary, but this is not required. will block until the return value can be retrieved.
+
> [!NOTE]
-> Most methods on a control can only be called from the thread where the control was created. In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. The invoke methods always invoke their callbacks on the control's thread.
-
+> Most methods on a control can only be called from the thread where the control was created. In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread. The invoke methods always invoke their callbacks on the control's thread.
+
> [!NOTE]
-> An exception might be thrown if the thread that should process the message is no longer active.
-
-
-
-## Examples
- The following code example demonstrates a use of the method.
-
+> An exception might be thrown if the thread that should process the message is no longer active.
+
+
+
+## Examples
+ The following code example demonstrates a use of the method.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_BeginInvoke/CPP/control_begininvoke.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BeginInvoke/control_begininvoke.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_BeginInvoke/VB/control_begininvoke.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_BeginInvoke/VB/control_begininvoke.vb" id="Snippet1":::
+
]]>
No appropriate window handle can be found.
@@ -1588,22 +1588,22 @@
Gets or sets the for the control.
A for the control.
- of a is used to return a single for all data-bound controls contained by the . The keeps all controls that are bound to the same data source synchronized. For example, setting the property of the specifies the item in the underlying list that all data-bound controls point to.
-
- For more information about creating a new and assigning it to the property, see the .
-
-
-
-## Examples
- The following code example creates four objects to bind five controls, a and four controls, to several data sources. The is then used to get the for each data source.
-
+ of a is used to return a single for all data-bound controls contained by the . The keeps all controls that are bound to the same data source synchronized. For example, setting the property of the specifies the item in the underlying list that all data-bound controls point to.
+
+ For more information about creating a new and assigning it to the property, see the .
+
+
+
+## Examples
+ The following code example creates four objects to bind five controls, a and four controls, to several data sources. The is then used to get the for each data source.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic BindingContext Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingContext/Overview/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext Example/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic BindingContext Example/VB/source.vb" id="Snippet1":::
+
]]>
@@ -1638,24 +1638,24 @@
Occurs when the value of the property changes.
- to the through the property, see the constructor.
-
- This event is raised if the property is changed is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example adds an delegate to the event of a control.
-
+ to the through the property, see the constructor.
+
+ This event is raised if the property is changed is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example adds an delegate to the event of a control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Control.BindingContextChanged Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BindingContextChanged/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.BindingContextChanged Example/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.BindingContextChanged Example/VB/source.vb" id="Snippet1":::
+
]]>
@@ -1702,22 +1702,22 @@
Gets the distance, in pixels, between the top edge of the control and the top edge of its container's client area.
An representing the distance, in pixels, between the top edge of the control and the top edge of its container's client area.
- property value, and the property value.
-
- The property is a read-only property. You can manipulate this property value by changing the value of the or properties or calling the , , , or methods.
-
-
-
-## Examples
- The following code example uses the property to define the lower limit of a control relative to the client area of the container.
-
+ property value, and the property value.
+
+ The property is a read-only property. You can manipulate this property value by changing the value of the or properties or calling the , , , or methods.
+
+
+
+## Examples
+ The following code example uses the property to define the lower limit of a control relative to the client area of the container.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyUp/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bottom/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -1762,20 +1762,20 @@
Gets or sets the size and location of the control including its nonclient elements, in pixels, relative to the parent control.
A in pixels relative to the parent control that represents the size and location of the control including its nonclient elements.
- method is called to set the property. The property is not always changed through its `set` method so you should override the method to ensure that your code is executed when the property is set.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+ method is called to set the property. The property is not always changed through its `set` method so you should override the method to ensure that your code is executed when the property is set.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
]]>
@@ -1808,20 +1808,20 @@
Brings the control to the front of the z-order.
- does not make a control a top-level control, and it does not raise the event.
-
-
-
-## Examples
- The following code example ensures that a is visible by calling its method. This example requires that you have a with a named `panel1`, and a named `label1`.
-
+ does not make a control a top-level control, and it does not raise the event.
+
+
+
+## Examples
+ The following code example ensures that a is visible by calling its method. This example requires that you have a with a named `panel1`, and a named `label1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members4/CPP/controlmembers4.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BringToFront/controlmembers4.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet1":::
+
]]>
@@ -1858,11 +1858,11 @@
in all cases.
-
@@ -1906,20 +1906,20 @@
if the control can receive focus; otherwise, .
- and properties must both be set to `true` for both the control and all its parent controls, and the control must be a form or the control's outermost parent must be a form.
-
-
-
-## Examples
- The following code example sets focus to the specified , if it can receive focus.
-
+ and properties must both be set to `true` for both the control and all its parent controls, and the control must be a form or the control's outermost parent must be a form.
+
+
+
+## Examples
+ The following code example sets focus to the specified , if it can receive focus.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet1":::
+
]]>
@@ -1960,11 +1960,11 @@
if the control is hosted as an ActiveX control whose events are not frozen; otherwise, .
-
@@ -2012,44 +2012,44 @@
if the control can be selected; otherwise, .
- is set to `true`, is contained in another control, the control itself is visible and enabled, and all its parent controls are visible and enabled.
-
- The Windows Forms controls in the following list are not selectable and will return a value of `false` for the property. Controls derived from these controls are also not selectable.
-
--
-
--
-
--
-
--
-
--
-
--
-
-- (when there is no link present in the control)
-
-
-
-## Examples
- The following code example selects the specified , if it is selectable.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet2":::
- :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet2":::
-
- ]]>
-
-
-
-
-
-
-
+ is set to `true`, is contained in another control, the control itself is visible and enabled, and all its parent controls are visible and enabled.
+
+ The Windows Forms controls in the following list are not selectable and will return a value of `false` for the property. Controls derived from these controls are also not selectable.
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+- (when there is no link present in the control)
+
+
+
+## Examples
+ The following code example selects the specified , if it is selectable.
+
+ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet2":::
+ :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet2":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet2":::
+
+ ]]>
+
+
+
+
+
+
+
@@ -2094,24 +2094,24 @@
if the control has captured the mouse; otherwise, .
- property. To run this example paste the following code in a form containing a named label1 and two controls named listbox1 and listbox2. Ensure the form and controls' event is associated with the method in this example.
-
+ property. To run this example paste the following code in a form containing a named label1 and two controls named listbox1 and listbox2. Ensure the form and controls' event is associated with the method in this example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlCapture/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Capture/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlCapture/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlCapture/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -2152,22 +2152,22 @@
if the control causes validation to be performed on any controls requiring validation when it receives focus; otherwise, . The default is .
- property is set to `false`, the and events are suppressed.
-
- The property value is typically set to `false` for controls such as a Help button.
-
-
-
-## Examples
- The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. One of the buttons on the form has its property set to `false`. Clicking or setting focus to this button does not trigger validation. This example requires that a , an control, and a have been created on a form.
-
+ property is set to `false`, the and events are suppressed.
+
+ The property value is typically set to `false` for controls such as a Help button.
+
+
+
+## Examples
+ The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. One of the buttons on the form has its property set to `false`. Clicking or setting focus to this button does not trigger validation. This example requires that a , an control, and a have been created on a form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Validating/CPP/validating.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CausesValidation/validating.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet2":::
+
]]>
@@ -2198,13 +2198,13 @@
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
]]>
@@ -2235,21 +2235,21 @@
Occurs when the focus or keyboard user interface (UI) cues change.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet67":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet67":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet67":::
+
]]>
@@ -2302,11 +2302,11 @@
if calls on the wrong thread are caught; otherwise, .
- property. Set to `true` to find and diagnose this thread activity more easily while debugging.
-
+ property. Set to `true` to find and diagnose this thread activity more easily while debugging.
+
]]>
@@ -2335,27 +2335,27 @@
Occurs when the control is clicked.
- event passes an to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the event. However, the event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.
-
- A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The event is raised every time a control is double-clicked. For example, if you have event handlers for the and events of a , the and events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the event, the event might be raised twice.
-
- You must set the `StandardClick` value of to `true` for this event to be raised.
-
+ event passes an to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (button, number of clicks, wheel rotation, or location), use the event. However, the event will not be raised if the click is caused by action other than that of the mouse, such as pressing the ENTER key.
+
+ A double-click is determined by the mouse settings of the user's operating system. The user can set the time between clicks of a mouse button that should be considered a double-click rather than two clicks. The event is raised every time a control is double-clicked. For example, if you have event handlers for the and events of a , the and events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the event, the event might be raised twice.
+
+ You must set the `StandardClick` value of to `true` for this event to be raised.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
## Notes to inheritors
Inheriting from a standard Windows Forms control and changing the `StandardClick` or `StandardDoubleClick` values of to `true` can cause unexpected behavior or have no effect at all if the control does not support the or events.
-
+
The following table lists Windows Forms controls and which event ( or ) is raised in response to the mouse action specified.
-| Control | Left Mouse Click | Left Mouse Double Click | Right Mouse Click | Right Mouse Double Click | Middle Mouse Click | Middle Mouse Double Click | XButton1 Mouse Click | XButton1 Mouse Double-Click | XButton2 Mouse Click | XButton2 Mouse Double-Click |
+| Control | Left Mouse Click | Left Mouse Double Click | Right Mouse Click | Right Mouse Double Click | Middle Mouse Click | Middle Mouse Double Click | XButton1 Mouse Click | XButton1 Mouse Double-Click | XButton2 Mouse Click | XButton2 Mouse Double-Click |
| ------- | ---------------- | ----------------------- | ----------------- | ------------------------ | ------------------ | ------------------------- | -------------------- | --------------------------- | -------------------- | --------------------------- |
| , , , | none | none | none | none | none | none | none | none | none | none |
| , , , | Click | Click, Click | none | none | none | none | none | none | none | none |
@@ -2365,17 +2365,17 @@ The following table lists Windows Forms controls and which event (, | Click | Click, Click | Click | Click, Click | Click | Click, Click | Click | Click, Click | Click | Click, Click |
| , , , , , , , , , , , \*\* | Click | Click, DoubleClick | Click | Click, DoubleClick | Click | Click, DoubleClick | Click | Click, DoubleClick | Click | Click, DoubleClick |
-\* The mouse pointer must be over a child object ( or ).
-
+\* The mouse pointer must be over a child object ( or ).
+
** The must have at least one in its collection.
-## Examples
- The following code example shows the event in an event handler.
-
+## Examples
+ The following code example shows the event in an event handler.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.FindForm/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Click/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -2423,24 +2423,24 @@ The following table lists Windows Forms controls and which event (Gets the rectangle that represents the client area of the control.
A that represents the client area of the control.
- with a named `button2` on it.
-
+ with a named `button2` on it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Member5/CPP/controlmembers5.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ClientRectangle/controlmembers5.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet2":::
+
]]>
@@ -2485,27 +2485,27 @@ The following table lists Windows Forms controls and which event (Gets or sets the height and width of the client area of the control.
A that represents the dimensions of the client area of the control.
- method is called to set the property. The property is not always changed through its `set` method so you should override the method to ensure that your code is executed when the property is set.
-
- The and properties represent the width and height of the client area of the control. You can use this property to obtain the size of the client area of the control for tasks such as drawing on the surface of the control.
-
- For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/framework/winforms/controls/rendering-a-windows-forms-control).
-
+ method is called to set the property. The property is not always changed through its `set` method so you should override the method to ensure that your code is executed when the property is set.
+
+ The and properties represent the width and height of the client area of the control. You can use this property to obtain the size of the client area of the control for tasks such as drawing on the surface of the control.
+
+ For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/framework/winforms/controls/rendering-a-windows-forms-control).
+
> [!NOTE]
-> You cannot bind application settings to this property. For more information on application settings, see [Application Settings Overview](/dotnet/framework/winforms/advanced/application-settings-overview).
-
-
-
-## Examples
- The following code example resizes the specified control so the control will accommodate its formatted text. The formatted text is the property with the control's assigned applied to the text. The `AutoSizeControl` method in this example also has a `textPadding` parameter that represents the padding to apply to all edges of the control. To make the padding appear equal, align the text with the value, if your control supports it.
-
+> You cannot bind application settings to this property. For more information on application settings, see [Application Settings Overview](/dotnet/framework/winforms/advanced/application-settings-overview).
+
+
+
+## Examples
+ The following code example resizes the specified control so the control will accommodate its formatted text. The formatted text is the property with the control's assigned applied to the text. The `AutoSizeControl` method in this example also has a `textPadding` parameter that represents the padding to apply to all edges of the control. To make the padding appear equal, align the text with the value, if your control supports it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Member5/CPP/controlmembers5.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ClientRectangle/controlmembers5.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet1":::
+
]]>
@@ -2535,21 +2535,21 @@ The following table lists Windows Forms controls and which event (
Occurs when the value of the property changes.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet12":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet12":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet12":::
+
]]>
@@ -2596,27 +2596,27 @@ The following table lists Windows Forms controls and which event (Gets the name of the company or creator of the application containing the control.
The company name or creator of the application containing the control.
- property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
-
-```csharp
-[assembly: AssemblyCompany("Microsoft")]
-```
-
+ property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
+
+```csharp
+[assembly: AssemblyCompany("Microsoft")]
+```
+
> [!NOTE]
-> It is strongly recommended that you provide the company name, product name, and product version for your app.
-
-
-
-## Examples
- The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
-
+> It is strongly recommended that you provide the company name, product name, and product version for your app.
+
+
+
+## Examples
+ The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties3/CPP/aboutdialog.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CompanyName/aboutdialog.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
+
]]>
@@ -2653,15 +2653,15 @@ The following table lists Windows Forms controls and which event (
if the specified control is a child of the control; otherwise, .
- is visible by calling its method. This example requires that you have a with a named `panel1`, and a named `label1`.
-
+ is visible by calling its method. This example requires that you have a with a named `panel1`, and a named `label1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members4/CPP/controlmembers4.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BringToFront/controlmembers4.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet1":::
+
]]>
@@ -2708,11 +2708,11 @@ The following table lists Windows Forms controls and which event (
if the control or one of its child controls currently has the input focus; otherwise, .
- property. To give a control the input focus, use the or methods.
-
+ property. To give a control the input focus, use the or methods.
+
]]>
@@ -2752,20 +2752,20 @@ The following table lists Windows Forms controls and which event (Gets or sets the shortcut menu associated with the control.
A that represents the shortcut menu associated with the control.
- assigned to a when the right mouse button is clicked and released. This code requires that you have a with a on it. It is also required that the has a assigned to its property.
-
+ assigned to a when the right mouse button is clicked and released. This code requires that you have a with a on it. It is also required that the has a assigned to its property.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties2/CPP/misccontrolproperties.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenu/misccontrolproperties.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet5":::
+
]]>
@@ -2800,22 +2800,22 @@ The following table lists Windows Forms controls and which event (
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example displays a message when a change occurs to the shortcut menu.
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example displays a message when a change occurs to the shortcut menu.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_ContextMenu_CreateGraphics/CPP/control_contextmenu_creategraphics.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenuChanged/control_contextmenu_creategraphics.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_ContextMenu_CreateGraphics/VB/control_contextmenu_creategraphics.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_ContextMenu_CreateGraphics/VB/control_contextmenu_creategraphics.vb" id="Snippet2":::
+
]]>
@@ -2853,19 +2853,19 @@ The following table lists Windows Forms controls and which event (Gets or sets the associated with this control.
The for this control, or if there is no . The default is .
- has also been assigned to the control, the takes precedence over the .
-
-
-
-## Examples
- The following code example demonstrates how to add three objects to a . In addition it demonstrates setting the property of the form.
-
+ has also been assigned to the control, the takes precedence over the .
+
+
+
+## Examples
+ The following code example demonstrates how to add three objects to a . In addition it demonstrates setting the property of the form.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenuStrip/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.ContextMenuStrip/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.ContextMenuStrip/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -2893,21 +2893,21 @@ The following table lists Windows Forms controls and which event (
Occurs when the value of the property changes.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet14":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet14":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet14":::
+
]]>
@@ -2950,20 +2950,20 @@ The following table lists Windows Forms controls and which event (
Occurs when a new control is added to the .
- to add a control to a form and displays the name of the added control in a .
-
+ to add a control to a form and displays the name of the added control in a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.ControlRemoved/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ControlAdded/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -3009,20 +3009,20 @@ The following table lists Windows Forms controls and which event (
Occurs when a control is removed from the .
- to remove a control from a form and displays the name of the removed control in a .
-
+ to remove a control from a form and displays the name of the removed control in a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.ControlRemoved/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ControlAdded/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -3064,26 +3064,26 @@ The following table lists Windows Forms controls and which event (Gets the collection of controls contained within the control.
A representing the collection of controls contained within the control.
- can act as a parent to a collection of controls. For example, when several controls are added to a , each of the controls is a member of the assigned to the property of the form, which is derived from the class.
-
- You can manipulate the controls in the assigned to the property by using the methods available in the class.
-
- When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. Doing so will increase the performance of applications with many controls.
-
- Use the property to iterate through all controls of a form, including nested controls. Use the method to retrieve the previous or next child control in the tab order. Use the property to get or set the active control of a container control.
-
-
-
-## Examples
- The following code example removes a from the of the derived class if it is a member of the collection. The example requires that you have created a , a , and at least one control on a . The control(s) are added to the control, and the control added to the . When the button is clicked, the radio button named `removeButton` is removed from the .
-
+ can act as a parent to a collection of controls. For example, when several controls are added to a , each of the controls is a member of the assigned to the property of the form, which is derived from the class.
+
+ You can manipulate the controls in the assigned to the property by using the methods available in the class.
+
+ When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. Doing so will increase the performance of applications with many controls.
+
+ Use the property to iterate through all controls of a form, including nested controls. Use the method to retrieve the previous or next child control in the tab order. Use the property to get or set the active control of a container control.
+
+
+
+## Examples
+ The following code example removes a from the of the derived class if it is a member of the collection. The example requires that you have created a , a , and at least one control on a . The control(s) are added to the control, and the control added to the . When the button is clicked, the radio button named `removeButton` is removed from the .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ControlCollection/CPP/controlcollection.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control+ControlCollection/Overview/controlcollection.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ControlCollection/VB/controlcollection.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ControlCollection/VB/controlcollection.vb" id="Snippet4":::
+
]]>
@@ -3123,25 +3123,25 @@ The following table lists Windows Forms controls and which event (Creates a new accessibility object for the control.
A new for the control.
- method, it will be called when the property is referenced.
-
+ method, it will be called when the property is referenced.
+
> [!NOTE]
-> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework.
-
-
-
-## Examples
- The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
-
- This code excerpt demonstrates overriding the method. See the class overview for the complete code example.
-
+> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework.
+
+
+
+## Examples
+ The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
+
+ This code excerpt demonstrates overriding the method. See the class overview for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/CPP/chartcontrol.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AccessibleEvents/Overview/chartcontrol.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet2":::
+
]]>
@@ -3175,13 +3175,13 @@ The following table lists Windows Forms controls and which event (
Forces the creation of the visible control, including the creation of the handle and any visible child controls.
- method forces a handle to be created for the control and its child controls. This method is used when you need a handle immediately for manipulation of the control or its children; simply calling a control's constructor does not create the .
-
- does not create a control handle if the control's property is `false`. You can either call the method or access the property to create the control's handle regardless of the control's visibility, but in this case, no window handles are created for the control's children.
-
+ method forces a handle to be created for the control and its child controls. This method is used when you need a handle immediately for manipulation of the control or its children; simply calling a control's constructor does not create the .
+
+ does not create a control handle if the control's property is `false`. You can either call the method or access the property to create the control's handle regardless of the control's visibility, but in this case, no window handles are created for the control's children.
+
]]>
@@ -3272,11 +3272,11 @@ The following table lists Windows Forms controls and which event (
if the control has been created; otherwise, .
- property returns `true` if the was successfully created even though the control's handle might not have been created or recreated yet.
-
+ property returns `true` if the was successfully created even though the control's handle might not have been created or recreated yet.
+
]]>
@@ -3309,25 +3309,25 @@ The following table lists Windows Forms controls and which event (Creates the for the control.
The for the control.
- object that you retrieve through the method should not normally be retained after the current Windows message has been processed, because anything painted with that object will be erased with the next WM_PAINT message. Therefore you cannot cache the object for reuse, except to use non-visual methods like . Instead, you must call every time that you want to use the object, and then call when you are finished using it. For more information about Windows messages, see .
-
- By design, sets ownership to the calling thread, and fails if it is called on other threads.
-
+ object that you retrieve through the method should not normally be retained after the current Windows message has been processed, because anything painted with that object will be erased with the next WM_PAINT message. Therefore you cannot cache the object for reuse, except to use non-visual methods like . Instead, you must call every time that you want to use the object, and then call when you are finished using it. For more information about Windows messages, see .
+
+ By design, sets ownership to the calling thread, and fails if it is called on other threads.
+
> [!NOTE]
-> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
-
-
-
-## Examples
- The following code example resizes the specified control so the control will accommodate its formatted text. The formatted text is the property with the control's assigned applied to the text. The `AutoSizeControl` method in this example also has a `textPadding` parameter that represents the padding to apply to all edges of the control. To make the padding appear equal, align the text with the `MiddleCenter` value of if your control supports it.
-
+> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
+
+
+
+## Examples
+ The following code example resizes the specified control so the control will accommodate its formatted text. The formatted text is the property with the control's assigned applied to the text. The `AutoSizeControl` method in this example also has a `textPadding` parameter that represents the padding to apply to all edges of the control. To make the padding appear equal, align the text with the `MiddleCenter` value of if your control supports it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Member5/CPP/controlmembers5.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ClientRectangle/controlmembers5.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Member5/VB/controlmembers5.vb" id="Snippet1":::
+
]]>
@@ -3363,11 +3363,11 @@ The following table lists Windows Forms controls and which event (
Creates a handle for the control.
- method directly. The preferred method is to call the method, which forces a handle to be created for the control and its child controls when the control is created.
-
+ method directly. The preferred method is to call the method, which forces a handle to be created for the control and its child controls when the control is created.
+
]]>
The object is in a disposed state.
@@ -3409,20 +3409,20 @@ The following table lists Windows Forms controls and which event (Gets the required creation parameters when the control handle is created.
A that contains the required creation parameters when the handle to the control is created.
- property should not be overridden and used to adjust the properties of your derived control. Properties such as the , , and should be set by the corresponding properties in your control such as , and . The should only be extended when you are wrapping a standard Windows control class or to set styles not provided by the Windows Forms namespace. For more information about creating control parameters, see the `CreateWindow` and `CreateWindowEx` functions and the [CREATESTRUCT](/windows/win32/api/winuser/ns-winuser-createstructa) structure documentation.
-
-
-
-## Examples
- The following code example extends the property of a derived class. The property is changed, which causes the button to display an rather than an . This example requires that you have a class that inherits from the class.
-
+ property should not be overridden and used to adjust the properties of your derived control. Properties such as the , , and should be set by the corresponding properties in your control such as , and . The should only be extended when you are wrapping a standard Windows control class or to set styles not provided by the Windows Forms namespace. For more information about creating control parameters, see the `CreateWindow` and `CreateWindowEx` functions and the [CREATESTRUCT](/windows/win32/api/winuser/ns-winuser-createstructa) structure documentation.
+
+
+
+## Examples
+ The following code example extends the property of a derived class. The property is changed, which causes the button to display an rather than an . This example requires that you have a class that inherits from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CreateParams/CPP/createparams.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CreateParams/createparams.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CreateParams/VB/createparams.vb" id="Snippet3":::
+
]]>
@@ -3470,22 +3470,22 @@ The following table lists Windows Forms controls and which event (Gets or sets the cursor that is displayed when the mouse pointer is over the control.
A that represents the cursor to display when the mouse pointer is over the control.
- to the property of the control to change the cursor displayed when the mouse pointer is over the control. To temporarily change the mouse cursor for all controls on your application set the property. Typically you would set the property to a wait cursor when populating a or saving or loading a file.
-
- The property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
-
-
-
-## Examples
- The following code example fills a with the user's available logical drives. The example also sets the combo box's property so the cursor is displayed when the mouse pointer is over the drop-down button. This code requires that you have a with a on it.
-
+ to the property of the control to change the cursor displayed when the mouse pointer is over the control. To temporarily change the mouse cursor for all controls on your application set the property. Typically you would set the property to a wait cursor when populating a or saving or loading a file.
+
+ The property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
+
+
+
+## Examples
+ The following code example fills a with the user's available logical drives. The example also sets the combo box's property so the cursor is displayed when the mouse pointer is over the drop-down button. This code requires that you have a with a on it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties2/CPP/misccontrolproperties.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenu/misccontrolproperties.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet1":::
+
]]>
@@ -3519,22 +3519,22 @@ The following table lists Windows Forms controls and which event (
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates changing the mouse cursor using the property, the class, and the class. The example creates a form that contains a control, a control, and a control. The contains all cursors provided by the class. When the user selects a mouse cursor in the , the property is set to the selected cursor, which updates the cursor for the . The is updated every time the event occurs.
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates changing the mouse cursor using the property, the class, and the class. The example creates a form that contains a control, a control, and a control. The contains all cursors provided by the class. When the user selects a mouse cursor in the , the property is set to the selected cursor, which updates the cursor for the . The is updated every time the event occurs.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Cursors/CPP/cursorexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CursorChanged/cursorexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Cursors/VB/cursorexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Cursors/VB/cursorexample.vb" id="Snippet1":::
+
]]>
@@ -3583,20 +3583,20 @@ The following table lists Windows Forms controls and which event (Gets the data bindings for the control.
A that contains the objects for the control.
- property to access the . By adding objects to the collection, you can bind any property of a control to the property of an object.
-
-
-
-## Examples
- The following code example adds objects to the of five controls: four controls and a control. The is accessed through the property of the class.
-
+ property to access the . By adding objects to the collection, you can bind any property of a control to the property of an object.
+
+
+
+## Examples
+ The following code example adds objects to the of five controls: four controls and a control. The is accessed through the property of the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Control.DataBindings Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DataBindings/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.DataBindings Example/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.DataBindings Example/VB/source.vb" id="Snippet1":::
+
]]>
@@ -3630,9 +3630,10 @@ The following table lists Windows Forms controls and which event (System.Object
- To be added.
+ Gets or sets the data context for the purpose of data binding.
+ This is an ambient property.
To be added.
- To be added.
+ Data context is a concept that allows elements to inherit information from their parent elements about the data source that is used for binding. It's the duty of deriving controls which inherit from this class to handle the provided data source accordingly. For example, UserControls, which use components for data binding scenarios could either handle the event or override to provide the relevant data from the data context to a BindingSource component's .
@@ -3661,7 +3662,7 @@ The following table lists Windows Forms controls and which event (System.EventHandler
- To be added.
+ Occurs when the value of the property changes.
To be added.
@@ -3689,20 +3690,20 @@ The following table lists Windows Forms controls and which event (Gets the default background color of the control.
The default background of the control. The default is .
- property value of a generic top-level control. Derived classes can have different defaults.
-
-
-
-## Examples
- The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet1":::
- :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
-
+ property value of a generic top-level control. Derived classes can have different defaults.
+
+
+
+## Examples
+ The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
+
+ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet1":::
+ :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -3733,11 +3734,11 @@ The following table lists Windows Forms controls and which event (Gets or sets the default cursor for the control.
An object of type representing the current default cursor.
- to configure a default cursor for your control. This is more efficient than setting the cursor in the control's constructor, and gives automatic support for certain cursor-related designer functions.
-
+ to configure a default cursor for your control. This is more efficient than setting the cursor in the control's constructor, and gives automatic support for certain cursor-related designer functions.
+
]]>
@@ -3766,30 +3767,30 @@ The following table lists Windows Forms controls and which event (Gets the default font of the control.
The default of the control. The value returned will vary depending on the user's operating system the local culture setting of their system.
- depending on the operating system and local culture.
-
-|System/and or Culture|Font|
-|----------------------------|----------|
-|Windows NT 4x, Japanese version|MS UI Gothic, 9 point.|
-|Arabic Windows|Tahoma, 8 point.|
-|Other operating system/culture|MS Shell Dlg logical font, typically Microsoft San Serif 8 point.|
-
- MS Shell Dlg maps to a font set in the system registry.
-
- If the previous fonts are not installed, the default font is Tahoma, 8 point. If Tahoma, 8 point, is not installed, returns the value of the property
-
-
-
-## Examples
- The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
-
+ depending on the operating system and local culture.
+
+|System/and or Culture|Font|
+|----------------------------|----------|
+|Windows NT 4x, Japanese version|MS UI Gothic, 9 point.|
+|Arabic Windows|Tahoma, 8 point.|
+|Other operating system/culture|MS Shell Dlg logical font, typically Microsoft San Serif 8 point.|
+
+ MS Shell Dlg maps to a font set in the system registry.
+
+ If the previous fonts are not installed, the default font is Tahoma, 8 point. If Tahoma, 8 point, is not installed, returns the value of the property
+
+
+
+## Examples
+ The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
+
]]>
The default font or the regional alternative fonts are not installed on the client computer.
@@ -3821,20 +3822,20 @@ The following table lists Windows Forms controls and which event (Gets the default foreground color of the control.
The default foreground of the control. The default is .
- property value of a nonparented control. Derived classes can have different defaults.
-
-
-
-## Examples
- The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
-
+ property value of a nonparented control. Derived classes can have different defaults.
+
+
+
+## Examples
+ The following code example demonstrates how to use the , , and members. To run the example, paste the following code in a form containing a called ListBox1. Call the `Populate_ListBox` method in the form's constructor or event-handling method.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -3866,22 +3867,22 @@ The following table lists Windows Forms controls and which event (Gets the default Input Method Editor (IME) mode supported by the control.
One of the values.
- class, this property always returns the value. The value specifies that the IME mode is inherited from the parent control.
-
-
-
-## Examples
- The following code example overrides the property to turn off the Input Method Editor.
-
+ class, this property always returns the value. The value specifies that the IME mode is inherited from the parent control.
+
+
+
+## Examples
+ The following code example overrides the property to turn off the Input Method Editor.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties2/CPP/misccontrolproperties.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenu/misccontrolproperties.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet4":::
+
]]>
@@ -4045,26 +4046,26 @@ The following table lists Windows Forms controls and which event (Gets the default size of the control.
The default of the control.
- property represents the of the control when it is initially created. You can adjust the size of the control by setting its property value.
-
+ property represents the of the control when it is initially created. You can adjust the size of the control by setting its property value.
+
> [!NOTE]
-> To maintain better performance, do not set the of a control in its constructor. The preferred method is to override the property.
-
+> To maintain better performance, do not set the of a control in its constructor. The preferred method is to override the property.
+
> [!NOTE]
-> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
-
-
-
-## Examples
- The following code example overrides the property, and makes the default size of the form 500 pixels square.
-
+> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
+
+
+
+## Examples
+ The following code example overrides the property, and makes the default size of the form 500 pixels square.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties2/CPP/misccontrolproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ContextMenu/misccontrolproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties2/VB/misccontrolproperties.vb" id="Snippet3":::
+
]]>
@@ -4107,11 +4108,11 @@ The following table lists Windows Forms controls and which event (The Windows to process.
Sends the specified message to the default window procedure.
-
@@ -4237,11 +4238,11 @@ The following table lists Windows Forms controls and which event (Gets the rectangle that represents the display area of the control.
A that represents the display area of the control.
- property returns the client rectangle of the display area of the control. For the base control class, this is equal to the client rectangle. However, inheriting controls might want to change this if their client area differs from their display area. The display rectangle is the smallest that encloses a control and is used to lay out controls.
-
+ property returns the client rectangle of the display area of the control. For the base control class, this is equal to the client rectangle. However, inheriting controls might want to change this if their client area differs from their display area. The display rectangle is the smallest that encloses a control and is used to lay out controls.
+
]]>
@@ -4279,19 +4280,19 @@ The following table lists Windows Forms controls and which event ( to release both managed and unmanaged resources; to release only unmanaged resources.
Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources.
- method.`Dispose()` invokes the protected `Dispose(Boolean)` method with the `disposing` parameter set to `true`. 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 references. This method invokes the `Dispose()` method of each referenced object.
-
+ method.`Dispose()` invokes the protected `Dispose(Boolean)` method with the `disposing` parameter set to `true`. 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 references. This method invokes the `Dispose()` method of each referenced object.
+
]]>
- can be called multiple times by other objects. When overriding be careful not to reference objects that have been previously disposed of in an earlier call to . For more information about how to implement , see [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
-
+ can be called multiple times by other objects. When overriding be careful not to reference objects that have been previously disposed of in an earlier call to . For more information about how to implement , see [Implementing a Dispose Method](/dotnet/standard/garbage-collection/implementing-dispose).
+
For more information about and , see [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged) and [Overriding the Finalize Method](https://docs.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)).
@@ -4339,11 +4340,11 @@ The following table lists Windows Forms controls and which event (
if the base class is in the process of disposing; otherwise, .
- class is in the process of disposing. After the control is disposed of, it can no longer be referenced as a valid Windows control. Even though the instance of a control is disposed of, it is still maintained in memory until it is removed from memory through garbage collection. When a control is disposed of, you cannot call its method.
-
+ class is in the process of disposing. After the control is disposed of, it can no longer be referenced as a valid Windows control. Even though the instance of a control is disposed of, it is still maintained in memory until it is removed from memory through garbage collection. When a control is disposed of, you cannot call its method.
+
]]>
@@ -4393,27 +4394,27 @@ The following table lists Windows Forms controls and which event (Gets or sets which control borders are docked to its parent control and determines how a control is resized with its parent.
One of the values. The default is .
- property to define how a control is automatically resized as its parent control is resized. For example, setting to causes the control to align itself with the left edges of its parent control and to resize as the parent control is resized. Controls are docked in their Z-order, which is the visual layering of controls on a form along the form's Z-axis (depth).
-
- A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container.
-
- Setting the property on a docked control has no effect on the distance of the control from the edges of its container.
-
+ property to define how a control is automatically resized as its parent control is resized. For example, setting to causes the control to align itself with the left edges of its parent control and to resize as the parent control is resized. Controls are docked in their Z-order, which is the visual layering of controls on a form along the form's Z-axis (depth).
+
+ A control can be docked to one edge of its parent container or can be docked to all edges and fill the parent container.
+
+ Setting the property on a docked control has no effect on the distance of the control from the edges of its container.
+
> [!NOTE]
-> The and properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.
-
-
-
-## Examples
- The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
-
+> The and properties are mutually exclusive. Only one can be set at a time, and the last one set takes precedence.
+
+
+
+## Examples
+ The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
+
]]>
The value assigned is not one of the values.
@@ -4450,24 +4451,24 @@ The following table lists Windows Forms controls and which event (
Occurs when the value of the property changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes(*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes(*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -4505,76 +4506,76 @@ The following table lists Windows Forms controls and which event (Begins a drag-and-drop operation.
A value from the enumeration that represents the final effect that was performed during the drag-and-drop operation.
- , , or ), or an object that implements or .
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+ , , or ), or an object that implements or .
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
> [!NOTE]
-> The method catches all exceptions and rethrows only the following security or critical exceptions:
-
-- SecurityException
-
-- NullReferenceException
-
-- StackOverflowException
-
-- OutOfMemoryException
-
-- ThreadAbortException
-
-- ExecutionEngineException
-
-- IndexOutOfRangeException
-
-- AccessViolationException
-
-
-
-## Examples
- The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
-
- The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
-
- The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
-
- The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
-
+> The method catches all exceptions and rethrows only the following security or critical exceptions:
+
+- SecurityException
+
+- NullReferenceException
+
+- StackOverflowException
+
+- OutOfMemoryException
+
+- ThreadAbortException
+
+- ExecutionEngineException
+
+- IndexOutOfRangeException
+
+- AccessViolationException
+
+
+
+## Examples
+ The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
+
+ The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
+
+ The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
+
+ The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet1":::
-
- The following code example shows how to use the enumeration to specify how data should be transferred between the controls involved in a drag-and-drop operation. This example requires that your form includes a control and a control and that the control is populated with a list of valid file names. When the user drags a file name onto the control, the control's event is raised. Within the event handler, the property of the is initialized to to indicate that the data referenced by the file path should be copied to the control.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet1":::
+
+ The following code example shows how to use the enumeration to specify how data should be transferred between the controls involved in a drag-and-drop operation. This example requires that your form includes a control and a control and that the control is populated with a list of valid file names. When the user drags a file name onto the control, the control's event is raised. Within the event handler, the property of the is initialized to to indicate that the data referenced by the file path should be copied to the control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/RichTextDragDrop/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RichTextDragDrop/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RichTextDragDrop/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -4609,9 +4610,12 @@ The following table lists Windows Forms controls and which event (To be added.
To be added.
To be added.
- To be added.
- To be added.
- To be added.
+ Begins a drag operation.
+ A value from the enumeration that represents the final effect that was performed during the drag-and-drop operation.
+
+ The parameter determines which drag operations can occur. If the drag operation needs to interop with applications in another process, should either be a base managed class (, , or ) or some that implements . can also be any that implements . is the bitmap that will be displayed during the drag operation and specifies the location of the cursor within , which is an offset from the upper-left corner. Specify for to use a layered window drag image with a size of 96x96; otherwise . Note the outer edges of are blended out if the image width or height exceeds 300 pixels.
+ Because always performs the RGB multiplication step in calculating the alpha value, you should always pass a without premultiplied alpha blending. No error will result from passing a with premultiplied alpha blending, but this method will multiply it again, doubling the resulting alpha value.
+
@@ -4644,14 +4648,14 @@ The following table lists Windows Forms controls and which event (
if the surface of the control should be drawn using double buffering; otherwise, .
- [!NOTE]
-> is not a bindable property.
-
+> is not a bindable property.
+
]]>
@@ -4684,246 +4688,246 @@ The following table lists Windows Forms controls and which event (
Occurs when the control is double-clicked.
- event is raised every time a control is double-clicked. For example, if you have event handlers for the and events of a , the and events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the event, the event might be raised twice.
-
- You must set the `StandardDoubleClick` and `StandardClick` values of to `true` for this event to be raised. These values might already be set to `true` if you are inheriting from existing Windows Forms controls.
-
+ event is raised every time a control is double-clicked. For example, if you have event handlers for the and events of a , the and events are raised when the form is double-clicked and both methods are called. If a control is double-clicked and that control does not support the event, the event might be raised twice.
+
+ You must set the `StandardDoubleClick` and `StandardClick` values of to `true` for this event to be raised. These values might already be set to `true` if you are inheriting from existing Windows Forms controls.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event of a to load text files listed in the into a control.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event of a to load text files listed in the into a control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.DoubleClick/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoubleClick/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.DoubleClick/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.DoubleClick/VB/form1.vb" id="Snippet1":::
+
]]>
- Inheriting from a standard Windows Forms control and changing the or values of to can cause unexpected behavior or have no effect at all if the control does not support the or events.
-
- The following table lists Windows Forms controls and which event ( or ) is raised in response to the mouse action specified.
-
- Control
-
- Left Mouse Click
-
- Left Mouse Double Click
-
- Right Mouse Click
-
- Right Mouse Double Click
-
- Middle Mouse Click
-
- Middle Mouse Double Click
-
- XButton1 Mouse Click
-
- XButton1 Mouse Double-Click
-
- XButton2 Mouse Click
-
- XButton2 Mouse Double-Click
-
- - ,
-
- ,
-
- ,
-
- ,
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
-
- ,
-
- ,
-
- Click
-
- Click, Click
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
-
- ,
-
- ,
-
- Click
-
- Click, DoubleClick
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
-
- ,
-
- ,
-
- Click
-
- Click, DoubleClick
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
-
- * ,
-
- \* Click
-
- Click, DoubleClick
-
- Click
-
- Click, DoubleClick
-
- none
-
- none
-
- none
-
- none
-
- none
-
- none
-
-
- ,
-
- Click
-
- Click, Click
-
- Click
-
- Click, Click
-
- Click
-
- Click, Click
-
- Click
-
- Click, Click
-
- Click
-
- Click, Click
-
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ,
-
- ** Click
-
- Click, DoubleClick
-
- Click
-
- Click, DoubleClick
-
- Click
-
- Click, DoubleClick
-
- Click
-
- Click, DoubleClick
-
- Click
-
- Click, DoubleClick
-
-
-
- \* The mouse pointer must be over a child object ( or ).
-
+ Inheriting from a standard Windows Forms control and changing the or values of to can cause unexpected behavior or have no effect at all if the control does not support the or events.
+
+ The following table lists Windows Forms controls and which event ( or ) is raised in response to the mouse action specified.
+
+ Control
+
+ Left Mouse Click
+
+ Left Mouse Double Click
+
+ Right Mouse Click
+
+ Right Mouse Double Click
+
+ Middle Mouse Click
+
+ Middle Mouse Double Click
+
+ XButton1 Mouse Click
+
+ XButton1 Mouse Double-Click
+
+ XButton2 Mouse Click
+
+ XButton2 Mouse Double-Click
+
+ - ,
+
+ ,
+
+ ,
+
+ ,
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+
- ,
+
+ ,
+
+ Click
+
+ Click, Click
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+
- ,
+
+ ,
+
+ Click
+
+ Click, DoubleClick
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+
- ,
+
+ ,
+
+ Click
+
+ Click, DoubleClick
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+
- * ,
+
+ \* Click
+
+ Click, DoubleClick
+
+ Click
+
+ Click, DoubleClick
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+ none
+
+
- ,
+
+ Click
+
+ Click, Click
+
+ Click
+
+ Click, Click
+
+ Click
+
+ Click, Click
+
+ Click
+
+ Click, Click
+
+ Click
+
+ Click, Click
+
+
- ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ,
+
+ ** Click
+
+ Click, DoubleClick
+
+ Click
+
+ Click, DoubleClick
+
+ Click
+
+ Click, DoubleClick
+
+ Click
+
+ Click, DoubleClick
+
+ Click
+
+ Click, DoubleClick
+
+
+
+ \* The mouse pointer must be over a child object ( or ).
+
** The must have at least one in its collection.
@@ -5006,29 +5010,29 @@ The following table lists Windows Forms controls and which event (
Occurs when a drag-and-drop operation is completed.
- and properties of the are in screen coordinates, not client coordinates. The following line of Visual C# code converts the properties to a client .
-
-```
-Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
-```
-
-> [!NOTE]
-> In versions earlier than .NET Framework 2.0, if you put a with and events on a Windows Form and drag and drop something onto the at design time, the `DropDrop` and `DropEnter` events are raised. However, when you close and reopen the solution, the and events are not raised again.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- This code excerpt demonstrates using the event. See the method for the complete code example.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet5":::
+ and properties of the are in screen coordinates, not client coordinates. The following line of Visual C# code converts the properties to a client .
+
+```
+Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
+```
+
+> [!NOTE]
+> In versions earlier than .NET Framework 2.0, if you put a with and events on a Windows Form and drag and drop something onto the at design time, the `DropDrop` and `DropEnter` events are raised. However, when you close and reopen the solution, the and events are not raised again.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ This code excerpt demonstrates using the event. See the method for the complete code example.
+
+ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet5":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet5":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet5":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet5":::
+
]]>
@@ -5062,65 +5066,65 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Occurs when an object is dragged into the control's bounds.
- event is raised when the user first drags the mouse cursor over the control during a drag-and-drop operation.
-
+ event is raised when the user first drags the mouse cursor over the control during a drag-and-drop operation.
+
> [!NOTE]
-> In versions earlier than .NET Framework 2.0, if you put a with and events on a Windows Form and drag and drop something onto the at design time, the `DropDrop` and `DropEnter` events are raised. However, when you close and reopen the solution, the and events are not raised again.
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+> In versions earlier than .NET Framework 2.0, if you put a with and events on a Windows Form and drag and drop something onto the at design time, the `DropDrop` and `DropEnter` events are raised. However, when you close and reopen the solution, the and events are not raised again.
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
> [!NOTE]
- > The and properties of the are in screen coordinates, not client coordinates. The following line of Visual C# code converts the properties to a client .
-
- ```
- Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
- ```
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
-
- The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
-
- The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
-
- The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
-
- This code excerpt demonstrates using the event. See the method for the complete code example.
-
+ > The and properties of the are in screen coordinates, not client coordinates. The following line of Visual C# code converts the properties to a client .
+
+ ```
+ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
+ ```
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
+
+ The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
+
+ The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
+
+ The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
+
+ This code excerpt demonstrates using the event. See the method for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet7":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet7":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet7":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet7":::
+
]]>
@@ -5150,55 +5154,55 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Occurs when an object is dragged out of the control's bounds.
- event is raised when the user drags the cursor out of the control or the user cancels the current drag-and-drop operation.
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+ event is raised when the user drags the cursor out of the control or the user cancels the current drag-and-drop operation.
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
-
- The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
-
- The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
-
- The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
-
- This code excerpt demonstrates using the event. See the method for the complete code example.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
+
+ The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
+
+ The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
+
+ The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
+
+ This code excerpt demonstrates using the event. See the method for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet8":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet8":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet8":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet8":::
+
]]>
@@ -5228,60 +5232,60 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Occurs when an object is dragged over the control's bounds.
- event is raised when the mouse cursor moves within the bounds of the control during a drag-and-drop operation.
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of value is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+ event is raised when the mouse cursor moves within the bounds of the control during a drag-and-drop operation.
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of value is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
> [!NOTE]
- > The and properties of the are in screen coordinates, not client coordinates. The following line of C# code converts the properties to a client :
- >
- > Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
-
- The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
-
- The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
-
- The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
-
- This code excerpt demonstrates using the event. See the method for the complete code example.
-
+ > The and properties of the are in screen coordinates, not client coordinates. The following line of C# code converts the properties to a client :
+ >
+ > Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
+
+ The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
+
+ The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
+
+ The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
+
+ This code excerpt demonstrates using the event. See the method for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet4":::
+
]]>
@@ -5315,23 +5319,23 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
The bounds within which the control is rendered.
Supports rendering to the specified bitmap.
- method is not supported for ActiveX controls. You can override the event and provide custom printing logic if required.
-
- The method has the following limitations:
-
-- An might be thrown for large bitmaps. The maximum allowable size varies by machine.
-
-- does not support the `Ink` controls for the Windows XP Tablet PC Edition 2005 operating system.
-
-- does not draw a child if the property of the is set to `false`.
-
-- Controls inside containers are rendered in reverse order.
-
-- is not fully functional for the ; only the border of a bitmap is drawn.
-
+ method is not supported for ActiveX controls. You can override the event and provide custom printing logic if required.
+
+ The method has the following limitations:
+
+- An might be thrown for large bitmaps. The maximum allowable size varies by machine.
+
+- does not support the `Ink` controls for the Windows XP Tablet PC Edition 2005 operating system.
+
+- does not draw a child if the property of the is set to `false`.
+
+- Controls inside containers are rendered in reverse order.
+
+- is not fully functional for the ; only the border of a bitmap is drawn.
+
]]>
@@ -5372,28 +5376,28 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
if the control can respond to user interaction; otherwise, . The default is .
- property, you can enable or disable controls at run time. For example, you can disable controls that do not apply to the current state of the application. You can also disable a control to restrict its use. For example, a button can be disabled to prevent the user from clicking it. If a control is disabled, it cannot be selected.
-
+ property, you can enable or disable controls at run time. For example, you can disable controls that do not apply to the current state of the application. You can also disable a control to restrict its use. For example, a button can be disabled to prevent the user from clicking it. If a control is disabled, it cannot be selected.
+
> [!IMPORTANT]
-> Setting the property to `false` does not disable the application's control box or prevent the application window from receiving the focus.
-
- When a container control has its enabled property set to `false`, all its contained controls are disabled, as well. For example, if the user clicks on any of the controls contained in a disabled control, no events are raised.
-
+> Setting the property to `false` does not disable the application's control box or prevent the application window from receiving the focus.
+
+ When a container control has its enabled property set to `false`, all its contained controls are disabled, as well. For example, if the user clicks on any of the controls contained in a disabled control, no events are raised.
+
> [!NOTE]
-> When a scrollable control is disabled, the scroll bars are also disabled. For example, a disabled multiline textbox is unable to scroll to display all the lines of text.
-
-
-
-## Examples
- The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
-
+> When a scrollable control is disabled, the scroll bars are also disabled. For example, a disabled multiline textbox is unable to scroll to display all the lines of text.
+
+
+
+## Examples
+ The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
+
]]>
@@ -5423,21 +5427,21 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Occurs when the property value has changed.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses two controls to demonstrate the event. Clicking one button changes the value of the property of the other button to `false` and displays a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses two controls to demonstrate the event. Clicking one button changes the value of the property of the other button to `false` and displays a .
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/EnabledChanged/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.EnabledChanged/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.EnabledChanged/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -5482,14 +5486,14 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Retrieves the return value of the asynchronous operation represented by the passed.
The generated by the asynchronous operation.
- [!NOTE]
-> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
-
+> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
+
]]>
The parameter value is .
@@ -5523,56 +5527,56 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Occurs when the control is entered.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
> [!NOTE]
-> The and events are suppressed by the class. The equivalent events in the class are the and events. The and events are hierarchical and will cascade up and down the parent chain until the appropriate control is reached. For example, assume you have a with two controls, and each control has one control. When the caret is moved from one to the other, the event is raised for the and , and the event is raised for the other and .
-
+> The and events are suppressed by the class. The equivalent events in the class are the and events. The and events are hierarchical and will cascade up and down the parent chain until the appropriate control is reached. For example, assume you have a with two controls, and each control has one control. When the caret is moved from one to the other, the event is raised for the and , and the event is raised for the other and .
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the `WM_KILLFOCUS` topic in the "Keyboard Input Reference" section and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) topic.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event to change the foreground and background colors of a under particular conditions.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the `WM_KILLFOCUS` topic in the "Keyboard Input Reference" section and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) topic.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event to change the foreground and background colors of a under particular conditions.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Enter/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Enter/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -5610,20 +5614,20 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Retrieves the form that the control is on.
The that the control is on.
- property value might not be the same as the returned by method. For example, if a control is contained within a control, and the is on a , the control's is the and the control's is the .
-
-
-
-## Examples
- The following code example finds the form that contains the specified button.
-
+ property value might not be the same as the returned by method. For example, if a control is contained within a control, and the is on a , the control's is the and the control's is the .
+
+
+
+## Examples
+ The following code example finds the form that contains the specified button.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.FindForm/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Click/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -5662,41 +5666,41 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
if the input focus request was successful; otherwise, .
- method returns `true` if the control successfully received input focus. The control can have the input focus while not displaying any visual cues of having the focus. This behavior is primarily observed by the nonselectable controls listed below, or any controls derived from them.
-
- A control can be selected and receive input focus if all the following are true: the `Selectable` value of is set to `true`, it is contained in another control, and all its parent controls are both visible and enabled.
-
- The Windows Forms controls in the following list are not selectable. Controls derived from these controls are also not selectable.
-
--
-
--
-
--
-
--
-
--
-
--
-
-- (when there is no link present in the control)
-
+ method returns `true` if the control successfully received input focus. The control can have the input focus while not displaying any visual cues of having the focus. This behavior is primarily observed by the nonselectable controls listed below, or any controls derived from them.
+
+ A control can be selected and receive input focus if all the following are true: the `Selectable` value of is set to `true`, it is contained in another control, and all its parent controls are both visible and enabled.
+
+ The Windows Forms controls in the following list are not selectable. Controls derived from these controls are also not selectable.
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+- (when there is no link present in the control)
+
> [!NOTE]
-> is a low-level method intended primarily for custom control authors. Instead, application programmers should use the method or the property for child controls, or the method for forms.
-
-
-
-## Examples
- The following code example sets focus to the specified , if it can receive focus.
-
+> is a low-level method intended primarily for custom control authors. Instead, application programmers should use the method or the property for child controls, or the method for forms.
+
+
+
+## Examples
+ The following code example sets focus to the specified , if it can receive focus.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet1":::
+
]]>
@@ -5747,15 +5751,15 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
if the control has focus; otherwise, .
- if a does not have focus. This example requires that you have a with a named `textBox1` and two objects named `menuItemEdit` and `menuItemEditInsertCustomerInfo`.
-
+ if a does not have focus. This example requires that you have a with a named `textBox1` and two objects named `menuItemEdit` and `menuItemEditInsertCustomerInfo`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members2/CPP/controlmembers2.cpp" id="Snippet4":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Focused/controlmembers2.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet4":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet4":::
+
]]>
@@ -5805,34 +5809,34 @@ Point clientPoint = targetControl.PointToClient(new Point(de.X, de.Y));
Gets or sets the font of the text displayed by the control.
The to apply to the text displayed by the control. The default is the value of the property.
- property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
-
- Because the is immutable (meaning that you cannot adjust any of its properties), you can only assign the property a new . However, you can base the new font on the existing font.
-
- The following is an example of how to adjust the existing font to make it bold:
-
-```csharp
-myControl.Font = new Font(myControl.Font,
- myControl.Font.Style | FontStyle.Bold);
-```
-
-```vb
-MyControl.Font = New Font(MyControl.Font, _
- MyControl.Font.Style Or FontStyle.Bold)
-```
-
-
-
-## Examples
- The following code example displays a to the user and changes the of a control. This example requires that you have a with and a on it.
-
+ property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
+
+ Because the is immutable (meaning that you cannot adjust any of its properties), you can only assign the property a new . However, you can base the new font on the existing font.
+
+ The following is an example of how to adjust the existing font to make it bold:
+
+```csharp
+myControl.Font = new Font(myControl.Font,
+ myControl.Font.Style | FontStyle.Bold);
+```
+
+```vb
+MyControl.Font = New Font(MyControl.Font, _
+ MyControl.Font.Style Or FontStyle.Bold)
+```
+
+
+
+## Examples
+ The following code example displays a to the user and changes the of a control. This example requires that you have a with and a on it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_Font/CPP/control_font.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Font/control_font.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Font/VB/control_font.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Font/VB/control_font.vb" id="Snippet1":::
+
]]>
@@ -5867,21 +5871,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the property value changes.
- property is changed by either a programmatic modification or through interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the event.
-
+ property is changed by either a programmatic modification or through interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the event.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/FontChanged/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.FontChanged/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.FontChanged/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -5913,13 +5917,13 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the height of the font of the control.
The height of the of the control in pixels.
- [!NOTE]
-> The property should not be set to any value other than the control's value, or -1. Setting to -1 has the effect of clearing the cached height value, and the value is recalculated the next time the property is referenced.
-
+> The property should not be set to any value other than the control's value, or -1. Setting to -1 has the effect of clearing the cached height value, and the value is recalculated the next time the property is referenced.
+
]]>
@@ -5955,20 +5959,20 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the foreground color of the control.
The foreground of the control. The default is the value of the property.
- property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
-
-
-
-## Examples
- The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
-
+ property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
+
+
+
+## Examples
+ The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
+
]]>
@@ -6003,24 +6007,24 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the property value changes.
- property is changed by either a programmatic modification or through interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or through interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -6063,11 +6067,11 @@ MyControl.Font = New Font(MyControl.Font, _
Retrieves the control that contains the specified handle.
The that represents the control associated with the specified handle; returns if no control with the specified handle is found.
- method, because it correctly returns controls that own more than one handle.
-
+ method, because it correctly returns controls that own more than one handle.
+
]]>
@@ -6109,11 +6113,11 @@ MyControl.Font = New Font(MyControl.Font, _
Returns the control that is currently associated with the specified handle.
A that represents the control associated with the specified handle; returns if no control with the specified handle is found.
- method if you need to return controls that own more than one handle.
-
+ method if you need to return controls that own more than one handle.
+
]]>
@@ -6221,11 +6225,11 @@ MyControl.Font = New Font(MyControl.Font, _
Retrieves the child control that is located at the specified coordinates.
A that represents the control that is located at the specified point.
- method returns `null`.
-
+ method returns `null`.
+
]]>
@@ -6327,11 +6331,11 @@ MyControl.Font = New Font(MyControl.Font, _
Retrieves the next control forward or back in the tab order of child controls.
The next in the tab order.
- method is dependent on tab order. To iterate through all controls of a form, including nested controls, use the property. To get or set the active control of a container control, use the property.
-
+ method is dependent on tab order. To iterate through all controls of a form, including nested controls, use the property. To get or set the active control of a container control, use the property.
+
]]>
@@ -6370,11 +6374,11 @@ MyControl.Font = New Font(MyControl.Font, _
Retrieves the size of a rectangular area into which a control can be fitted.
An ordered pair of type representing the width and height of a rectangle.
- differs by control. The might be unable to assign the returned size to the control. You can return a size larger than the constraints indicated in the `proposedSize` parameter, but `proposedSize` should decrease as the constraint decreases. For example, `GetPreferredSize(new Size(100, 0))` should not be wider than `GetPreferredSize(new Size(200, 0))`. The exception is a `proposedSize` of 0 or `Size.Empty`, which are defined as unconstrained.
-
+ differs by control. The might be unable to assign the returned size to the control. You can return a size larger than the constraints indicated in the `proposedSize` parameter, but `proposedSize` should decrease as the constraint decreases. For example, `GetPreferredSize(new Size(100, 0))` should not be wider than `GetPreferredSize(new Size(200, 0))`. The exception is a `proposedSize` of 0 or `Size.Empty`, which are defined as unconstrained.
+
]]>
@@ -6416,11 +6420,11 @@ MyControl.Font = New Font(MyControl.Font, _
Retrieves the bounds within which the control is scaled.
A representing the bounds within which the control is scaled.
- to retrieve the bounds within which the control is scaled. You can override this method to reuse the scaling logic, but you must supply your own bounds. The default implementation returns scaled bounds that take into account the `specified` bounds, whether the control is top level, whether the control is fixed width or auto size, and any adornments the control might have.
-
+ to retrieve the bounds within which the control is scaled. You can override this method to reuse the scaling logic, but you must supply your own bounds. The default implementation returns scaled bounds that take into account the `specified` bounds, whether the control is top level, whether the control is fixed width or auto size, and any adornments the control might have.
+
]]>
@@ -6457,24 +6461,24 @@ MyControl.Font = New Font(MyControl.Font, _
if the specified control style bit is set to ; otherwise, .
- method and passing in the appropriate bit and the Boolean value to set the bit to. To determine the value assigned to a specified bit, use the method and pass in the member to evaluate.
-
-
-
-## Examples
- The following code example returns the value of the double-buffering related style bits for a . This example returns `true` only if all the style bits are set to `true`.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet4":::
- :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet4":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet4":::
-
- ]]>
-
-
-
+ method and passing in the appropriate bit and the Boolean value to set the bit to. To determine the value assigned to a specified bit, use the method and pass in the member to evaluate.
+
+
+
+## Examples
+ The following code example returns the value of the double-buffering related style bits for a . This example returns `true` only if all the style bits are set to `true`.
+
+ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet4":::
+ :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet4":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet4":::
+
+ ]]>
+
+
+
@@ -6530,55 +6534,55 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs during a drag operation.
- event is raised when a drag-and-drop operation is started. With the event, the source of a drag event can modify the appearance of the mouse pointer in order to give the user visual feedback during a drag-and-drop operation.
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+ event is raised when a drag-and-drop operation is started. With the event, the source of a drag event can modify the appearance of the mouse pointer in order to give the user visual feedback during a drag-and-drop operation.
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
-
- The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
-
- The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
-
- The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
-
- This code excerpt demonstrates using the event. See the method for the complete code example.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates a drag-and-drop operation between two controls. The example calls the method when the drag action starts. The drag action starts if the mouse has moved more than from the mouse location during the event. The method is used to determine the index of the item to drag during the `MouseDown` event.
+
+ The example also demonstrates using custom cursors for the drag-and-drop operation. The example requires that two cursor files, `3dwarro.cur` and `3dwno.cur`, exist in the application directory, for the custom drag and no-drop cursors, respectively. The custom cursors will be used if the `UseCustomCursorsCheck` is checked. The custom cursors are set in the event handler.
+
+ The keyboard state is evaluated in the event handler for the right `ListBox`, to determine what the drag operation will be based on state of the SHIFT, CTRL, ALT, or CTRL+ALT keys. The location in the `ListBox` where the drop would occur is also determined during the `DragOver` event. If the data to drop is not a `String`, then the is set to `None` in . Finally, the status of the drop is displayed in the `DropLocationLabel` .
+
+ The data to drop for the right `ListBox` is determined in the event handler and the `String` value is added at the appropriate place in the `ListBox`. If the drag operation moves outside the bounds of the form, then the drag-and-drop operation is canceled in the event handler.
+
+ This code excerpt demonstrates using the event. See the method for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet3":::
+
]]>
@@ -6618,56 +6622,56 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control receives focus.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
- **Note** The and events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the and events are only used when updating or when writing custom controls. Instead the and events should be used for all controls except the class, which uses the and events. For more information about the and events, see the [WM_SETFOCUS](/windows/win32/inputdev/wm-setfocus) and [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topics.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
+ **Note** The and events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the and events are only used when updating or when writing custom controls. Instead the and events should be used for all controls except the class, which uses the and events. For more information about the and events, see the [WM_SETFOCUS](/windows/win32/inputdev/wm-setfocus) and [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topics.
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging.
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging.
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet47":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet47":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet47":::
+
]]>
@@ -6718,20 +6722,20 @@ MyControl.Font = New Font(MyControl.Font, _
Gets the window handle that the control is bound to.
An that contains the window handle () of the control.
- property is a Windows `HWND`. If the handle has not yet been created, referencing this property will force the handle to be created.
-
-
-
-## Examples
- The following code example demonstrates using the and the property. To run the example paste the following code in a form. Add two buttons named `Button1` and `Button2` to the form and ensure all events are connected to their event handlers.
-
+ property is a Windows `HWND`. If the handle has not yet been created, referencing this property will force the handle to be created.
+
+
+
+## Examples
+ The following code example demonstrates using the and the property. To run the example paste the following code in a form. Add two buttons named `Button1` and `Button2` to the form and ensure all events are connected to their event handlers.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlPaint1/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Handle/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlPaint1/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlPaint1/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -6779,23 +6783,23 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a handle is created for the control.
- is displayed for the first time. For example, if a is created that has set to `false`, the event will not be raised until is set to `true`.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ is displayed for the first time. For example, if a is created that has set to `false`, the event will not be raised until is set to `true`.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet37":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet37":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet37":::
+
]]>
@@ -6844,23 +6848,23 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control's handle is in the process of being destroyed.
- event, the control is still a valid Windows control and the can be recreated by calling the method.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event, the control is still a valid Windows control and the can be recreated by calling the method.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet38":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet38":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet38":::
+
]]>
@@ -6914,20 +6918,20 @@ MyControl.Font = New Font(MyControl.Font, _
if the control contains one or more child controls; otherwise, .
- collection has a greater than zero, the property will return `true`. Accessing the property does not force the creation of a if the control has no children, so referencing this property can provide a performance benefit when walking a tree of controls.
-
-
-
-## Examples
- The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
-
+ collection has a greater than zero, the property will return `true`. Accessing the property does not force the creation of a if the control has no children, so referencing this property can provide a performance benefit when walking a tree of controls.
+
+
+
+## Examples
+ The following code example sets the and of the controls to the default system colors. The code recursively calls itself if the control has any child controls. This code example requires that you have a with at least one child control; however, a child container control, like a or , with its own child control(s) would better demonstrate the recursion.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet1":::
+
]]>
@@ -6975,23 +6979,23 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the height of the control.
The height of the control in pixels.
- and property values cause the property value of the control to change.
-
+ and property values cause the property value of the control to change.
+
> [!NOTE]
-> The minimum height for the derived control is one pixel. The default height for the control is three pixels. Setting the height of the control to a value less than one will reset the property value to the default height.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+> The minimum height for the derived control is one pixel. The default height for the control is three pixels. Setting the height of the control to a value less than one will reset the property value to the default height.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
]]>
@@ -7023,22 +7027,22 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the user requests help for a control.
- event is commonly raised when the user presses the F1 key or an associated context-sensitive help button is clicked.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates handling the event to display custom Help content on a form containing four address fields. The event is raised either by pressing the F1 key with the focus in an address field, or by the using the context-sensitive Help button and clicking the Help cursor on an address field. The property is set to true to indicate that the `HelpRequested` event is handled. The example also demonstrates storing the Help text in the property.
-
+ event is commonly raised when the user presses the F1 key or an associated context-sensitive help button is clicked.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates handling the event to display custom Help content on a form containing four address fields. The event is raised either by pressing the F1 key with the focus in an address field, or by the using the context-sensitive Help button and clicking the Help cursor on an address field. The property is set to true to indicate that the `HelpRequested` event is handled. The example also demonstrates storing the Help text in the property.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.HelpEventHandler/CPP/helpevent.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/HelpRequested/helpevent.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HelpEventHandler/VB/helpevent.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HelpEventHandler/VB/helpevent.vb" id="Snippet1":::
+
]]>
@@ -7076,20 +7080,20 @@ MyControl.Font = New Font(MyControl.Font, _
Conceals the control from the user.
- property to `false`. After the method is called, the property returns a value of `false` until the method is called.
-
-
-
-## Examples
- The following code example hides a button if the CTRL key is pressed when the button is clicked. This example requires that you have a named `button1` on a .
-
+ property to `false`. After the method is called, the property returns a value of `false` until the method is called.
+
+
+
+## Examples
+ The following code example hides a button if the CTRL key is pressed when the button is clicked. This example requires that you have a named `button1` on a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members4/CPP/controlmembers4.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BringToFront/controlmembers4.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet2":::
+
]]>
@@ -7134,18 +7138,18 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the Input Method Editor (IME) mode of the control.
One of the values. The default is .
- property is typically set to for a control that is intended to only enter numeric values. The property value is set to for the class.
-
- Most classes that do not directly support Input Method Editors, or allow direct input from an IME, will set the value of this property to .
-
+ property is typically set to for a control that is intended to only enter numeric values. The property value is set to for the class.
+
+ Most classes that do not directly support Input Method Editors, or allow direct input from an IME, will set the value of this property to .
+
> [!IMPORTANT]
-> The user can interactively change the unless it has been programmatically set to . In this case, the user will not be able to use the IME.
->
-> The property is ignored on Windows 8 when the global input mode is in effect. For more info, see [Switch Text Input Changed from Per-Thread to Per-User](https://go.microsoft.com/fwlink/?LinkID=256509).
-
+> The user can interactively change the unless it has been programmatically set to . In this case, the user will not be able to use the IME.
+>
+> The property is ignored on Windows 8 when the global input mode is in effect. For more info, see [Switch Text Input Changed from Per-Thread to Per-User](https://go.microsoft.com/fwlink/?LinkID=256509).
+
]]>
The assigned value is not one of the enumeration values.
@@ -7201,26 +7205,26 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the property has changed.
- property is changed by either a programmatic modification or through interaction.
-
- Controls that do not support Input Method Managers will never raise this event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or through interaction.
+
+ Controls that do not support Input Method Managers will never raise this event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -7258,11 +7262,11 @@ MyControl.Font = New Font(MyControl.Font, _
Called after the control has been added to another container.
- method is called immediately after adding a control to a container. The method enables a control to initialize its layout state based on its container. For example, you would typically apply anchoring and docking to the control in the method.
-
+ method is called immediately after adding a control to a container. The method enables a control to initialize its layout state based on its container. For example, you would typically apply anchoring and docking to the control in the method.
+
]]>
@@ -7315,20 +7319,20 @@ MyControl.Font = New Font(MyControl.Font, _
Invalidates the entire surface of the control and causes the control to be redrawn.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
-
-
-## Examples
- The following code example enables the user to drag an image or image file onto the form, and have it be displayed at the point on it is dropped. The method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
+
+
+## Examples
+ The following code example enables the user to drag an image or image file onto the form, and have it be displayed at the point on it is dropped. The method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/CPP/imagedrag.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/AllowDrop/imagedrag.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
+
]]>
@@ -7363,11 +7367,11 @@ MyControl.Font = New Font(MyControl.Font, _
to invalidate the control's child controls; otherwise, .
Invalidates a specific region of the control and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
]]>
@@ -7407,11 +7411,11 @@ MyControl.Font = New Font(MyControl.Font, _
A that represents the region to invalidate.
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
]]>
@@ -7452,11 +7456,11 @@ MyControl.Font = New Font(MyControl.Font, _
The to invalidate.
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
]]>
@@ -7493,11 +7497,11 @@ MyControl.Font = New Font(MyControl.Font, _
to invalidate the control's child controls; otherwise, .
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
]]>
@@ -7535,11 +7539,11 @@ MyControl.Font = New Font(MyControl.Font, _
to invalidate the control's child controls; otherwise, .
Invalidates the specified region of the control (adds it to the control's update region, which is the area that will be repainted at the next paint operation), and causes a paint message to be sent to the control. Optionally, invalidates the child controls assigned to the control.
- method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
-
+ method does not force a synchronous paint; to force a synchronous paint, call the method after calling the method. When this method is called with no parameters, the entire client area is added to the update region.
+
]]>
@@ -7580,21 +7584,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a control's display requires redrawing.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet40":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet40":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet40":::
+
]]>
@@ -7669,30 +7673,30 @@ MyControl.Font = New Font(MyControl.Font, _
Executes the specified delegate on the thread that owns the control's underlying window handle.
The return value from the delegate being invoked, or if the delegate has no return value.
- method searches up the control's parent chain until it finds a control or form that has a window handle if the current control's underlying window handle does not exist yet. If no appropriate handle can be found, the method will throw an exception. Exceptions that are raised during the call will be propagated back to the caller.
-
+ method searches up the control's parent chain until it finds a control or form that has a window handle if the current control's underlying window handle does not exist yet. If no appropriate handle can be found, the method will throw an exception. Exceptions that are raised during the call will be propagated back to the caller.
+
> [!NOTE]
-> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
-
- The delegate can be an instance of , in which case the sender parameter will contain this control, and the event parameter will contain . The delegate can also be an instance of , or any other delegate that takes a void parameter list. A call to an or delegate will be faster than a call to another type of delegate.
-
+> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
+
+ The delegate can be an instance of , in which case the sender parameter will contain this control, and the event parameter will contain . The delegate can also be an instance of , or any other delegate that takes a void parameter list. A call to an or delegate will be faster than a call to another type of delegate.
+
> [!NOTE]
-> An exception might be thrown if the thread that should process the message is no longer active.
-
-
-
-## Examples
- The following code example shows controls that contain a delegate. The delegate encapsulates a method that adds items to the list box, and this method is executed on the thread that owns the underlying handle of the form. When the user clicks on the button, `Invoke` runs the delegate.
-
+> An exception might be thrown if the thread that should process the message is no longer active.
+
+
+
+## Examples
+ The following code example shows controls that contain a delegate. The delegate encapsulates a method that adds items to the list box, and this method is executed on the thread that owns the underlying handle of the form. When the user clicks on the button, `Invoke` runs the delegate.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_Invoke2/CPP/control_invoke2.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Invoke/control_invoke2.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Invoke2/VB/control_invoke2.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Invoke2/VB/control_invoke2.vb" id="Snippet1":::
+
]]>
@@ -7743,30 +7747,30 @@ MyControl.Font = New Font(MyControl.Font, _
Executes the specified delegate, on the thread that owns the control's underlying window handle, with the specified list of arguments.
An that contains the return value from the delegate being invoked, or if the delegate has no return value.
- [!NOTE]
-> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
-
- The delegate can be an instance of , in which case the sender parameter will contain this control, and the event parameter will contain . The delegate can also be an instance of , or any other delegate that takes a void parameter list. A call to an or delegate will be faster than a call to another type of delegate.
-
+> In addition to the property, there are four methods on a control that are thread safe: , , , and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of the invoke methods to marshal the call to the control's thread.
+
+ The delegate can be an instance of , in which case the sender parameter will contain this control, and the event parameter will contain . The delegate can also be an instance of , or any other delegate that takes a void parameter list. A call to an or delegate will be faster than a call to another type of delegate.
+
> [!NOTE]
-> An exception might be thrown if the thread that should process the message is no longer active.
-
-
-
-## Examples
- The following code example shows controls that contain a delegate. The delegate encapsulates a method that adds items to the list box, and this method is executed on the thread that owns the underlying handle of the form, using the specified arguments. When the user clicks on the button, `Invoke` runs the delegate.
-
+> An exception might be thrown if the thread that should process the message is no longer active.
+
+
+
+## Examples
+ The following code example shows controls that contain a delegate. The delegate encapsulates a method that adds items to the list box, and this method is executed on the thread that owns the underlying handle of the form, using the specified arguments. When the user clicks on the button, `Invoke` runs the delegate.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_Invoke1/CPP/control_invoke1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Invoke/control_invoke1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Invoke1/VB/control_invoke1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Invoke1/VB/control_invoke1.vb" id="Snippet1":::
+
]]>
@@ -8037,31 +8041,31 @@ MyControl.Font = New Font(MyControl.Font, _
if the control's was created on a different thread than the calling thread (indicating that you must make calls to the control through an invoke method); otherwise, .
- [!NOTE]
-> In addition to the property, there are four methods on a control that are thread safe to call: ,, and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of these invoke methods when calling from a different thread.
-
- If the control's handle does not yet exist, searches up the control's parent chain until it finds a control or form that does have a window handle. If no appropriate handle can be found, the method returns `false`.
-
- This means that can return `false` if is not required (the call occurs on the same thread), or if the control was created on a different thread but the control's handle has not yet been created.
-
- In the case where the control's handle has not yet been created, you should not simply call properties, methods, or events on the control. This might cause the control's handle to be created on the background thread, isolating the control on a thread without a message pump and making the application unstable.
-
- You can protect against this case by also checking the value of when returns `false` on a background thread. If the control handle has not yet been created, you must wait until it has been created before calling or . Typically, this happens only if a background thread is created in the constructor of the primary form for the application (as in `Application.Run(new MainForm())`, before the form has been shown or `Application.Run` has been called.
-
- One solution is to wait until the form's handle has been created before starting the background thread. Either force handle creation by calling the property, or wait until the event to start the background process.
-
- An even better solution is to use the `SynchronizationContext` returned by rather than a control for cross-thread marshaling.
-
+> In addition to the property, there are four methods on a control that are thread safe to call: ,, and if the handle for the control has already been created. Calling before the control's handle has been created on a background thread can cause illegal cross thread calls. For all other method calls, you should use one of these invoke methods when calling from a different thread.
+
+ If the control's handle does not yet exist, searches up the control's parent chain until it finds a control or form that does have a window handle. If no appropriate handle can be found, the method returns `false`.
+
+ This means that can return `false` if is not required (the call occurs on the same thread), or if the control was created on a different thread but the control's handle has not yet been created.
+
+ In the case where the control's handle has not yet been created, you should not simply call properties, methods, or events on the control. This might cause the control's handle to be created on the background thread, isolating the control on a thread without a message pump and making the application unstable.
+
+ You can protect against this case by also checking the value of when returns `false` on a background thread. If the control handle has not yet been created, you must wait until it has been created before calling or . Typically, this happens only if a background thread is created in the constructor of the primary form for the application (as in `Application.Run(new MainForm())`, before the form has been shown or `Application.Run` has been called.
+
+ One solution is to wait until the form's handle has been created before starting the background thread. Either force handle creation by calling the property, or wait until the event to start the background process.
+
+ An even better solution is to use the `SynchronizationContext` returned by rather than a control for cross-thread marshaling.
+
> [!NOTE]
-> An exception might be thrown if the thread that should process the message is no longer active.
-
- For more information about multithreaded Windows Forms controls, see [How to: Use a Background Thread to Search for Files](/dotnet/framework/winforms/controls/how-to-use-a-background-thread-to-search-for-files) and [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls).
-
+> An exception might be thrown if the thread that should process the message is no longer active.
+
+ For more information about multithreaded Windows Forms controls, see [How to: Use a Background Thread to Search for Files](/dotnet/framework/winforms/controls/how-to-use-a-background-thread-to-search-for-files) and [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/framework/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls).
+
]]>
@@ -8201,11 +8205,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the control has been disposed of; otherwise, .
- method.
-
+ method.
+
]]>
@@ -8256,11 +8260,11 @@ MyControl.Font = New Font(MyControl.Font, _
if a handle has been assigned to the control; otherwise, .
- property to determine whether has been called.
-
+ property to determine whether has been called.
+
]]>
@@ -8303,11 +8307,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the character should be sent directly to the control and not preprocessed; otherwise, .
- method to determine whether the character specified by the `charCode` parameter is an input character that the control wants. This method is called during window message preprocessing to determine whether the specified input character should be preprocessed or sent directly to the control. If returns `true`, the specified character is sent directly to the control. If returns `false`, the specified character is preprocessed and only sent to the control if it is not consumed by the preprocessing phase. The preprocessing of a character includes checking whether the character is a mnemonic of another control.
-
+ method to determine whether the character specified by the `charCode` parameter is an input character that the control wants. This method is called during window message preprocessing to determine whether the specified input character should be preprocessed or sent directly to the control. If returns `true`, the specified character is sent directly to the control. If returns `false`, the specified character is preprocessed and only sent to the control if it is not consumed by the preprocessing phase. The preprocessing of a character includes checking whether the character is a mnemonic of another control.
+
]]>
@@ -8342,19 +8346,19 @@ MyControl.Font = New Font(MyControl.Font, _
if the specified key is a regular input key; otherwise, .
- method to determine whether the key specified by the `keyData` parameter is an input key that the control wants. This method is called during window message preprocessing to determine whether the specified input key should be preprocessed or sent directly to the control. If returns `true`, the specified key is sent directly to the control. If returns `false`, the specified key is preprocessed and only sent to the control if it is not consumed by the preprocessing phase. Keys that are preprocessed include the TAB, RETURN, ESC, and the UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW keys.
-
-
-
-## Examples
- The following code example shows you how to override the method for a control. In this example, the `TabTextBox` class handles the TAB key. When the `TabTextBox` has the focus and the user presses the TAB key four spaces are added at the text insertion point, replacing any selected text. By default, the control handles the TAB key by moving the input focus to the next control. In this case, the keypress never reaches the method override. To prevent this default behavior, the method override returns `true` when the user presses the TAB key. For all other keypresses, the method override returns the result of calling the base-class version of the method.
-
+ method to determine whether the key specified by the `keyData` parameter is an input key that the control wants. This method is called during window message preprocessing to determine whether the specified input key should be preprocessed or sent directly to the control. If returns `true`, the specified key is sent directly to the control. If returns `false`, the specified key is preprocessed and only sent to the control if it is not consumed by the preprocessing phase. Keys that are preprocessed include the TAB, RETURN, ESC, and the UP ARROW, DOWN ARROW, LEFT ARROW, and RIGHT ARROW keys.
+
+
+
+## Examples
+ The following code example shows you how to override the method for a control. In this example, the `TabTextBox` class handles the TAB key. When the `TabTextBox` has the focus and the user presses the TAB key four spaces are added at the text insertion point, replacing any selected text. By default, the control handles the TAB key by moving the input focus to the next control. In this case, the keypress never reaches the method override. To prevent this default behavior, the method override returns `true` when the user presses the TAB key. For all other keypresses, the method override returns the result of calling the base-class version of the method.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/IsInputKey/form1.cs" id="Snippet0":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.IsInputKey/vb/form1.vb" id="Snippet0":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.IsInputKey/vb/form1.vb" id="Snippet0":::
+
]]>
@@ -8390,20 +8394,20 @@ MyControl.Font = New Font(MyControl.Font, _
if the specified key or keys are in effect; otherwise, .
- property to determine whether the CAPS LOCK, NUM LOCK, or SCROLL LOCK keys are on, whether individually or in combination.
-
-
-
-## Examples
- The following code example displays a message box indicating whether the specified key (the Caps Lock key in this case) is in effect.
-
+ property to determine whether the CAPS LOCK, NUM LOCK, or SCROLL LOCK keys are on, whether individually or in combination.
+
+
+
+## Examples
+ The following code example displays a message box indicating whether the specified key (the Caps Lock key in this case) is in effect.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ControlIsKeyLocked/CPP/controliskeylocked.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/IsKeyLocked/controliskeylocked.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ControlIsKeyLocked/VB/controliskeylocked.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ControlIsKeyLocked/VB/controliskeylocked.vb" id="Snippet1":::
+
]]>
The parameter refers to a key other than the CAPS LOCK, NUM LOCK, or SCROLL LOCK key.
@@ -8447,11 +8451,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the control is mirrored; otherwise, .
-
@@ -8488,20 +8492,20 @@ MyControl.Font = New Font(MyControl.Font, _
if the character is the mnemonic character assigned to the control; otherwise, .
- .
-
-
-
-## Examples
- The following code example demonstrates an extension of the button class that overrides the method to exhibit custom behavior. The example also demonstrates the use of the and properties. To run this example paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form.
-
- :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/CPP/form1.cpp" id="Snippet1":::
- :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/ProcessMnemonic/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1":::
-
+ .
+
+
+
+## Examples
+ The following code example demonstrates an extension of the button class that overrides the method to exhibit custom behavior. The example also demonstrates the use of the and properties. To run this example paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form.
+
+ :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/CPP/form1.cpp" id="Snippet1":::
+ :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/ProcessMnemonic/form1.cs" id="Snippet1":::
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -8531,36 +8535,36 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a key is pressed while the control has focus.
-
-
-2.
-
-3.
-
- To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the event, you must override the method in each control on your form. The code for the override of the would need to determine if one of the special keys is pressed and return a value of `true`. Instead of overriding the method, you can handle the event and set the property to `true`. For a code example, see the event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event to determine the type of character entered into the control.
-
+
+
+2.
+
+3.
+
+ To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the event, you must override the method in each control on your form. The code for the override of the would need to determine if one of the special keys is pressed and return a value of `true`. Instead of overriding the method, you can handle the event and set the property to `true`. For a code example, see the event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event to determine the type of character entered into the control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyDown/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
-
-
- The following code example demonstrates the order of raising the , , events, and how to register event handlers on them.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
+
+
+ The following code example demonstrates the order of raising the , , events, and how to register event handlers on them.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/Form2.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/Form2.vb" id="Snippet1":::
-
+
]]>
@@ -8595,40 +8599,40 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a character. space or backspace key is pressed while the control has focus.
-
-
-2.
-
-3.
-
- The event is not raised by non-character keys other than space and backspace; however, the non-character keys do raise the and events.
-
- Use the property to sample keystrokes at run time and to consume or modify a subset of common keystrokes.
-
- To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event to prevent characters from entering the control.
-
+
+
+2.
+
+3.
+
+ The event is not raised by non-character keys other than space and backspace; however, the non-character keys do raise the and events.
+
+ Use the property to sample keystrokes at run time and to consume or modify a subset of common keystrokes.
+
+ To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event to prevent characters from entering the control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyDown/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
-
-
- The following code example demonstrates the order of rising the , and events, also how to register event handlers on them.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
+
+
+ The following code example demonstrates the order of rising the , and events, also how to register event handlers on them.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/Form2.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/Form2.vb" id="Snippet1":::
-
+
]]>
@@ -8662,36 +8666,36 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a key is released while the control has focus.
-
-
-2.
-
-3.
-
- To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the event, you must override the method in each control on your form. The code for the override of would need to determine if one of the special keys is pressed and return a value of `true`.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event with the class to display pop-up style help to the user.
-
+
+
+2.
+
+3.
+
+ To handle keyboard events only at the form level and not enable other controls to receive keyboard events, set the property in your form's event-handling method to `true`. Certain keys, such as the TAB, RETURN, ESC, and arrow keys are handled by controls automatically. To have these keys raise the event, you must override the method in each control on your form. The code for the override of would need to determine if one of the special keys is pressed and return a value of `true`.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event with the class to display pop-up style help to the user.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyUp/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bottom/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
-
-
- The following code example demonstrates the order of rising the , and events, also how to register event handlers on them.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
+
+
+ The following code example demonstrates the order of rising the , and events, also how to register event handlers on them.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/Form2.cs" id="Snippet1":::
:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/Form2.vb" id="Snippet1":::
-
+
]]>
@@ -8723,22 +8727,22 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when a control should reposition its child controls.
- event occurs when child controls are added or removed, when the bounds of the control changes, and when other changes occur that can affect the layout of the control. The layout event can be suppressed using the and methods. Suspending layout enables you to perform multiple actions on a control without having to perform a layout for each change. For example, if you resize and move a control, each operation would raise a event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example centers a on the screen in the event. This will keep the form centered as the user resizes it. This example requires that you have created a control.
-
+ event occurs when child controls are added or removed, when the bounds of the control changes, and when other changes occur that can affect the layout of the control. The layout event can be suppressed using the and methods. Suspending layout enables you to perform multiple actions on a control without having to perform a layout for each change. For example, if you resize and move a control, each operation would raise a event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example centers a on the screen in the event. This will keep the form centered as the user resizes it. This example requires that you have created a control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Layout/CPP/layout.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BoundsSpecified/Overview/layout.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Layout/VB/layout.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Layout/VB/layout.vb" id="Snippet1":::
+
]]>
@@ -8787,11 +8791,11 @@ MyControl.Font = New Font(MyControl.Font, _
Gets a cached instance of the control's layout engine.
The for the control's contents.
- property gets the layout engine for the control's children rather than for the control itself.
-
+ property gets the layout engine for the control's children rather than for the control itself.
+
]]>
@@ -8827,56 +8831,56 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the input focus leaves the control.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
> [!NOTE]
-> The and events are suppressed by the class. The equivalent events in the class are the and events. The and events are hierarchical and will cascade up and down the parent chain until the appropriate control is reached. For example, assume you have a with two controls, and each control has one control. When the caret is moved from one to the other, the event is raised for the and , and the event is raised for the other and .
-
+> The and events are suppressed by the class. The equivalent events in the class are the and events. The and events are hierarchical and will cascade up and down the parent chain until the appropriate control is reached. For example, assume you have a with two controls, and each control has one control. When the caret is moved from one to the other, the event is raised for the and , and the event is raised for the other and .
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the event to reset a control to its former state.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the event to reset a control to its former state.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Enter/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Enter/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -8925,22 +8929,22 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
An representing the distance, in pixels, between the left edge of the control and the left edge of its container's client area.
- property value is equivalent to the property of the property value of the control.
-
- Changes made to the and property values cause the property value of the control to change.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+ property value is equivalent to the property of the property value of the control.
+
+ Changes made to the and property values cause the property value of the control to change.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
]]>
@@ -8977,22 +8981,22 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the coordinates of the upper-left corner of the control relative to the upper-left corner of its container.
The that represents the upper-left corner of the control relative to the upper-left corner of its container.
- class is a value type (`Structure` in Visual Basic, `struct` in Visual C#), it is returned by value, meaning accessing the property returns a copy of the upper-left point of the control. So, adjusting the or properties of the returned from this property will not affect the , , , or property values of the control. To adjust these properties set each property value individually, or set the property with a new .
-
- If the is a , the property value represents the upper-left corner of the in screen coordinates.
-
-
-
-## Examples
- The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
-
+ class is a value type (`Structure` in Visual Basic, `struct` in Visual C#), it is returned by value, meaning accessing the property returns a copy of the upper-left point of the control. So, adjusting the or properties of the returned from this property will not affect the , , , or property values of the control. To adjust these properties set each property value individually, or set the property with a new .
+
+ If the is a , the property value represents the upper-left corner of the in screen coordinates.
+
+
+
+## Examples
+ The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
+
]]>
@@ -9023,21 +9027,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the property value has changed.
- property is changed by either a programmatic modification or through interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example raises the event on a when the form is resized.
-
+ property is changed by either a programmatic modification or through interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example raises the event on a when the form is resized.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/LocationChanged/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.LocationChanged/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.LocationChanged/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -9134,58 +9138,58 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control loses focus.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
- If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
+ If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
+
> [!NOTE]
-> The and events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the and events are only used when updating or when writing custom controls. Instead the and events should be used for all controls except the class, which uses the and events. For more information about the and events, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) and [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topics.
-
+> The and events are low-level focus events that are tied to the WM_KILLFOCUS and WM_SETFOCUS Windows messages. Typically, the and events are only used when updating or when writing custom controls. Instead the and events should be used for all controls except the class, which uses the and events. For more information about the and events, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) and [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topics.
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates validating the text for TextBox1. It also demonstrates handling the event by setting the property to the text in TextBox1. The code example used the method to check for an error before opening the file dialog box. To run this example, paste the following code into a form containing a named `TextBox1`, an named `OpenFileDialog1`, a named `Button1`, and an named `ErrorProvider1`. Ensure all events are associated with their event handlers.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/inputdev/wm-killfocus) topic.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates validating the text for TextBox1. It also demonstrates handling the event by setting the property to the text in TextBox1. The code example used the method to check for an error before opening the file dialog box. To run this example, paste the following code into a form containing a named `TextBox1`, an named `OpenFileDialog1`, a named `Button1`, and an named `ErrorProvider1`. Ensure all events are associated with their event handlers.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/CPP/filedialogform.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Application/DoEvents/filedialogform.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet2":::
+
]]>
@@ -9223,14 +9227,14 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the space between controls.
A representing the space between controls.
- that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications.
-
+ that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications.
+
> [!NOTE]
-> Setting the property on a docked control has no effect on the distance of the control from the edges of its container.
-
+> Setting the property on a docked control has no effect on the distance of the control from the edges of its container.
+
]]>
@@ -9258,21 +9262,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control's margin changes.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet21":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet21":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet21":::
+
]]>
@@ -9367,15 +9371,15 @@ MyControl.Font = New Font(MyControl.Font, _
Gets a value indicating which of the modifier keys (SHIFT, CTRL, and ALT) is in a pressed state.
A bitwise combination of the values. The default is .
- named `button1` on a .
-
+ named `button1` on a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members4/CPP/controlmembers4.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BringToFront/controlmembers4.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet2":::
+
]]>
@@ -9405,15 +9409,15 @@ MyControl.Font = New Font(MyControl.Font, _
Gets a value indicating which of the mouse buttons is in a pressed state.
A bitwise combination of the enumeration values. The default is .
- , , , , , and members. To run the example, paste the following code in a form called Form1 containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
-
+ , , , , , and members. To run the example, paste the following code in a form called Form1 containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseButtons/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -9443,41 +9447,41 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control loses mouse capture.
- event.
-
-
-
-## Examples
- The following code example demonstrates the event for a control.
-
+ event.
+
+
+
+## Examples
+ The following code example demonstrates the event for a control.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseCaptureChanged/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.mousecapturechanged/vb/form1.vb" id="Snippet1":::
-
- To test this example, run it in the debugger by pressing F5. Open the **Output** window in Visual Studio so that you can see when events are raised. Click the and notice the following output.
-
- `button1_MouseDown`
-
- `button1_MouseUp`
-
- `button1_MouseCaptureChanged`
-
- Now, click and hold the left mouse button on the control. While still clicking the mouse, press ALT+TAB to switch to another program. Notice that the event is raised enabling you to potentially handle this scenario. Depending on your actions, the event might not be raised. You can also try this test with the Windows key or CTRL+ESC.
-
- `button1_MouseDown`
-
- `button1_MouseCaptureChanged`
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.mousecapturechanged/vb/form1.vb" id="Snippet1":::
+
+ To test this example, run it in the debugger by pressing F5. Open the **Output** window in Visual Studio so that you can see when events are raised. Click the and notice the following output.
+
+ `button1_MouseDown`
+
+ `button1_MouseUp`
+
+ `button1_MouseCaptureChanged`
+
+ Now, click and hold the left mouse button on the control. While still clicking the mouse, press ALT+TAB to switch to another program. Notice that the event is raised enabling you to potentially handle this scenario. Depending on your actions, the event might not be raised. You can also try this test with the Windows key or CTRL+ESC.
+
+ `button1_MouseDown`
+
+ `button1_MouseCaptureChanged`
+
]]>
@@ -9505,38 +9509,38 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control is clicked by the mouse.
- event.
-
-2. event.
-
-3. event.
-
-4. event.
-
- For this to occur, the various events cannot be disabled in the control's class.
-
- Two single clicks that occur close enough in time, as determined by the mouse settings of the user's operating system, will generate a event instead of the second event.
-
+ event.
+
+2. event.
+
+3. event.
+
+4. event.
+
+ For this to occur, the various events cannot be disabled in the control's class.
+
+ Two single clicks that occur close enough in time, as determined by the mouse settings of the user's operating system, will generate a event instead of the second event.
+
> [!IMPORTANT]
-> events are logically higher-level events of a control. They are often raised by other actions, such as pressing the ENTER key when the control has focus.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+> events are logically higher-level events of a control. They are often raised by other actions, such as pressing the ENTER key when the control has focus.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet54":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet54":::
+
]]>
@@ -9570,46 +9574,46 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control is double clicked by the mouse.
- event occurs when the user depresses a mouse button twice in quick succession when the cursor is over the control. The time interval that separates two single clicks from a double-click is determined by the mouse settings of the user's operating system.
-
- The following series of events is raised by the control when such a user action takes place:
-
-1. event.
-
-2. event.
-
-3. event.
-
-4. event.
-
-5. event.
-
-6. event.
-
-7. event.
-
-8. event.
-
- For this to occur, the various events cannot be disabled in the control's class.
-
+ event occurs when the user depresses a mouse button twice in quick succession when the cursor is over the control. The time interval that separates two single clicks from a double-click is determined by the mouse settings of the user's operating system.
+
+ The following series of events is raised by the control when such a user action takes place:
+
+1. event.
+
+2. event.
+
+3. event.
+
+4. event.
+
+5. event.
+
+6. event.
+
+7. event.
+
+8. event.
+
+ For this to occur, the various events cannot be disabled in the control's class.
+
> [!IMPORTANT]
-> events are logically higher-level events of a control. They may be raised by other user actions, such as shortcut key combinations.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+> events are logically higher-level events of a control. They may be raised by other user actions, such as shortcut key combinations.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet55":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet55":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet55":::
+
]]>
@@ -9643,35 +9647,35 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer is over the control and a mouse button is pressed.
-
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -9704,35 +9708,35 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer enters the control.
-
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -9765,39 +9769,39 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer rests on the control.
- is to display a tool tip when the mouse pauses on a control within a specified area around the control (the "hover rectangle"). The pause required for this event to be raised is specified in milliseconds by the property.
-
- The event is defined and detected in connection with the and properties.
-
- Mouse events occur in the following order:
-
-1.
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+ is to display a tool tip when the mouse pauses on a control within a specified area around the control (the "hover rectangle"). The pause required for this event to be raised is specified in milliseconds by the property.
+
+ The event is defined and detected in connection with the and properties.
+
+ Mouse events occur in the following order:
+
+1.
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -9829,35 +9833,35 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer leaves the control.
-
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -9888,37 +9892,37 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer is moved over the control.
- are to change the control's color or to paint a raised rectangle around the control.
-
- Mouse events occur in the following order:
-
-1.
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+ are to change the control's color or to paint a raised rectangle around the control.
+
+ Mouse events occur in the following order:
+
+1.
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -9949,22 +9953,22 @@ MyControl.Font = New Font(MyControl.Font, _
Gets the position of the mouse cursor in screen coordinates.
A that contains the coordinates of the mouse cursor relative to the upper-left corner of the screen.
- property returns a that represents the mouse cursor position at the time the property was referenced. The coordinates indicate the position on the screen, not relative to the control, and are returned regardless of whether the cursor is positioned over the control. The coordinates of the upper-left corner of the screen are 0,0.
-
- The property is identical to the property.
-
-
-
-## Examples
- The following code example puts a label into an editable state when the user presses ALT+E while the mouse cursor is over the tree node. After the user is done editing the label, the labels cannot be edited again until the ALT+E key combination is pressed again. This example requires that you have a on a . The tree view should also have at least one in its collection.
-
+ property returns a that represents the mouse cursor position at the time the property was referenced. The coordinates indicate the position on the screen, not relative to the control, and are returned regardless of whether the cursor is positioned over the control. The coordinates of the upper-left corner of the screen are 0,0.
+
+ The property is identical to the property.
+
+
+
+## Examples
+ The following code example puts a label into an editable state when the user presses ALT+E while the mouse cursor is over the tree node. After the user is done editing the label, the labels cannot be edited again until the ALT+E key combination is pressed again. This example requires that you have a on a . The tree view should also have at least one in its collection.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members4/CPP/controlmembers4.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BringToFront/controlmembers4.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members4/VB/controlmembers4.vb" id="Snippet3":::
+
]]>
@@ -9995,35 +9999,35 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse pointer is over the control and a mouse button is released.
-
-
-2.
-
-3. / /
-
-4.
-
-5.
-
+
+
+2.
+
+3. / /
+
+4.
+
+5.
+
> [!NOTE]
-> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+> The following events are not raised for the class unless there is at least one in the collection: , , , , , , and . If there is at least one in the collection, and the user interacts with the tab control's header (where the names appear), the raises the appropriate event. However, if the user interaction is within the client area of the tab page, the raises the appropriate event.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -10064,36 +10068,36 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the mouse wheel moves while the control has focus.
- event it is important to follow the user interface (UI) standards associated with the mouse wheel. The property value indicates the amount the mouse wheel has been moved. The UI should scroll when the accumulated delta is plus or minus 120. The UI should scroll the number of logical lines returned by the property for every delta value reached. You can also scroll more smoothly in smaller that 120 unit increments, however the ratio should remain constant, that is lines scrolled per 120 delta units of wheel movement.
-
- For more information about handling mouse wheel messages, see the [WM_MOUSEWHEEL](/windows/win32/inputdev/wm-mousewheel) topic.
-
- Mouse events occur in the following order:
-
-1.
-
-2.
-
-3. / /
-
-4.
-
-5.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
-
+ event it is important to follow the user interface (UI) standards associated with the mouse wheel. The property value indicates the amount the mouse wheel has been moved. The UI should scroll when the accumulated delta is plus or minus 120. The UI should scroll the number of logical lines returned by the property for every delta value reached. You can also scroll more smoothly in smaller that 120 unit increments, however the ratio should remain constant, that is lines scrolled per 120 delta units of wheel movement.
+
+ For more information about handling mouse wheel messages, see the [WM_MOUSEWHEEL](/windows/win32/inputdev/wm-mousewheel) topic.
+
+ Mouse events occur in the following order:
+
+1.
+
+2.
+
+3. / /
+
+4.
+
+5.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates using different mouse events to draw the path of the mouse on a . A line segment is added to the for each and events that occur. To update the graphics, the method is called for the on each `MouseDown` and `MouseUp` event. In addition, the graphic path is scrolled up or down when the event occurs. Additional mouse events, like , are identified on screen as well. Also displayed on the screen is additional information about the mouse from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/CPP/mouseeventexample.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseDown/mouseeventexample.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.MouseEvent/VB/mouseeventexample.vb" id="Snippet1":::
+
]]>
@@ -10124,20 +10128,20 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control is moved.
- event to display the location of the form in screen coordinates on the caption bar of the form.
-
+ event to display the location of the form in screen coordinates on the caption bar of the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Move/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Move/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Move/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Move/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -10173,20 +10177,20 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the name of the control.
The name of the control. The default is an empty string ("").
- property can be used at run time to evaluate the object by name rather than type and programmatic name. Because the property returns a type, it can be evaluated in case-style logic statements (`Select` statement in Visual Basic, `switch` statement in Visual C# and Visual C++).
-
-
-
-## Examples
- The following code example displays the of a control in a when the control is added or removed from a form.
-
+ property can be used at run time to evaluate the object by name rather than type and programmatic name. Because the property returns a type, it can be evaluated in case-style logic statements (`Select` statement in Visual Basic, `switch` statement in Visual C# and Visual C++).
+
+
+
+## Examples
+ The following code example displays the of a control in a when the control is added or removed from a form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.ControlRemoved/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ControlAdded/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -10253,13 +10257,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10300,24 +10304,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -10360,24 +10364,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -10419,13 +10423,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10468,13 +10472,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10517,24 +10521,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -10577,13 +10581,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10626,28 +10630,28 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example demonstrates overriding the method in a derived class. To run the example, paste the following code after a form class, in the same file. Add a textbox of type `SingleClickTextBox` to the form.
-
+ 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.
+
+
+
+## Examples
+ The following code example demonstrates overriding the method in a derived class. To run the example, paste the following code after a form class, in the same file. Add a textbox of type `SingleClickTextBox` to the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlOnClick/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnClick/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlOnClick/VB/form1.vb" id="Snippet1":::
-
- The following code example shows one of the many uses of the event and event handler.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlOnClick/VB/form1.vb" id="Snippet1":::
+
+ The following code example shows one of the many uses of the event and event handler.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.FindForm/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Click/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -10688,13 +10692,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10732,24 +10736,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -10791,13 +10795,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -10838,24 +10842,24 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses to add a control to a form and displays the name of the added control in a .
-
+ 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.
+
+
+
+## Examples
+ The following code example uses to add a control to a form and displays the name of the added control in a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.ControlRemoved/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ControlAdded/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -10897,24 +10901,24 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses to remove a control from a form and displays the name of the removed control in a .
-
+ 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.
+
+
+
+## Examples
+ The following code example uses to remove a control from a form and displays the name of the removed control in a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.ControlRemoved/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/ControlAdded/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.ControlRemoved/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -10953,13 +10957,13 @@ MyControl.Font = New Font(MyControl.Font, _
Raises the method.
- method is called when the control is first created.
-
- The 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.
-
+ method is called when the control is first created.
+
+ The 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.
+
]]>
@@ -11001,24 +11005,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -11091,24 +11095,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -11151,22 +11155,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event of a to load text files listed in the into a control.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event of a to load text files listed in the into a control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.DoubleClick/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoubleClick/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.DoubleClick/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.DoubleClick/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -11282,13 +11286,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11330,13 +11334,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11378,13 +11382,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11426,13 +11430,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11474,13 +11478,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11523,22 +11527,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event to change the foreground and background colors of a under particular conditions.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event to change the foreground and background colors of a under particular conditions.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Enter/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Enter/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -11580,24 +11584,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -11639,24 +11643,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -11698,13 +11702,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11746,13 +11750,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11794,13 +11798,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11851,13 +11855,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11909,13 +11913,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -11951,24 +11955,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -12011,13 +12015,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12059,22 +12063,22 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event to determine the type of character entered into the control.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event to determine the type of character entered into the control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyDown/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -12116,22 +12120,22 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event to prevent characters from entering the control.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event to prevent characters from entering the control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyDown/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/KeyDown/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyDown/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -12173,22 +12177,22 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event with the class to display pop-up style help to the user.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event with the class to display pop-up style help to the user.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyUp/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bottom/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -12230,13 +12234,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12278,22 +12282,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event to reset a control to its former state.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event to reset a control to its former state.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Enter/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Enter/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Enter/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -12335,24 +12339,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName* `Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ 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.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName* `Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -12395,13 +12399,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12436,13 +12440,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12482,13 +12486,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12528,13 +12532,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12574,13 +12578,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12621,13 +12625,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12670,13 +12674,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12719,22 +12723,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example demonstrates how to override the and methods in a derived class. To run the example, paste the following code in a new form and paste this class, forming the same file, after the form. Add a button of type `FunButton` to the form.
-
+ 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.
+
+
+
+## Examples
+ The following code example demonstrates how to override the and methods in a derived class. To run the example, paste the following code in a new form and paste this class, forming the same file, after the form. Add a button of type `FunButton` to the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -12777,13 +12781,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12826,22 +12830,22 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example demonstrates how to override the and methods in a derived class. To run the example, paste the following code in a new form and paste this class, forming the same file, after the form. Add a button of type `FunButton` to the form.
-
+ 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.
+
+
+
+## Examples
+ The following code example demonstrates how to override the and methods in a derived class. To run the example, paste the following code in a new form and paste this class, forming the same file, after the form. Add a button of type `FunButton` to the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DefaultBackColor/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ControlDefaultProperties/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -12884,13 +12888,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12933,13 +12937,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -12982,22 +12986,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
-
-
-## Examples
- The following code example uses the event to display the location of the form in screen coordinates on the caption bar of the form.
-
+ 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.
+
+
+
+## Examples
+ The following code example uses the event to display the location of the form in screen coordinates on the caption bar of the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Move/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Move/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Move/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Move/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -13039,11 +13043,11 @@ MyControl.Font = New Font(MyControl.Font, _
A that represents the Windows message.
Notifies the control of Windows messages.
- method is called if the control's `EnableNotifyMessage` style bit is set in . The `EnableNotifyMessage` style in enables the control to be notified when the method receives a Windows message. With this method, semi-trusted controls can listen for Windows messages without enabling them to modify the message.
-
+ method is called if the control's `EnableNotifyMessage` style bit is set in . The `EnableNotifyMessage` style in enables the control to be notified when the method receives a Windows message. With this method, semi-trusted controls can listen for Windows messages without enabling them to modify the message.
+
]]>
@@ -13077,13 +13081,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -13124,26 +13128,26 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example enables the user to drag an image or image file onto the form, and have it be displayed at the point on which it is dropped. The method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example enables the user to drag an image or image file onto the form, and have it be displayed at the point on which it is dropped. The method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/CPP/imagedrag.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/AllowDrop/imagedrag.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Paint/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnPaint/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -13185,11 +13189,11 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains information about the control to paint.
Paints the background of the control.
- method enables derived classes to handle Windows background erase requests.
-
+ method enables derived classes to handle Windows background erase requests.
+
]]>
@@ -13231,24 +13235,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13294,24 +13298,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13353,24 +13357,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13412,24 +13416,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13470,13 +13474,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -13547,24 +13551,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13606,24 +13610,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13665,24 +13669,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13724,24 +13728,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13783,24 +13787,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event when the property value of the control's container changes.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -13841,13 +13845,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -13887,11 +13891,11 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- is set, you can override to do layered painting. See for more information.
-
+ is set, you can override to do layered painting. See for more information.
+
]]>
The parameter is .
@@ -13931,18 +13935,18 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- [!NOTE]
-> Override this method if you want to change the point at which dragging is canceled or at which a drop occurs.
-
- Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/).
-
- The method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+> Override this method if you want to change the point at which dragging is canceled or at which a drop occurs.
+
+ Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/).
+
+ The method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -13983,13 +13987,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- 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.
-
+ 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.
+
]]>
@@ -14030,13 +14034,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14078,24 +14082,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -14137,13 +14141,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14185,13 +14189,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14236,13 +14240,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14284,13 +14288,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14332,24 +14336,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -14391,22 +14395,22 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -14448,13 +14452,13 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14496,13 +14500,13 @@ MyControl.Font = New Font(MyControl.Font, _
A that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
]]>
@@ -14544,24 +14548,24 @@ MyControl.Font = New Font(MyControl.Font, _
An that contains the event data.
Raises the event.
- method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
-
-
-
-## Examples
- The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
-
+ method also enables derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
+
+
+
+## Examples
+ The following code example is an event-raising method that is executed when the property value changes. The class has several methods with the name pattern `On`*PropertyName*`Changed` that raise the corresponding *PropertyName*`Changed` event when the *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a derived class displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a class that derives from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/CPP/onpropertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnBackColorChanged/onpropertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_OnPropertyChangedEvents/VB/onpropertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -14602,55 +14606,55 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets padding within the control.
A representing the control's internal spacing characteristics.
- and , the property gets or sets their respective properties. The property is equal to its property.
-
- Controls receive default values for that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications.
-
- All controls that implement are enlarged by the amount in when is `true`.
-
- The following controls do not use :
-
-- Controls that do not implement through
-
-- Custom controls that directly inherit from
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
--
-
+ and , the property gets or sets their respective properties. The property is equal to its property.
+
+ Controls receive default values for that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications.
+
+ All controls that implement are enlarged by the amount in when is `true`.
+
+ The following controls do not use :
+
+- Controls that do not implement through
+
+- Custom controls that directly inherit from
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
]]>
@@ -14678,21 +14682,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control's padding changes.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet41":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet41":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet41":::
+
]]>
@@ -14721,24 +14725,24 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the control is redrawn.
- event is raised when the control is redrawn. It passes an instance of to the method(s) that handles the event.
-
- When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the method. For more information, see [Overriding the OnPaint Method](/dotnet/framework/winforms/controls/overriding-the-onpaint-method) and [Custom Control Painting and Rendering](/dotnet/framework/winforms/controls/custom-control-painting-and-rendering).
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example creates a control on the form and uses the event to draw to it.
-
+ event is raised when the control is redrawn. It passes an instance of to the method(s) that handles the event.
+
+ When creating a new custom control or an inherited control with a different visual appearance, you must provide code to render the control by overriding the method. For more information, see [Overriding the OnPaint Method](/dotnet/framework/winforms/controls/overriding-the-onpaint-method) and [Custom Control Painting and Rendering](/dotnet/framework/winforms/controls/custom-control-painting-and-rendering).
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example creates a control on the form and uses the event to draw to it.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Paint/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/OnPaint/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Paint/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -14783,20 +14787,20 @@ MyControl.Font = New Font(MyControl.Font, _
Gets or sets the parent container of the control.
A that represents the parent or container control of the control.
- property value to `null` removes the control from the of its current parent control.
-
-
-
-## Examples
- The following code example uses the property and the method to set properties on the parent control of a button and its form.
-
+ property value to `null` removes the control from the of its current parent control.
+
+
+
+## Examples
+ The following code example uses the property and the method to set properties on the parent control of a button and its form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.FindForm/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Click/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.FindForm/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -14827,13 +14831,13 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
]]>
@@ -14885,24 +14889,24 @@ MyControl.Font = New Font(MyControl.Font, _
Forces the control to apply layout logic to all its child controls.
- method was called before calling the method, the event is suppressed.
-
- The and properties of the created are set to `null` if no values were provided when the method was called.
-
-
-
-## Examples
- The following code example demonstrates how to use the method. It also demonstrates ways in which the event is raised. In this example, the `Click` event handler for `Button1` explicitly calls . The `Click` event handler for `Button2` implicitly calls . is also called when the form is loaded. `Button3` returns the control to the state it was in when loaded. In each case, the event is raised.
-
- This is a complete example. To run the example, paste the following code in a blank form.
-
+ method was called before calling the method, the event is suppressed.
+
+ The and properties of the created are set to `null` if no values were provided when the method was called.
+
+
+
+## Examples
+ The following code example demonstrates how to use the method. It also demonstrates ways in which the event is raised. In this example, the `Click` event handler for `Button1` explicitly calls . The `Click` event handler for `Button2` implicitly calls . is also called when the form is loaded. `Button3` returns the control to the state it was in when loaded. In each case, the event is raised.
+
+ This is a complete example. To run the example, paste the following code in a blank form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/PerformLayout/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -14950,24 +14954,24 @@ MyControl.Font = New Font(MyControl.Font, _
The name of the most recently changed property on the control.
Forces the control to apply layout logic to all its child controls.
- method was called before calling the method, the event is suppressed.
-
- The `affectedControl` and `affectedProperty` parameters can both be set to `null`. Doing so causes the and properties of the created to be set to `null`.
-
-
-
-## Examples
- The following code example demonstrates how to use the method. It also demonstrates ways in which the event is raised. In this example, the `Click` event handler for `Button1` explicitly calls . The `Click` event handler for `Button2` implicitly calls . is also called when the form is loaded. `Button3` returns the control to the state it was in when loaded. In each case, the event is raised.
-
- This is a complete example. To run the example, paste the following code in a blank form.
-
+ method was called before calling the method, the event is suppressed.
+
+ The `affectedControl` and `affectedProperty` parameters can both be set to `null`. Doing so causes the and properties of the created to be set to `null`.
+
+
+
+## Examples
+ The following code example demonstrates how to use the method. It also demonstrates ways in which the event is raised. In this example, the `Click` event handler for `Button1` explicitly calls . The `Click` event handler for `Button2` implicitly calls . is also called when the form is loaded. `Button3` returns the control to the state it was in when loaded. In each case, the event is raised.
+
+ This is a complete example. To run the example, paste the following code in a blank form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/PerformLayout/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.PerformLayout/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -15013,15 +15017,15 @@ MyControl.Font = New Font(MyControl.Font, _
Computes the location of the specified screen point into client coordinates.
A that represents the converted , , in client coordinates.
- method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
-
+ method is overridden to repaint the image each time the form is painted; otherwise the image would only persist until the next repainting. The event-handling method determines the type of data being dragged into the form and provides the appropriate feedback. The event-handling method displays the image on the form, if an can be created from the data. Because the and values are screen coordinates, the example uses the method to convert them to client coordinates.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/CPP/imagedrag.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/AllowDrop/imagedrag.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control.DragOperations/VB/imagedrag.vb" id="Snippet1":::
+
]]>
@@ -15056,15 +15060,15 @@ MyControl.Font = New Font(MyControl.Font, _
Computes the location of the specified client point into screen coordinates.
A that represents the converted , , in screen coordinates.
- , , , , , and members. To run the example, paste the following code in a form called Form1 containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
-
+ , , , , , and members. To run the example, paste the following code in a form called Form1 containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseButtons/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -15138,7 +15142,7 @@ MyControl.Font = New Font(MyControl.Font, _
A that represents the message to process.
Preprocesses keyboard or input messages within the message loop before they are dispatched.
One of the values, depending on whether is or and whether or are or .
- To be added.
+ This is the method that is called directly by the message loop of the .
@@ -15170,13 +15174,13 @@ MyControl.Font = New Font(MyControl.Font, _
if the message was processed by the control; otherwise, .
- is called by the application's message loop to preprocess input messages before they are dispatched. Possible values for the `msg` parameter are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.
-
- When overriding , a control should return `true` to indicate that it has processed the message. For messages that are not processed by the control, the result of `base.PreProcessMessage` should be returned. Controls will typically override one of the more specialized methods such as , , , , or instead of overriding .
-
+ is called by the application's message loop to preprocess input messages before they are dispatched. Possible values for the `msg` parameter are WM_KEYDOWN, WM_SYSKEYDOWN, WM_CHAR, and WM_SYSCHAR.
+
+ When overriding , a control should return `true` to indicate that it has processed the message. For messages that are not processed by the control, the result of `base.PreProcessMessage` should be returned. Controls will typically override one of the more specialized methods such as , , , , or instead of overriding .
+
]]>
@@ -15204,21 +15208,21 @@ MyControl.Font = New Font(MyControl.Font, _
Occurs before the event when a key is pressed while focus is on this control.
- control ignores the arrow keys. Pressing the arrow keys typically causes the focus to move to the previous or next control. The arrow keys are considered navigation keys and pressing these keys typically do not raise the event for a . However, pressing the arrow keys for a does raise the event. By handling the event for a and setting the property to `true`, you can raise the event when the arrow keys are pressed. However, if you handle the arrow keys, the focus will no longer move to the previous or next control.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates a that includes a . When the has the focus and you press the UP ARROW or DOWN ARROW keys, the appears. The event handler detects when the UP ARROW or DOWN ARROW keys are pressed and sets the property to `true`. This raises the event so that you can display the . You should not put any logic in the event handler, other than to set the property. Instead, you should put your logic in the event handler.
-
+ control ignores the arrow keys. Pressing the arrow keys typically causes the focus to move to the previous or next control. The arrow keys are considered navigation keys and pressing these keys typically do not raise the event for a . However, pressing the arrow keys for a does raise the event. By handling the event for a and setting the property to `true`, you can raise the event when the arrow keys are pressed. However, if you handle the arrow keys, the focus will no longer move to the previous or next control.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates a that includes a . When the has the focus and you press the UP ARROW or DOWN ARROW keys, the appears. The event handler detects when the UP ARROW or DOWN ARROW keys are pressed and sets the property to `true`. This raises the event so that you can display the . You should not put any logic in the event handler, other than to set the property. Instead, you should put your logic in the event handler.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/PreviewKeyDown/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.previewkeydown/vb/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.previewkeydown/vb/form1.vb" id="Snippet1":::
+
]]>
@@ -15254,13 +15258,13 @@ MyControl.Font = New Font(MyControl.Font, _
if the character was processed by the control; otherwise, .
- method first determines whether the control has a , and if so, enables the to process the command key. If the command key is not a menu shortcut and the control has a parent, the key is passed to the parent's method. The net effect is that command keys are "bubbled" up the control hierarchy. In addition to the key the user pressed, the key data also indicates which, if any, modifier keys were pressed at the same time as the key. Modifier keys include the SHIFT, CTRL, and ALT keys.
-
+ method first determines whether the control has a , and if so, enables the to process the command key. If the command key is not a menu shortcut and the control has a parent, the key is passed to the parent's method. The net effect is that command keys are "bubbled" up the control hierarchy. In addition to the key the user pressed, the key data also indicates which, if any, modifier keys were pressed at the same time as the key. Modifier keys include the SHIFT, CTRL, and ALT keys.
+
]]>
@@ -15297,11 +15301,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the character was processed by the control; otherwise, .
- method indicates that the control is not processing the character. The method simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog characters. This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.
-
+ method indicates that the control is not processing the character. The method simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog characters. This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.
+
]]>
@@ -15338,11 +15342,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the key was processed by the control; otherwise, .
- method indicates that the control is not processing the key. The simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog keys. This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.
-
+ method indicates that the control is not processing the key. The simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog keys. This method is only called when the control is hosted in a Windows Forms application or as an ActiveX control.
+
]]>
@@ -15379,11 +15383,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the message was processed by the control; otherwise, .
- , , or methods. The `m` parameter contains the window message that must be processed. Possible values for the property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, WM_SYSKEYUP, and WM_IME_CHAR.
-
+ , , or methods. The `m` parameter contains the window message that must be processed. Possible values for the property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, WM_SYSKEYUP, and WM_IME_CHAR.
+
]]>
@@ -15420,11 +15424,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the message was processed by the control; otherwise, .
- method. If the parent's method does not process the message then the method is called to generate the appropriate keyboard events. The `m` parameter contains the window message that must be processed. Possible values for the property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, and WM_SYSKEYUP.
-
+ method. If the parent's method does not process the message then the method is called to generate the appropriate keyboard events. The `m` parameter contains the window message that must be processed. Possible values for the property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, and WM_SYSKEYUP.
+
]]>
@@ -15464,11 +15468,11 @@ MyControl.Font = New Font(MyControl.Font, _
if the message was processed by the control; otherwise, .
- property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, and WM_SYSKEYUP. The method simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog keys.
-
+ property are WM_CHAR, WM_KEYDOWN, WM_SYSKEYDOWN, WM_KEYUP, and WM_SYSKEYUP. The method simply sends the character to the parent's method, or returns `false` if the control has no parent. The class overrides this method to perform actual processing of dialog keys.
+
]]>
@@ -15512,30 +15516,30 @@ MyControl.Font = New Font(MyControl.Font, _
if the character was processed as a mnemonic by the control; otherwise, .
- method to determine whether the given character matches a mnemonic in the control's text.
-
- For example:
-
-```csharp
-if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
- // Perform action associated with mnemonic.
- }
-```
-
- This default implementation of the method simply returns `false` to indicate that the control has no mnemonic.
-
-
-
-## Examples
- The following code example demonstrates an extension of the button class that overrides the method to exhibit custom behavior. The example also demonstrates the use of the and properties. To run this example paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form.
-
+ method to determine whether the given character matches a mnemonic in the control's text.
+
+ For example:
+
+```csharp
+if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
+ // Perform action associated with mnemonic.
+ }
+```
+
+ This default implementation of the method simply returns `false` to indicate that the control has no mnemonic.
+
+
+
+## Examples
+ The following code example demonstrates an extension of the button class that overrides the method to exhibit custom behavior. The example also demonstrates the use of the and properties. To run this example paste the following code after a form class, in the same file. Add a button of type `MnemonicButton` to the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/ProcessMnemonic/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProcessMnemonic/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -15580,27 +15584,27 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Gets the product name of the assembly containing the control.
The product name of the assembly containing the control.
- property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
-
-```
-[assembly: AssemblyProduct("MyApplication")]
-```
-
+ property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
+
+```
+[assembly: AssemblyProduct("MyApplication")]
+```
+
> [!NOTE]
> It is strongly recommended that you provide the company name, product name, and product version. Providing this information enables the use of Windows Forms features such as that make it easier to write applications that comply with the "Certified for Windows" program.
-
-
-
-## Examples
- The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
-
+
+
+
+## Examples
+ The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties3/CPP/aboutdialog.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CompanyName/aboutdialog.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
+
]]>
@@ -15644,27 +15648,27 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Gets the version of the assembly containing the control.
The file version of the assembly containing the control.
- property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
-
-```
-[assembly: AssemblyVersion("1.0.1")]
-```
-
+ property is a read-only property. To change the value of this property, set the property value of the . The following line of C# code sets the property.
+
+```
+[assembly: AssemblyVersion("1.0.1")]
+```
+
> [!NOTE]
> It is strongly recommended that you provide the company name, product name, and product version. Providing this information enables the use of Windows Forms features such as that make it easier to write applications that comply with the "Certified for Windows" program.
-
-
-
-## Examples
- The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
-
+
+
+
+## Examples
+ The following code example displays information about the application in a contained by a . This example requires that the , and have been set.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties3/CPP/aboutdialog.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CompanyName/aboutdialog.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties3/VB/aboutdialog.vb" id="Snippet1":::
+
]]>
@@ -15719,22 +15723,22 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Occurs when is providing help to accessibility applications.
- class to enable users to invoke help on your accessible object by pressing the F1 key. Using the provides you with complete information in the . For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
-
- This code excerpt demonstrates handling the event. See the class overview for the complete code example.
-
+ class to enable users to invoke help on your accessible object by pressing the F1 key. Using the provides you with complete information in the . For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the creation of an accessibility-aware chart control, using the and classes to expose accessible information. The control plots two curves along with a legend. The `ChartControlAccessibleObject` class, which derives from `ControlAccessibleObject`, is used in the method to provide custom accessible information for the chart control. Since the chart legend is not an actual -based control, but instead is drawn by the chart control, it does not any built-in accessible information. Because of this, the `ChartControlAccessibleObject` class overrides the method to return the `CurveLegendAccessibleObject` that represents accessible information for each part of the legend. When an accessible-aware application uses this control, the control can provide the necessary accessible information.
+
+ This code excerpt demonstrates handling the event. See the class overview for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/CPP/chartcontrol.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AccessibleEvents/Overview/chartcontrol.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.AccessibleObject/VB/chartcontrol.vb" id="Snippet3":::
+
]]>
@@ -15764,49 +15768,49 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Occurs during a drag-and-drop operation and enables the drag source to determine whether the drag-and-drop operation should be canceled.
- event is raised when there is a change in the keyboard or mouse button state during a drag-and-drop operation. The event enables the drag source to determine whether the drag-and-drop operation should be canceled.
-
- The following describes how and when events related to drag-and-drop operations are raised.
-
- The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
-
- If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
-
- Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
-
-- If the user moves out of a window, the event is raised.
-
-- If the mouse enters another control, the for that control is raised.
-
-- If the mouse moves but stays within the same control, the event is raised.
-
- If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
-
-- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
-
+ event is raised when there is a change in the keyboard or mouse button state during a drag-and-drop operation. The event enables the drag source to determine whether the drag-and-drop operation should be canceled.
+
+ The following describes how and when events related to drag-and-drop operations are raised.
+
+ The method determines the control under the current cursor location. It then checks to see if the control is a valid drop target.
+
+ If the control is a valid drop target, the event is raised with the drag-and-drop effect specified. For a list of drag-and-drop effects, see the enumeration.
+
+ Changes in the mouse cursor position, keyboard state, and mouse button state are tracked.
+
+- If the user moves out of a window, the event is raised.
+
+- If the mouse enters another control, the for that control is raised.
+
+- If the mouse moves but stays within the same control, the event is raised.
+
+ If there is a change in the keyboard or mouse button state, the event is raised and determines whether to continue the drag, to drop the data, or to cancel the operation based on the value of the property of the event's .
+
+- If the value of is `Continue`, the event is raised to continue the operation and the event is raised with the new effect so appropriate visual feedback can be set. For a list of valid drop effects, see the enumeration.
+
> [!NOTE]
- > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
-
-- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
-
-- If the value of is `Cancel`, the event is raised.
-
- By default, the event sets to `Cancel` in if the ESC key was pressed and sets to `Drop` in if the left, middle, or right mouse button is pressed.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- This code excerpt demonstrates using the event to cancel the drag-and-drop operation if the drag operation moves outside the bounds of the form. See the method for the complete code example.
-
+ > The and events are paired so that as the mouse moves across the drop target, the user is given the most up-to-date feedback on the mouse's position.
+
+- If the value of is `Drop`, the drop effect value is returned to the source, so the source application can perform the appropriate operation on the source data; for example, cut the data if the operation was a move.
+
+- If the value of is `Cancel`, the event is raised.
+
+ By default, the event sets to `Cancel` in if the ESC key was pressed and sets to `Drop` in if the left, middle, or right mouse button is pressed.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ This code excerpt demonstrates using the event to cancel the drag-and-drop operation if the drag operation moves outside the bounds of the form. See the method for the complete code example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/CPP/form1.cpp" id="Snippet6":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/DoDragDrop/form11.cs" id="Snippet6":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet6":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.DoDragDrop/VB/form1.vb" id="Snippet6":::
+
]]>
@@ -16006,11 +16010,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Forces the re-creation of the handle for the control.
- method is called whenever parameters are needed for a new control, but using a call from to is insufficient. This method also calls and and sets to `true`.
-
+ method is called whenever parameters are needed for a new control, but using a call from to is insufficient. This method also calls and and sets to `true`.
+
]]>
@@ -16063,11 +16067,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
if the control is currently re-creating its handle; otherwise, .
- property returns `true` if the method is still running on the control.
-
+ property returns `true` if the method is still running on the control.
+
]]>
@@ -16141,15 +16145,15 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Computes the size and location of the specified client rectangle in screen coordinates.
A that represents the converted , , in screen coordinates.
- , , , , , and members. To run the example, paste the following code in a form called **Form1** containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
-
+ , , , , , and members. To run the example, paste the following code in a form called **Form1** containing several controls. This example requires that the , , and events are connected to the event handlers defined in the example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/CPP/form1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/MouseButtons/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RectangleToScreen/VB/form1.vb" id="Snippet2":::
+
]]>
@@ -16193,15 +16197,15 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
if the message was reflected; otherwise, .
- method is an infrastructure method and typically should not be called from your code.
-
- If the `hWnd` parameter does not represent a valid control, the method returns `false`.
-
- Because Windows messages are returned to the top-level window, the method is used to propagate the return message to the control that sent the message.
-
+ method is an infrastructure method and typically should not be called from your code.
+
+ If the `hWnd` parameter does not represent a valid control, the method returns `false`.
+
+ Because Windows messages are returned to the top-level window, the method is used to propagate the return message to the control that sent the message.
+
]]>
@@ -16278,23 +16282,23 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Gets or sets the window region associated with the control.
The window associated with the control.
- [!NOTE]
-> The collection of pixels contained with the region can be noncontiguous.
-
-
-
-## Examples
- The following code example demonstrates how to use the property by creating a round button. To run the example, paste the following code in a form containing a button called `roundButton`. This example requires that the event is connected to the event handler defined in the example.
-
+> The collection of pixels contained with the region can be noncontiguous.
+
+
+
+## Examples
+ The following code example demonstrates how to use the property by creating a round button. To run the example, paste the following code in a form containing a button called `roundButton`. This example requires that the event is connected to the event handler defined in the example.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.Region/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Region/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.Region/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.Region/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -16324,21 +16328,21 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Occurs when the value of the property changes.
- event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet22":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet22":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet22":::
+
]]>
@@ -16452,11 +16456,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16491,11 +16495,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Causes a control bound to the to reread all the items in the list and refresh their displayed values.
-
@@ -16535,11 +16539,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16578,11 +16582,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16617,11 +16621,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16656,11 +16660,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16731,11 +16735,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value.
-
@@ -16764,11 +16768,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resets the property to its default value ().
- or creating your own control incorporating the .
-
+ or creating your own control incorporating the .
+
]]>
@@ -16804,24 +16808,24 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Occurs when the control is resized.
- of the resized control, you can cast the `sender` parameter of the registered method to a and get its property (or and properties individually).
-
- To handle custom layouts, use the event instead of the Resize event. The event is raised in response to a event, but also in response to other changes that affect the layout of the control.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example handles the event of a . When the form is resized, the event handler ensures that the form stays square (its and remain equal). To run this example, make sure and associate this event-handling method with the form's event.
-
+ of the resized control, you can cast the `sender` parameter of the registered method to a and get its property (or and properties individually).
+
+ To handle custom layouts, use the event instead of the Resize event. The event is raised in response to a event, but also in response to other changes that affect the layout of the control.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example handles the event of a . When the form is resized, the event handler ensures that the form stays square (its and remain equal). To run this example, make sure and associate this event-handling method with the form's event.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/WinForms.Control.Resize/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Resize/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WinForms.Control.Resize/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WinForms.Control.Resize/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -16864,11 +16868,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
if the control redraws itself when resized; otherwise, .
- property value is equivalent to the return value of the method when passing in the value as a parameter.
-
+ property value is equivalent to the return value of the method when passing in the value as a parameter.
+
]]>
@@ -16919,24 +16923,24 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Resumes usual layout logic.
- method forces an immediate layout if there are any pending layout requests.
-
- The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
-
- There must be no pending calls to for to be successfully called.
-
-
-
-## Examples
- The following code example adds two buttons to a form. The example transactions the addition of the buttons by using the and methods.
-
+ method forces an immediate layout if there are any pending layout requests.
+
+ The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
+
+ There must be no pending calls to for to be successfully called.
+
+
+
+## Examples
+ The following code example adds two buttons to a form. The example transactions the addition of the buttons by using the and methods.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members2/CPP/controlmembers2.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Focused/controlmembers2.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet2":::
+
]]>
@@ -16974,18 +16978,18 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
to execute pending layout requests; otherwise, .
Resumes usual layout logic, optionally forcing an immediate layout of pending layout requests.
- method forces an immediate layout if there are any pending layout requests. When the `performLayout` parameter is set to `true`, an immediate layout occurs if there are any pending layout requests.
-
- The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
-
- There must be no pending calls to for to be successfully called.
-
+ method forces an immediate layout if there are any pending layout requests. When the `performLayout` parameter is set to `true`, an immediate layout occurs if there are any pending layout requests.
+
+ The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
+
+ There must be no pending calls to for to be successfully called.
+
> [!NOTE]
-> When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. This will increase the performance of applications with many controls.
-
+> When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. This will increase the performance of applications with many controls.
+
]]>
@@ -17033,26 +17037,26 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Gets the distance, in pixels, between the right edge of the control and the left edge of its container's client area.
An representing the distance, in pixels, between the right edge of the control and the left edge of its container's client area.
- property is equal to the sum of the property value and the property value.
-
- The property is read-only. You can change this property value indirectly by changing the value of the or properties or calling the , , , or methods.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+ property is equal to the sum of the property value and the property value.
+
+ The property is read-only. You can change this property value indirectly by changing the value of the or properties or calling the , , , or methods.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.KeyUp/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bottom/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.KeyUp/VB/form1.vb" id="Snippet1":::
+
]]>
@@ -17092,34 +17096,34 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Gets or sets a value indicating whether control's elements are aligned to support locales using right-to-left fonts.
One of the values. The default is .
- property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
-
- The property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. When this property is set to , control elements that include text are displayed from right to left.
-
+ property is an ambient property. An ambient property is a control property that, if not set, is retrieved from the parent control. For example, a will have the same as its parent by default. For more information about ambient properties, see the class or the class overview.
+
+ The property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. When this property is set to , control elements that include text are displayed from right to left.
+
> [!NOTE]
-> If the value of the property is changed at run time, only raw text without formatting is preserved.
-
- The following are a few examples of how control elements are affected by the property value of :
-
-- Vertical scroll bars are displayed on the left side rather than right side of scrollable controls (for example, , , multiline , and ).
-
-- Horizontal scroll bars start with the scroll box (thumb) right-aligned.
-
-- The check box element alignment, controlled by the `CheckAlign` property, is reversed for and controls.
-
-- Items in list box, combo box, and up-down controls are right aligned.
-
-- Up and down buttons are left-aligned on and controls.
-
-- Menus (, , and ) are displayed right-aligned.
-
-- The alignment of toolbar buttons on a control or the alignment of text on a is not affected by the property.
-
-- supports right-to-left alignment; however, the effect on an ActiveX control depends on the extent to which the control author implemented support for right-to-left display.
-
+> If the value of the property is changed at run time, only raw text without formatting is preserved.
+
+ The following are a few examples of how control elements are affected by the property value of :
+
+- Vertical scroll bars are displayed on the left side rather than right side of scrollable controls (for example, , , multiline , and ).
+
+- Horizontal scroll bars start with the scroll box (thumb) right-aligned.
+
+- The check box element alignment, controlled by the `CheckAlign` property, is reversed for and controls.
+
+- Items in list box, combo box, and up-down controls are right aligned.
+
+- Up and down buttons are left-aligned on and controls.
+
+- Menus (, , and ) are displayed right-aligned.
+
+- The alignment of toolbar buttons on a control or the alignment of text on a is not affected by the property.
+
+- supports right-to-left alignment; however, the effect on an ActiveX control depends on the extent to which the control author implemented support for right-to-left display.
+
]]>
The assigned value is not one of the values.
@@ -17158,24 +17162,24 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
-
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example is an event handler that is executed when the property value changes. The class has several methods with the name pattern *PropertyName*`Changed` that are raised when the corresponding *PropertyName* value changes (*PropertyName* represents the name of the corresponding property).
+
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -17229,11 +17233,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17281,11 +17285,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17333,11 +17337,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17385,11 +17389,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17433,11 +17437,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17481,11 +17485,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Converts the specified to the appropriate to support right-to-left text.
One of the values.
- property of is set to `No`, the return value is equal to the `align` parameter passed in.
-
+ property of is set to `No`, the return value is equal to the `align` parameter passed in.
+
]]>
@@ -17536,11 +17540,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
A containing the horizontal and vertical scaling factors.
Scales the control and all child controls by the specified scaling factor.
- method scales the control by the specified scaling `factor`. It also recursively scales all child controls if the property is `true`. Internally, this method calls to scale each control.
-
+ method scales the control by the specified scaling `factor`. It also recursively scales all child controls if the property is `true`. Internally, this method calls to scale each control.
+
]]>
@@ -17697,13 +17701,13 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
if child controls will be scaled when the method on this control is called; otherwise, . The default is .
- property is `true`, then the method will recursively call the method of each of its child controls.
-
- The default implementation of always returns `true`. Derived classes can override to return `false` to indicate that scaling should not be performed on their children.
-
+ property is `true`, then the method will recursively call the method of each of its child controls.
+
+ The default implementation of always returns `true`. Derived classes can override to return `false` to indicate that scaling should not be performed on their children.
+
]]>
@@ -17745,22 +17749,22 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
A value that specifies the bounds of the control to use when defining its size and position.
Scales a control's location, size, padding and margin.
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
]]>
@@ -17804,11 +17808,11 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
The vertical scaling factor.
This method is not relevant for this class.
-
@@ -17821,22 +17825,22 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) {
Activates a control.
- method activates the control if the control's style bit is set to `true`, it is contained in another control, and all its parent controls are both visible and enabled.
The Windows Forms controls in the following list are not selectable. Controls derived from controls in the list will also not be selectable.
-
--
--
+
+-
+-
-
--
+-
-
-
- (when there is no link present in the control)
-
+
]]>
@@ -17872,15 +17876,15 @@ The Windows Forms controls in the following list are not selectable. Controls de
Activates the control.
, if it is selectable.
-
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet2":::
-:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet2":::
-
+:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet2":::
+
]]>
@@ -17918,11 +17922,11 @@ The following code example selects the specified to move forward in the tab order; to move backward in the tab order.
Activates a child control. Optionally specifies the direction in the tab order to select the control from.
-
@@ -17971,56 +17975,56 @@ The following code example selects the specified
if a control was activated; otherwise, .
- method activates the next control in the tab order if the control's `Selectable` style bit is set to `true` in , it is contained in another control, and all its parent controls are both visible and enabled.
-
- The Windows Forms controls in the following list are not selectable. Controls derived from controls in the list will also not be selectable.
-
--
-
--
-
--
-
--
-
--
-
--
-
-- (when there is no link present in the control)
-
- When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
-
-
-## Examples
- The following code exampleshows the method being used in a form that has some controls. Each time that you click the form, the next control is activated. The property gets the currently active control in the container control.
-
+ method activates the next control in the tab order if the control's `Selectable` style bit is set to `true` in , it is contained in another control, and all its parent controls are both visible and enabled.
+
+ The Windows Forms controls in the following list are not selectable. Controls derived from controls in the list will also not be selectable.
+
+-
+
+-
+
+-
+
+-
+
+-
+
+-
+
+- (when there is no link present in the control)
+
+ When you change the focus by using the keyboard (TAB, SHIFT+TAB, and so on), by calling the or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
+
+
+## Examples
+ The following code exampleshows the method being used in a form that has some controls. Each time that you click the form, the next control is activated. The property gets the currently active control in the container control.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/SelectNextControl/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.selectnextcontrol/vb/form1.vb" id="Snippet1":::
-
- The following code example shows the method being used in a form that has a and some other controls. When you click the , the next control after the is activated. Notice that you have to get the parent of the control. Since is not a container, calling directly on the would not change the activation.
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.selectnextcontrol/vb/form1.vb" id="Snippet1":::
+
+ The following code example shows the method being used in a form that has a and some other controls. When you click the , the next control after the is activated. Notice that you have to get the parent of the control. Since is not a container, calling directly on the would not change the activation.
+
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/SelectNextControl/form1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.selectnextcontrol/vb/form1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.control.selectnextcontrol/vb/form1.vb" id="Snippet2":::
+
]]>
@@ -18051,11 +18055,11 @@ The following code example selects the specified
Sends the control to the back of the z-order.
- , that is not a child of another control. An active control is a visible control that has input focus. To use the method with an inactive, top-level control, first call the method on the control.
-
+ , that is not a child of another control. An active control is a visible control that has input focus. To use the method with an inactive, top-level control, first call the method on the control.
+
]]>
@@ -18172,15 +18176,15 @@ The following code example selects the specified A bitwise combination of the values. For any parameter not specified, the current value will be used.
Sets the specified bounds of the control to the specified location and size.
- on the screen in the event. This will keep the form centered as the user resizes it. This example requires that you have created a control.
-
+ on the screen in the event. This will keep the form centered as the user resizes it. This example requires that you have created a control.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Layout/CPP/layout.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BoundsSpecified/Overview/layout.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Layout/VB/layout.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Layout/VB/layout.vb" id="Snippet1":::
+
]]>
@@ -18229,25 +18233,25 @@ The following code example selects the specified A bitwise combination of the values.
Performs the work of setting the specified bounds of this control.
- , , or the or properties of the property can be passed in with a reference to the current instance of the control. However all values passed in are honored and applied to the control.
-
- The `boundsSpecified` parameter represents the elements of the controls changed by your application. For example, if you change the of the control, the `boundsSpecified` parameter value is the `Size` value of . However, if the is adjusted in response to the property being set, the `boundsSpecified` parameter value is the `None` value of .
-
+ , , or the or properties of the property can be passed in with a reference to the current instance of the control. However all values passed in are honored and applied to the control.
+
+ The `boundsSpecified` parameter represents the elements of the controls changed by your application. For example, if you change the of the control, the `boundsSpecified` parameter value is the `Size` value of . However, if the is adjusted in response to the property being set, the `boundsSpecified` parameter value is the `None` value of .
+
> [!NOTE]
-> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
-
-
-
-## Examples
- The following code example overrides the method to ensure that the control remains a fixed size. This example requires that you have a class that is either directly or indirectly derived from the class.
-
+> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
+
+
+
+## Examples
+ The following code example overrides the method to ensure that the control remains a fixed size. This example requires that you have a class that is either directly or indirectly derived from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_Methods/CPP/controlmethods.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/SetBoundsCore/controlmethods.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_Methods/VB/controlmethods.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_Methods/VB/controlmethods.vb" id="Snippet1":::
+
]]>
@@ -18293,27 +18297,27 @@ The following code example selects the specified The client area height, in pixels.
Sets the size of the client area of the control.
- of the control.
-
-
-
-## Examples
- The following code example overrides the method to ensure that the control remains square. This example requires that you have a class that is either directly or indirectly derived from the class.
-
+ of the control.
+
+
+
+## Examples
+ The following code example overrides the method to ensure that the control remains square. This example requires that you have a class that is either directly or indirectly derived from the class.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_Methods/CPP/controlmethods.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/SetBoundsCore/controlmethods.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_Methods/VB/controlmethods.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_Methods/VB/controlmethods.vb" id="Snippet2":::
+
]]>
- When overriding in a derived class, be sure to call the base class's method so that the property is adjusted.
-
+ When overriding in a derived class, be sure to call the base class's method so that the property is adjusted.
+
For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/framework/winforms/controls/rendering-a-windows-forms-control).
@@ -18355,23 +18359,23 @@ The following code example selects the specified to apply the specified style to the control; otherwise, .
Sets a specified flag to either or .
- method and passing in the appropriate bit (or bits) and the Boolean value to set the bit(s) to. To determine the value assigned to a specified bit, use the method and pass in the member to evaluate.
-
+ method and passing in the appropriate bit (or bits) and the Boolean value to set the bit(s) to. To determine the value assigned to a specified bit, use the method and pass in the member to evaluate.
+
> [!CAUTION]
-> Setting the control style bits can substantially change the behavior of the control. Review the enumeration documentation to understand the effects of changing the control style bits before calling the method.
-
-
-
-## Examples
- The following code example enables double-buffering on a and updates the styles to reflect the changes.
-
+> Setting the control style bits can substantially change the behavior of the control. Review the enumeration documentation to understand the effects of changing the control style bits before calling the method.
+
+
+
+## Examples
+ The following code example enables double-buffering on a and updates the styles to reflect the changes.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet3":::
+
]]>
@@ -18406,11 +18410,11 @@ The following code example selects the specified to set the control as the top-level control; otherwise, .
Sets the control as the top-level control.
- method of a and pass in a value of `false`, the form will not be visible until you call again, passing in a value of `true`.
-
+ method of a and pass in a value of `false`, the form will not be visible until you call again, passing in a value of `true`.
+
]]>
The parameter is set to and the control is an ActiveX control.
@@ -18446,11 +18450,11 @@ The following code example selects the specified to make the control visible; otherwise, .
Sets the control to the specified visible state.
-
@@ -18489,20 +18493,20 @@ The following code example selects the specified
Displays the control to the user.
- property to `true`. After the method is called, the property returns a value of `true` until the method is called.
-
-
-
-## Examples
- The following code example displays an about dialog box and temporarily draws a blue square on its surface. This example requires that you have defined a class that derives from named `AboutDialog`.
-
+ property to `true`. After the method is called, the property returns a value of `true` until the method is called.
+
+
+
+## Examples
+ The following code example displays an about dialog box and temporarily draws a blue square on its surface. This example requires that you have defined a class that derives from named `AboutDialog`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members2/CPP/controlmembers2.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Focused/controlmembers2.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet1":::
+
]]>
@@ -18551,11 +18555,11 @@ The following code example selects the specified
if the control should display focus rectangles; otherwise, .
-
@@ -18608,13 +18612,13 @@ The following code example selects the specified
if the keyboard accelerators are visible; otherwise, .
-
@@ -18690,26 +18694,26 @@ The following code example selects the specified Gets or sets the height and width of the control.
The that represents the height and width of the control in pixels.
- class is a value type (`Structure` in Visual Basic, `struct` in Visual C#), it is returned by value, meaning accessing the property returns a copy of the size of the control. So, adjusting the or properties of the returned from this property will not affect the or of the control. To adjust the or of the control, you must set the control's or property, or set the property with a new .
-
+ class is a value type (`Structure` in Visual Basic, `struct` in Visual C#), it is returned by value, meaning accessing the property returns a copy of the size of the control. So, adjusting the or properties of the returned from this property will not affect the or of the control. To adjust the or of the control, you must set the control's or property, or set the property with a new .
+
> [!NOTE]
-> To maintain better performance, do not set the of a control in its constructor. The preferred method is to override the property.
-
+> To maintain better performance, do not set the of a control in its constructor. The preferred method is to override the property.
+
> [!NOTE]
-> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
-
-
-
-## Examples
- The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
-
+> On Windows Server 2003 systems, the size of a is restricted by the maximum pixel width and height of the monitor.
+
+
+
+## Examples
+ The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
+
]]>
@@ -18739,24 +18743,24 @@ The following code example selects the specified
Occurs when the property value changes.
- event to handle custom layouts. The event is raised in response to events, but also in other conditions when layout might need to be applied.
-
- This event is raised if the property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the event. An instance of a control has been provided that can be scaled both horizontally and vertically. A instance provides the horizontal and vertical scale value. The instance named **OK** is used to set the scale values for the control instance. Whenever the size of the control changes, the event handler associated with the event of the control is called. This event handler displays a message box indicating that the size of the control has changed.
-
+ event to handle custom layouts. The event is raised in response to events, but also in other conditions when layout might need to be applied.
+
+ This event is raised if the property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the event. An instance of a control has been provided that can be scaled both horizontally and vertically. A instance provides the horizontal and vertical scale value. The instance named **OK** is used to set the scale values for the control instance. Whenever the size of the control changes, the event handler associated with the event of the control is called. This event handler displays a message box indicating that the size of the control has changed.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_Scale1/CPP/control_scale1.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/SizeChanged/control_scale1.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Scale1/VB/control_scale1.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_Scale1/VB/control_scale1.vb" id="Snippet2":::
+
]]>
@@ -18823,25 +18827,25 @@ The following code example selects the specified
Occurs when the control style changes.
- event occurs when flags have been added or changed.
-
- This event is raised if the control style is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ event occurs when flags have been added or changed.
+
+ This event is raised if the control style is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet68":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet68":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet68":::
+
]]>
@@ -18873,27 +18877,27 @@ The following code example selects the specified
Temporarily suspends the layout logic for the control.
- method is called.
-
- The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
-
- There must be no pending calls to for to be successfully called.
-
+ method is called.
+
+ The and methods are used in tandem to suppress multiple events while you adjust multiple attributes of the control. For example, you would typically call the method, then set the , , , or properties of the control, and then call the method to enable the changes to take effect.
+
+ There must be no pending calls to for to be successfully called.
+
> [!NOTE]
-> When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. This will increase the performance of applications with many controls.
-
-
-
-## Examples
- The following code example adds two buttons to a form. The example transactions the addition of the buttons by using the and methods.
-
+> When adding several controls to a parent control, it is recommended that you call the method before initializing the controls to be added. After adding the controls to the parent control, call the method. This will increase the performance of applications with many controls.
+
+
+
+## Examples
+ The following code example adds two buttons to a form. The example transactions the addition of the buttons by using the and methods.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members2/CPP/controlmembers2.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Focused/controlmembers2.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet2":::
+
]]>
@@ -19076,23 +19080,23 @@ The following code example selects the specified
Occurs when the system colors change.
- is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet69":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet69":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet69":::
+
]]>
@@ -19133,22 +19137,22 @@ The following code example selects the specified Gets or sets the tab order of the control within its container.
The index value of the control within the set of controls within its container. The controls in the container are included in the tab order.
- property must be set to `true`.
-
-
-
-## Examples
- The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
-
+ property must be set to `true`.
+
+
+
+## Examples
+ The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
+
]]>
@@ -19179,23 +19183,23 @@ The following code example selects the specified
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet25":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet25":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet25":::
+
]]>
@@ -19239,22 +19243,22 @@ The following code example selects the specified
Gets or sets a value indicating whether the user can give the focus to this control using the TAB key.
- if the user can give the focus to the control using the TAB key; otherwise, . The default is .
-
+ if the user can give the focus to the control using the TAB key; otherwise, . The default is .
+
Note: This property will always return for an instance of the class.
- property value of `false` are not included in the collection of controls in the tab order. The tab order can be manipulated by setting the control's property value.
-
-## Examples
- The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
-
+
+## Examples
+ The following code example adds a to a form and sets some of its common properties. The example anchors the button to the bottom-right corner of the form so it keeps its relative position as the form is resized. Next it sets the and resizes the button to the same size as the . The example then sets the to `true` and sets the property. Lastly, it adds an event handler to handle the event of the button. This example requires that you have an named `imageList1`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet3":::
+
]]>
@@ -19284,23 +19288,23 @@ Note: This property will always return for an instance o
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
-
- To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example demonstrates the use of this member. In the example, an event handler reports on the occurrence of the event. This report helps you to learn when the event occurs and can assist you in debugging. To report on multiple events or on events that occur frequently, consider replacing with or appending the message to a multiline .
+
+ To run the example code, paste it into a project that contains an instance of a type that inherits from , such as a or . Then name the instance `Control1` and ensure that the event handler is associated with the event.
+
:::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet26":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet26":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet26":::
+
]]>
@@ -19350,22 +19354,22 @@ Note: This property will always return for an instance o
Gets or sets the object that contains data about the control.
An that contains data about the control. The default is .
- class can be assigned to this property. If the property is set through the Windows Forms designer, only text can be assigned.
-
- A common use for the property is to store data that is closely associated with the control. For example, if you have a control that displays information about a customer, you might store a that contains the customer's order history in that control's property so the data can be accessed quickly.
-
-
-
-## Examples
- The following code example displays a form and stores a `Customer` in its property. This example requires that you have defined a class that derives from named `CustomerForm` and that you have defined a `Customer`.
-
+ class can be assigned to this property. If the property is set through the Windows Forms designer, only text can be assigned.
+
+ A common use for the property is to store data that is closely associated with the control. For example, if you have a control that displays information about a customer, you might store a that contains the customer's order history in that control's property so the data can be accessed quickly.
+
+
+
+## Examples
+ The following code example displays a form and stores a `Customer` in its property. This example requires that you have defined a class that derives from named `CustomerForm` and that you have defined a `Customer`.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Members2/CPP/controlmembers2.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Focused/controlmembers2.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Members2/VB/controlmembers2.vb" id="Snippet3":::
+
]]>
@@ -19409,20 +19413,20 @@ Note: This property will always return for an instance o
Gets or sets the text associated with this control.
The text associated with this control.
- property of the control is used differently by each derived class. For example the property of a is displayed in the title bar at the top of the form, is fairly small in character count, and usually displays the application or document name. However, the property of a can be large and can include numerous nonvisual characters used to format the text. For example, the text displayed in a can be formatted by adjusting the properties, or by the addition of spaces or tab characters to align the text.
-
-
-
-## Examples
- The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
-
+ property of the control is used differently by each derived class. For example the property of a is displayed in the title bar at the top of the form, is fairly small in character count, and usually displays the application or document name. However, the property of a can be large and can include numerous nonvisual characters used to format the text. For example, the text displayed in a can be formatted by adjusting the properties, or by the addition of spaces or tab characters to align the text.
+
+
+
+## Examples
+ The following code example creates a and sets some of its common properties. The example creates a and sets its within the group box. Next, it sets the property of the group box, and docks the group box to the top of the form. Lastly, it disables the group box by setting the property to `false`, which causes all controls contained within the group box to be disabled.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control Properties/CPP/controlproperties.cpp" id="Snippet2":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AnchorStyles/Overview/controlproperties.cs" id="Snippet2":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control Properties/VB/controlproperties.vb" id="Snippet2":::
+
]]>
@@ -19455,22 +19459,22 @@ Note: This property will always return for an instance o
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example changes the of a displaying currency data. The example converts the text to a decimal number and changes the to if the number is negative and to if the number is positive. This example requires that you have a that contains a .
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/CPP/propertychangedevents.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/BackColorChanged/propertychangedevents.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control_PropertyChangedEvents/VB/propertychangedevents.vb" id="Snippet1":::
+
]]>
@@ -19519,22 +19523,22 @@ Note: This property will always return for an instance o
Gets or sets the distance, in pixels, between the top edge of the control and the top edge of its container's client area.
An representing the distance, in pixels, between the top edge of the control and the top edge of its container's client area.
- property value is equivalent to the property of the property value of the control.
-
- Changes made to the and property values cause the property value of the control to change.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+ property value is equivalent to the property of the property value of the control.
+
+ Changes made to the and property values cause the property value of the control to change.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
]]>
@@ -19581,11 +19585,11 @@ Note: This property will always return for an instance o
Gets the parent control that is not parented by another Windows Forms control. Typically, this is the outermost that the control is contained in.
The that represents the top-level control that contains the current control.
- that the control is contained in. For example, if the control is contained on an MDI child , then the top-level control is the Multiple Document Interface (MDI) parent . If the control is not parented on a , this property will return `null`.
-
+ that the control is contained in. For example, if the control is contained on an MDI child , then the top-level control is the Multiple Document Interface (MDI) parent . If the control is not parented on a , this property will return `null`.
+
]]>
@@ -19615,21 +19619,21 @@ Note: This property will always return for an instance o
Causes the control to redraw the invalidated regions within its client area.
- method with the method.
-
-- You can call the method, which forces the control to redraw itself and all its children. This is equivalent to setting the method to `true` and using it with .
-
- The method governs what gets painted or repainted. The method governs when the painting or repainting occurs. If you use the and methods together rather than calling , what gets repainted depends on which overload of you use. The method just forces the control to be painted immediately, but the method governs what gets painted when you call the method.
-
- For more information, see the [WM_PAINT](/windows/win32/gdi/wm-paint) topic.
-
+ method with the method.
+
+- You can call the method, which forces the control to redraw itself and all its children. This is equivalent to setting the method to `true` and using it with .
+
+ The method governs what gets painted or repainted. The method governs when the painting or repainting occurs. If you use the and methods together rather than calling , what gets repainted depends on which overload of you use. The method just forces the control to be painted immediately, but the method governs what gets painted when you call the method.
+
+ For more information, see the [WM_PAINT](/windows/win32/gdi/wm-paint) topic.
+
]]>
@@ -19680,11 +19684,11 @@ Note: This property will always return for an instance o
Updates the bounds of the control with the current size and location.
- of the control is different from the previous , the event is raised. Likewise, if the of the control changes, the event is raised.
-
+ of the control is different from the previous , the event is raised. Likewise, if the of the control changes, the event is raised.
+
]]>
@@ -19730,11 +19734,11 @@ Note: This property will always return for an instance o
The of the control.
Updates the bounds of the control with the specified size and location.
- of the control if different from the previous , the event is raised. Likewise, is the of the control changes, the event is raised.
-
+ of the control if different from the previous , the event is raised. Likewise, is the of the control changes, the event is raised.
+
]]>
@@ -19784,11 +19788,11 @@ Note: This property will always return for an instance o
The client of the control.
Updates the bounds of the control with the specified size, location, and client size.
- of the control is different from the previous , the event is raised. Likewise, if the of the control changes, the event is raised.
-
+ of the control is different from the previous , the event is raised. Likewise, if the of the control changes, the event is raised.
+
]]>
@@ -19826,22 +19830,22 @@ Note: This property will always return for an instance o
Forces the assigned styles to be reapplied to the control.
- method to get the styles to apply. The styles assigned to the and properties of the assigned to the control's property are reapplied. The control is repainted to reflect the style changes if necessary.
-
- The method has no effect if the property value is `false`.
-
-
-
-## Examples
- The following code example enables double-buffering on a and updates the styles to reflect the changes.
-
+ method to get the styles to apply. The styles assigned to the and properties of the assigned to the control's property are reapplied. The control is repainted to reflect the style changes if necessary.
+
+ The method has no effect if the property value is `false`.
+
+
+
+## Examples
+ The following code example enables double-buffering on a and updates the styles to reflect the changes.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/CPP/controlmembers6.cpp" id="Snippet3":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CanFocus/controlmembers6.cs" id="Snippet3":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet3":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.ControlMembers6/VB/controlmembers6.vb" id="Snippet3":::
+
]]>
@@ -19877,11 +19881,11 @@ Note: This property will always return for an instance o
Updates the control in its parent's z-order.
- method updates the position of the control in its parent control's z-order. For example, if this control is a newly created control that was added to a , the z-order is updated with the new control added to the back.
-
+ method updates the position of the control in its parent control's z-order. For example, if this control is a newly created control that was added to a , the z-order is updated with the new control added to the back.
+
]]>
@@ -19929,11 +19933,11 @@ Note: This property will always return for an instance o
to use the wait cursor for the current control and all child controls; otherwise, . The default is .
- property.
-
+ property.
+
]]>
@@ -19962,55 +19966,55 @@ Note: This property will always return for an instance o
Occurs when the control is finished validating.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
- If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
+ If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/winmsg/wm-activateapp) topic, and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) topic.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. This example requires that a and control have been created on a form.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the [WM_KILLFOCUS](/windows/win32/winmsg/wm-activateapp) topic, and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) topic.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. This example requires that a and control have been created on a form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Validating/CPP/validating.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CausesValidation/validating.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet1":::
+
]]>
@@ -20042,55 +20046,55 @@ Note: This property will always return for an instance o
Occurs when the control is validating.
- or methods, or by setting the property to the current form, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
-
-1.
-
-2.
-
-3.
-
-4.
-
-5.
-
-6.
-
- If the property is set to `false`, the and events are suppressed.
-
- If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
-
+ or methods, or by setting the property to the current form, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ When you change the focus by using the mouse or by calling the method, focus events occur in the following order:
+
+1.
+
+2.
+
+3.
+
+4.
+
+5.
+
+6.
+
+ If the property is set to `false`, the and events are suppressed.
+
+ If the property of the is set to `true` in the event delegate, all events that would usually occur after the event are suppressed.
+
> [!CAUTION]
-> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the `WM_KILLFOCUS` topic in the "Keyboard Input Reference" section, and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) article.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. This example requires that a and control have been created on a form.
-
+> Do not attempt to set focus from within the , , , , , or event handlers. Doing so can cause your application or the operating system to stop responding. For more information, see the `WM_KILLFOCUS` topic in the "Keyboard Input Reference" section, and the "Message Deadlocks" section of the [About Messages and Message Queues](/windows/win32/winmsg/about-messages-and-message-queues) article.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example uses the derived class and validates an email address that the user enters. If the email address is not in the standard format (containing "@" and "."), the validation fails, an icon is displayed, and the event is canceled. This example requires that a and control have been created on a form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control.Validating/CPP/validating.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/CausesValidation/validating.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control.Validating/VB/validating.vb" id="Snippet1":::
+
]]>
@@ -20137,22 +20141,22 @@ Note: This property will always return for an instance o
to display the control and its child controls; otherwise, . The default is . When getting the value, is returned only if the control is visible and the parent control, if it exists, is visible.
- and and sets their property values, based on the size of an being displayed in a control. This example requires that a has been created on a form and that and controls have been created on the . This code should be called when the image is loaded into the picture box and by the event of the form.
-
+
+## Examples
+ The following code example uses the derived classes and and sets their property values, based on the size of an being displayed in a control. This example requires that a has been created on a form and that and controls have been created on the . This code should be called when the image is loaded into the picture box and by the event of the form.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Control.Visible Example/CPP/source.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Visible/source.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.Visible Example/VB/source.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Control.Visible Example/VB/source.vb" id="Snippet1":::
+
]]>
@@ -20186,22 +20190,22 @@ If you set `Visible` to `true`:
Occurs when the property value changes.
- property is changed by either a programmatic modification or user interaction.
-
- For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
-
-
-
-## Examples
- The following code example raises the event when the property value of the control has changed.
-
+ property is changed by either a programmatic modification or user interaction.
+
+ For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/).
+
+
+
+## Examples
+ The following code example raises the event when the property value of the control has changed.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Control_VisibleChanged/CPP/control_visiblechanged.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/VisibleChanged/control_visiblechanged.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_VisibleChanged/VB/control_visiblechanged.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Control_VisibleChanged/VB/control_visiblechanged.vb" id="Snippet1":::
+
]]>
@@ -20250,20 +20254,20 @@ If you set `Visible` to `true`:
Gets or sets the width of the control.
The width of the control in pixels.
- and property values cause the property value of the control to change.
-
-
-
-## Examples
- The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
-
+ and property values cause the property value of the control to change.
+
+
+
+## Examples
+ The following code example creates three controls on a form and sets their size and location by using the various size-related and location-related properties. This example requires that you have a that has a width and height of at least 300 pixels.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/CPP/controlsizelocation.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Control/Bounds/controlsizelocation.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.Control SizeLocation/VB/controlsizelocation.vb" id="Snippet1":::
+
]]>
@@ -20310,11 +20314,11 @@ If you set `Visible` to `true`:
This property is not relevant for this class.
The NativeWindow contained within the control.
-
@@ -20346,22 +20350,22 @@ If you set `Visible` to `true`:
The Windows to process.
Processes Windows messages.
- method after getting filtered through the method.
-
- The method corresponds exactly to the Windows `WindowProc` function. For more information about processing Windows messages, see the [WindowProc function](https://go.microsoft.com/fwlink/?LinkId=181565).
-
-
-
-## Examples
- The following code example demonstrates overriding the method to handle operating system messages identified in the structure. The [WM_ACTIVATEAPP](/windows/win32/winmsg/wm-activateapp) operating system message is handled in this example to know when another application is becoming active. See the following topics to understand the available , , and values. Actual constant values can be found in the Windows.h header file.
-
+ method after getting filtered through the method.
+
+ The method corresponds exactly to the Windows `WindowProc` function. For more information about processing Windows messages, see the [WindowProc function](https://go.microsoft.com/fwlink/?LinkId=181565).
+
+
+
+## Examples
+ The following code example demonstrates overriding the method to handle operating system messages identified in the structure. The [WM_ACTIVATEAPP](/windows/win32/winmsg/wm-activateapp) operating system message is handled in this example to know when another application is becoming active. See the following topics to understand the available , , and values. Actual constant values can be found in the Windows.h header file.
+
:::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/CPP/form1.cpp" id="Snippet1":::
:::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox/WndProc/form1.cs" id="Snippet1":::
- :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1":::
-
+ :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Control.WndProc/VB/form1.vb" id="Snippet1":::
+
]]>
diff --git a/xml/System.Windows.Forms/DragEventArgs.xml b/xml/System.Windows.Forms/DragEventArgs.xml
index e9781648eba..ae1f375b3ec 100644
--- a/xml/System.Windows.Forms/DragEventArgs.xml
+++ b/xml/System.Windows.Forms/DragEventArgs.xml
@@ -150,7 +150,7 @@
To be added.
To be added.
To be added.
- To be added.
+ Initializes a new instance of the class.
To be added.
@@ -287,7 +287,7 @@
System.Windows.Forms.DropImageType
- To be added.
+ Gets or sets the drop description image type.
To be added.
To be added.
@@ -440,9 +440,12 @@
System.String
- To be added.
+ Gets or sets the drop description text, such as "Move to %1".
To be added.
- To be added.
+
+ UI coloring is applied to the text in if used by specifying %1 in .
+
+
@@ -461,9 +464,12 @@
System.String
- To be added.
+ Gets or sets the drop description text, such as "Documents", when %1 is specified in .
To be added.
- To be added.
+
+ UI coloring is applied to the text in if used by specifying %1 in .
+
+
diff --git a/xml/System.Windows.Forms/DropImageType.xml b/xml/System.Windows.Forms/DropImageType.xml
index 69e2a13c8f9..9a59708be62 100644
--- a/xml/System.Windows.Forms/DropImageType.xml
+++ b/xml/System.Windows.Forms/DropImageType.xml
@@ -13,7 +13,7 @@
System.Enum
- To be added.
+ Specifies the drop description image type.
To be added.
@@ -34,7 +34,7 @@
1
- To be added.
+ A plus sign (+) that indicates a copy operation.
@@ -54,7 +54,7 @@
-1
- To be added.
+ No drop image preference; use the default image.
@@ -74,7 +74,7 @@
6
- To be added.
+ A tag icon that indicates that the metadata will be changed.
@@ -94,7 +94,7 @@
4
- To be added.
+ An arrow that indicates a link.
@@ -114,7 +114,7 @@
2
- To be added.
+ An arrow that indicates a move operation.
@@ -134,7 +134,7 @@
8
- To be added.
+ Windows 7 and later. Use no drop image.
@@ -154,7 +154,7 @@
0
- To be added.
+ A red bisected circle such as that found on a "no smoking" sign.
@@ -174,7 +174,7 @@
7
- To be added.
+ A yellow exclamation mark that indicates that a problem has been encountered in the operation.
diff --git a/xml/System.Windows.Forms/ErrorProvider.xml b/xml/System.Windows.Forms/ErrorProvider.xml
index 60038d34745..fc46734d795 100644
--- a/xml/System.Windows.Forms/ErrorProvider.xml
+++ b/xml/System.Windows.Forms/ErrorProvider.xml
@@ -789,7 +789,7 @@
System.Boolean
- To be added.
+ Gets a value that indicates if this has any errors for any of the associated controls.
To be added.
To be added.
diff --git a/xml/System.Windows.Forms/FileDialog.xml b/xml/System.Windows.Forms/FileDialog.xml
index e9b36209282..669b699dcd2 100644
--- a/xml/System.Windows.Forms/FileDialog.xml
+++ b/xml/System.Windows.Forms/FileDialog.xml
@@ -157,7 +157,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box adds the file being opened or saved to the recent list.
To be added.
To be added.
@@ -941,9 +941,9 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the OK button of the dialog box is disabled until the user navigates the view or edits the filename (if applicable).
To be added.
- To be added.
+ Note: Disabling of the OK button does not prevent the dialog from being submitted by the Enter key.
@@ -1197,7 +1197,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box displays hidden and system files.
To be added.
To be added.
@@ -1224,7 +1224,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the items shown by default in the view's navigation pane are shown.
To be added.
To be added.
diff --git a/xml/System.Windows.Forms/FolderBrowserDialog.xml b/xml/System.Windows.Forms/FolderBrowserDialog.xml
index 72969055ebd..f353865e95f 100644
--- a/xml/System.Windows.Forms/FolderBrowserDialog.xml
+++ b/xml/System.Windows.Forms/FolderBrowserDialog.xml
@@ -136,7 +136,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box adds the folder being selected to the recent list.
To be added.
To be added.
@@ -363,9 +363,10 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the OK button of the dialog box is disabled until the user navigates the view or edits the filename (if applicable).
To be added.
- To be added.
+ Note: Disabling of the OK button does not prevent the dialog from being submitted by the Enter key.
+
@@ -604,7 +605,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box displays hidden and system files.
To be added.
To be added.
@@ -699,7 +700,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the items shown by default in the view's navigation pane are shown.
To be added.
To be added.
diff --git a/xml/System.Windows.Forms/Form.xml b/xml/System.Windows.Forms/Form.xml
index 5af678b4779..578b0d82158 100644
--- a/xml/System.Windows.Forms/Form.xml
+++ b/xml/System.Windows.Forms/Form.xml
@@ -6389,10 +6389,11 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another
- To be added.
- To be added.
- To be added.
- To be added.
+ The scale factor to be applied on the width of the property being scaled.
+ The scale factor to be applied on the height of the property being scaled.
+
+ to resize the Form along with properties being scaled; otherwise, .
+ Scales the size of the form's and properties with the scale factor provided.
To be added.
diff --git a/xml/System.Windows.Forms/GiveFeedbackEventArgs.xml b/xml/System.Windows.Forms/GiveFeedbackEventArgs.xml
index 16a3d88832b..01c278fe49f 100644
--- a/xml/System.Windows.Forms/GiveFeedbackEventArgs.xml
+++ b/xml/System.Windows.Forms/GiveFeedbackEventArgs.xml
@@ -115,7 +115,7 @@
To be added.
To be added.
To be added.
- To be added.
+ Initializes a new instance of the class.
To be added.
@@ -135,9 +135,12 @@
System.Drawing.Point
- To be added.
+ Gets or sets the drag image cursor offset.
To be added.
- To be added.
+
+ Specifies the location of the cursor within , which is an offset from the upper-left corner.
+
+
@@ -156,9 +159,12 @@
System.Drawing.Bitmap
- To be added.
+ Gets or sets the drag image bitmap.
To be added.
- To be added.
+
+ Note the outer edges of are blended out if the image width or height exceeds 300 pixels.
+
+
@@ -289,8 +295,9 @@
System.Boolean
- To be added.
- To be added.
+ Gets or sets a value indicating whether a layered window drag image is used.
+
+ for to use a layered window drag image with a size of 96x96; otherwise .
To be added.
diff --git a/xml/System.Windows.Forms/OpenFileDialog.xml b/xml/System.Windows.Forms/OpenFileDialog.xml
index e91424ce33a..bcfa1f4f2b5 100644
--- a/xml/System.Windows.Forms/OpenFileDialog.xml
+++ b/xml/System.Windows.Forms/OpenFileDialog.xml
@@ -406,7 +406,7 @@ On a right-to-left operating system, setting the containing form's System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box allows selection of read-only files.
To be added.
To be added.
@@ -433,7 +433,7 @@ On a right-to-left operating system, setting the containing form's System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box shows a preview for selected files.
To be added.
To be added.
diff --git a/xml/System.Windows.Forms/Panel.xml b/xml/System.Windows.Forms/Panel.xml
index e74d1f70857..ef176a691e1 100644
--- a/xml/System.Windows.Forms/Panel.xml
+++ b/xml/System.Windows.Forms/Panel.xml
@@ -306,8 +306,10 @@
- To be added.
- To be added.
+ Creates a new AccessibleObject for this instance.
+ The AccessibleObject instance returned by this method supports ControlType UIA property.
+
+ for this instance.
To be added.
diff --git a/xml/System.Windows.Forms/SaveFileDialog.xml b/xml/System.Windows.Forms/SaveFileDialog.xml
index 71e045c627b..ac5177a6a4f 100644
--- a/xml/System.Windows.Forms/SaveFileDialog.xml
+++ b/xml/System.Windows.Forms/SaveFileDialog.xml
@@ -114,7 +114,8 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box verifies if the creation of the specified file will be successful.
+ If this flag is not set, the calling application must handle errors, such as denial of access, that are discovered when the item is created.
To be added.
To be added.
@@ -187,7 +188,7 @@
System.Boolean
- To be added.
+ Gets or sets a value indicating whether the dialog box is always opened in the expanded mode.
To be added.
To be added.
diff --git a/xml/System.Windows.Forms/TaskDialogButton.xml b/xml/System.Windows.Forms/TaskDialogButton.xml
index 81c2d11810b..f599c24cac8 100644
--- a/xml/System.Windows.Forms/TaskDialogButton.xml
+++ b/xml/System.Windows.Forms/TaskDialogButton.xml
@@ -1,23 +1,23 @@
-
-
-
-
-
-
-
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogControl
-
-
-
- Represents a button control of a task dialog.
-
+
+
+
+
+
+
+
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogControl
+
+
+
+ Represents a button control of a task dialog.
+
[!NOTE]
> It's not possible to show both custom buttons and command links ( instances) at the same time - it's only one or the other. In either case, you can combine them with standard buttons.
- ]]>
-
-
-
-
-
-
-
-
-
- Constructor
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
-
- Initializes a new instance of the class.
- To be added.
-
-
-
-
-
-
-
-
- Constructor
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
-
-
-
-
-
- The text of the control.
- A value that indicates if the button should be enabled.
- A value that indicates whether the task dialog should close when this button is clicked.
- Initializes a new instance of the class using the given text and, optionally, a description text.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Abort button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
- Gets or sets a value that indicates whether the task dialog should close when this button is clicked. Or, if this button is the button, indicates whether the should be raised.
-
- if the task dialog should close when this button is clicked; otherwise, . The default value is .
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Cancel button.
- To be added.
-
+ ]]>
+
+
+
+
+
+
+
+
+
+ Constructor
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+
+ Initializes a new instance of the class.
+ To be added.
+
+
+
+
+
+
+
+
+ Constructor
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+
+
+
+
+
+ The text of the control.
+ A value that indicates if the button should be enabled.
+ A value that indicates whether the task dialog should close when this button is clicked.
+ Initializes a new instance of the class using the given text and, optionally, a description text.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Abort button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+ Gets or sets a value that indicates whether the task dialog should close when this button is clicked. Or, if this button is the button, indicates whether the should be raised.
+
+ if the task dialog should close when this button is clicked; otherwise, . The default value is .
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Cancel button.
+ To be added.
+
).
- ]]>
-
-
-
-
-
-
-
-
-
-
- Event
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.EventHandler
-
-
- Occurs when the button is clicked.
-
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Event
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.EventHandler
+
+
+ Occurs when the button is clicked.
+
property to `false`.
- ]]>
-
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Close button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Continue button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
- Gets or sets a value indicating whether the button can respond to user interaction.
-
- if the button can respond to user interaction; otherwise, . The default value is .
-
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Close button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Continue button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+ Gets or sets a value indicating whether the button can respond to user interaction.
+
+ if the button can respond to user interaction; otherwise, . The default value is .
+
-
- The property is set on a button that is currently bound to a task dialog, but the dialog has just started navigating to a different page.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Int32
-
-
-
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Help button.
- To be added.
-
+ ]]>
+
+ The property is set on a button that is currently bound to a task dialog, but the dialog has just started navigating to a different page.
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+
+
+
+ To be added.
+ To be added.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Int32
+
+
+
+ To be added.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Help button.
+ To be added.
+
event.
- ]]>
-
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Ignore button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the No button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the OK button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
-
-
-
-
- To be added.
- To be added.
- To be added.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Void
-
-
-
- Simulates a click on this button.
- To be added.
+ ]]>
+
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Ignore button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the No button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the OK button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+
+
+
+
+ To be added.
+ To be added.
+ To be added.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+
+
+
+
+ To be added.
+ To be added.
+ To be added.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Void
+
+
+
+ Simulates a click on this button.
+ To be added.
This button instance is not currently bound to a task dialog.
- or - The task dialog has started navigating to a new page containing this button instance, but the event has not been raised yet.
- - or - This button is currently bound to a task dialog, but the dialog has just started navigating to a different page.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Retry button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
- Gets or sets a value that indicates if the User Account Control (UAC) shield icon should be shown near the button; that is, whether the action invoked by the button requires elevation.
-
+ - or - This button is currently bound to a task dialog, but the dialog has just started navigating to a different page.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Retry button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+ Gets or sets a value that indicates if the User Account Control (UAC) shield icon should be shown near the button; that is, whether the action invoked by the button requires elevation.
+
to show the UAC shield icon; otherwise, .
- The default value is .
-
+ The default value is .
+
-
- The property is set on a button that is currently bound to a task dialog, but the dialog has just started navigating to a different page.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.String
-
-
- Gets or sets the text associated with this control.
- The text associated with this control. The default value is .
-
+ ]]>
+
+ The property is set on a button that is currently bound to a task dialog, but the dialog has just started navigating to a different page.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.String
+
+
+ Gets or sets the text associated with this control.
+ The text associated with this control. The default value is .
+
-
+ ]]>
+
The property is set and this button instance is a standard button, for which the text is provided by the OS.
- - or - The property is set and this button instance is currently bound to a task dialog.
-
-
-
-
-
-
-
-
-
- Method
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.String
-
-
-
- Returns a string that represents the current control.
- A string that contains the control text.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Try Again button.
- To be added.
- To be added.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Boolean
-
-
- Gets or sets a value that indicates if this should be shown when displaying the task dialog.
- To be added.
-
+ - or - The property is set and this button instance is currently bound to a task dialog.
+
+
+
+
+
+
+
+
+
+ Method
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.String
+
+
+
+ Returns a string that represents the current control.
+ A string that contains the control text.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Try Again button.
+ To be added.
+ To be added.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Boolean
+
+
+ Gets or sets a value that indicates if this should be shown when displaying the task dialog.
+ To be added.
+
event (e.g. for the button when is set), or to call the method even if the button is not shown.
- ]]>
-
- The property is set and this button instance is currently bound to a task dialog.
-
-
-
-
-
-
-
-
-
- Property
-
- System.Windows.Forms
- 5.0.0.0
- 6.0.0.0
- 7.0.0.0
-
-
- System.Windows.Forms.TaskDialogButton
-
-
- Gets a standard instance representing the Yes button.
- To be added.
- To be added.
-
-
-
-
+ ]]>
+
+ The property is set and this button instance is currently bound to a task dialog.
+
+
+
+
+
+
+
+
+
+ Property
+
+ System.Windows.Forms
+ 5.0.0.0
+ 6.0.0.0
+ 7.0.0.0
+
+
+ System.Windows.Forms.TaskDialogButton
+
+
+ Gets a standard instance representing the Yes button.
+ To be added.
+ To be added.
+
+
+
+
diff --git a/xml/System.Windows.Forms/TaskDialogButtonCollection.xml b/xml/System.Windows.Forms/TaskDialogButtonCollection.xml
index fb78484137f..9f6e4652d25 100644
--- a/xml/System.Windows.Forms/TaskDialogButtonCollection.xml
+++ b/xml/System.Windows.Forms/TaskDialogButtonCollection.xml
@@ -95,6 +95,7 @@
To be added.
To be added.
This collection is currently bound to a task dialog.
+
@@ -130,6 +131,7 @@
is already a part of a different collection.
- or - This collection is currently bound to a task dialog.
+
@@ -157,6 +159,7 @@
To be added.
To be added.
This collection is currently bound to a task dialog.
+
@@ -192,6 +195,7 @@
is already a part of a different collection.
- or - This collection is currently bound to a task dialog.
+
diff --git a/xml/System.Windows.Forms/TaskDialogRadioButtonCollection.xml b/xml/System.Windows.Forms/TaskDialogRadioButtonCollection.xml
index bc6285591fb..a72e97eb627 100644
--- a/xml/System.Windows.Forms/TaskDialogRadioButtonCollection.xml
+++ b/xml/System.Windows.Forms/TaskDialogRadioButtonCollection.xml
@@ -92,6 +92,7 @@
To be added.
To be added.
This collection is currently bound to a task dialog.
+
@@ -127,6 +128,7 @@
is already a part of a different collection.
- or - This collection is currently bound to a task dialog.
+
@@ -154,6 +156,7 @@
To be added.
To be added.
This collection is currently bound to a task dialog.
+
@@ -189,6 +192,7 @@
is already a part of a different collection.
- or - This collection is currently bound to a task dialog.
+
diff --git a/xml/System.Windows.Forms/ToolStripItem.xml b/xml/System.Windows.Forms/ToolStripItem.xml
index baf4a9eb858..d79e0fcd571 100644
--- a/xml/System.Windows.Forms/ToolStripItem.xml
+++ b/xml/System.Windows.Forms/ToolStripItem.xml
@@ -1197,7 +1197,7 @@
System.Windows.Input.ICommand
- To be added.
+ Gets or sets the whose method will be called when the ToolStripItem's event is invoked.
To be added.
To be added.
@@ -1228,7 +1228,7 @@
System.EventHandler
- To be added.
+ Occurs when the status of the that's assigned to the property has changed.
To be added.
@@ -1258,7 +1258,7 @@
System.EventHandler
- To be added.
+ Occurs when the assigned of the property has changed.
To be added.
@@ -1300,7 +1300,7 @@
System.Object
- To be added.
+ Gets or sets the parameter that is passed to the that's assigned to the property.
To be added.
To be added.
@@ -1331,7 +1331,7 @@
System.EventHandler
- To be added.
+ Occurs when the value of the property has changed.
To be added.
@@ -1858,9 +1858,13 @@
To be added.
To be added.
To be added.
- To be added.
- To be added.
- To be added.
+ Begins a drag operation.
+ A value from the enumeration that represents the final effect that was performed during the drag-and-drop operation.
+
+ The parameter determines which drag operations can occur. If the drag operation needs to interop with applications in another process, should either be a base managed class (, , or ) or some that implements . can also be any that implements . is the bitmap that will be displayed during the drag operation and specifies the location of the cursor within , which is an offset from the upper-left corner. Specify for to use a layered window drag image with a size of 96x96; otherwise . Note the outer edges of are blended out if the image width or height exceeds 300 pixels.
+ Because always performs the RGB multiplication step in calculating the alpha value, you should always pass a without premultiplied alpha blending. No error will result from passing a with premultiplied alpha blending, but this method will multiply it again, doubling the resulting alpha value.
+
+
@@ -3990,8 +3994,8 @@ If you set the property, t
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -4024,8 +4028,8 @@ If you set the property, t
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -4058,8 +4062,8 @@ If you set the property, t
- To be added.
- To be added.
+ An empty instance.
+ Raises the event.
To be added.
@@ -5284,8 +5288,8 @@ If you set the property, t
- To be added.
- To be added.
+ An empty instance.
+ Called in the context of to invoke if the context allows.
To be added.
diff --git a/xml/System.Windows.Forms/TreeView.xml b/xml/System.Windows.Forms/TreeView.xml
index 02e7d61fd08..4fad1e8bd26 100644
--- a/xml/System.Windows.Forms/TreeView.xml
+++ b/xml/System.Windows.Forms/TreeView.xml
@@ -1018,8 +1018,8 @@
- To be added.
- To be added.
+ Creates the new instance of AccessibleObject for this TreeView control.
+ The AccessibleObject for this TreeView instance.
To be added.