diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml index f44f6c5ed4b..de84f800d4d 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/DirListBox.xml @@ -39,8 +39,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -69,8 +69,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -103,8 +103,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -151,8 +151,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -199,8 +199,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -249,8 +249,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -293,8 +293,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -339,8 +339,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -387,8 +387,8 @@ can be called multiple times by other objects. When you override , make sure 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. For more information about and , see Cleaning Up Unmanaged Resources and Overriding the Finalize Method. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -431,8 +431,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -479,8 +479,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -527,8 +527,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -576,8 +576,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -623,8 +623,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -665,8 +665,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -712,8 +712,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -755,8 +755,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -798,8 +798,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -841,8 +841,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -884,8 +884,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -944,8 +944,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -981,8 +981,8 @@ When you override in a derived class, make sure to call the method so the control and its child controls are invalidated and redrawn. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -1029,8 +1029,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -1078,8 +1078,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -1126,8 +1126,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml index 311fd98103c..42682c9f4c1 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/DriveListBox.xml @@ -39,8 +39,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -69,8 +69,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -117,8 +117,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -165,8 +165,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -209,8 +209,8 @@ can be called multiple times by other objects. When you override , make sure 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. For more information about and , see Cleaning Up Unmanaged Resources and Overriding the Finalize Method. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -253,8 +253,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -301,8 +301,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -351,8 +351,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -395,8 +395,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -452,8 +452,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -500,8 +500,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -548,8 +548,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -591,8 +591,8 @@ When you override in a derived class, be sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -634,8 +634,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -677,8 +677,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -720,8 +720,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -763,8 +763,8 @@ When overriding in a derived class, make sure to call the method of the base class so that registered delegates receive the event. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -804,8 +804,8 @@ When you override in a derived class, make sure to call the method so the control and its child controls are invalidated and redrawn. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -853,8 +853,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -901,8 +901,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -949,8 +949,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -992,8 +992,8 @@ Inheriting controls should call the method for the base class to process any messages that they do not handle. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml index 2a9917ece6d..11b0505ed4f 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/FileListBox.xml @@ -38,8 +38,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -67,8 +67,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -111,8 +111,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -158,8 +158,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -205,8 +205,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -252,8 +252,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -296,8 +296,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -340,8 +340,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -396,8 +396,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -443,8 +443,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -487,8 +487,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -530,8 +530,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -568,8 +568,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -606,8 +606,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -645,8 +645,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -706,8 +706,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -739,8 +739,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -790,8 +790,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -823,8 +823,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -870,8 +870,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -905,8 +905,8 @@ When you override in a derived class, make sure to call the method of the base class so the control and its child controls are invalidated and redrawn. - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -953,8 +953,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -997,8 +997,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) @@ -1044,8 +1044,8 @@ ]]> - SaveFileDialog Component Overview (Windows Forms) - OpenFileDialog Component Overview (Windows Forms) + SaveFileDialog Component Overview (Windows Forms) + OpenFileDialog Component Overview (Windows Forms) diff --git a/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml b/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml index efd7893d49d..91a8db5706e 100644 --- a/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml +++ b/xml/Microsoft.VisualBasic.Compatibility.VB6/Support.xml @@ -27,15 +27,15 @@ Contains various utility functions for backward compatibility with Visual Basic 6.0. - @@ -70,15 +70,15 @@ Duplicates Visual Basic 6.0 functionality of assigning an to a . The array to copy. - , or methods of the class. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + , or methods of the class. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -113,15 +113,15 @@ Returns an OLE object that corresponds to the specified . An that represents the OLE object. - to a `stdOle.IPicture`. - - To convert a in Visual Basic, use the method of the class. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + to a `stdOle.IPicture`. + + To convert a in Visual Basic, use the method of the class. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -168,22 +168,22 @@ if the two expressions are equal; otherwise . - = Operator (Visual Basic) @@ -221,22 +221,22 @@ Performs a logical equivalence on two expressions. A that contains the result of the bitwise comparison. - Not Operator (Visual Basic) @@ -275,13 +275,13 @@ Performs a logical equivalence on two expressions. A that contains the result of the comparison. - Not Operator (Visual Basic) @@ -320,13 +320,13 @@ Performs a logical equivalence on two expressions. A that contains the result of the comparison. - Not Operator (Visual Basic) @@ -365,13 +365,13 @@ Performs a logical equivalence on two expressions. A that contains the result of the comparison. - Not Operator (Visual Basic) @@ -410,13 +410,13 @@ Performs a logical equivalence on two expressions. A that contains the result of the comparison. - Not Operator (Visual Basic) @@ -460,13 +460,13 @@ Changes the style bit for a font. A with the new style applied. - enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -503,13 +503,13 @@ Returns a font for a specified GDI character set. A for the specified GDI character set. - constructor. This function is used by the upgrade tools to convert a `stdFont` to a . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + constructor. This function is used by the upgrade tools to convert a `stdFont` to a . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -552,13 +552,13 @@ Changes the style bit for a font. A with the new style applied. - enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -595,13 +595,13 @@ Returns a new for a given Visual Basic 6.0 . A that matches the Visual Basic 6.0 . - is a property of the object. This function is used by the upgrade tools to convert a Visual Basic 6.0 `Font` to a . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + is a property of the object. This function is used by the upgrade tools to convert a Visual Basic 6.0 `Font` to a . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -638,13 +638,13 @@ Changes the property for a font. A that matches the Visual Basic 6.0 . - is a property of the object. This function is used by the upgrade tools to convert a Visual Basic 6.0 `Font` to a . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + is a property of the object. This function is used by the upgrade tools to convert a Visual Basic 6.0 `Font` to a . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -686,13 +686,13 @@ Changes the style bit for a font. A with the new style applied. - enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -734,13 +734,13 @@ Changes the style bit for a font. A with the new style applied. - enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + enumeration. This function is used by the upgrade tools to translate the Visual Basic 6.0 properties to the new enumerations. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -775,13 +775,13 @@ Converts a to a Visual Basic 6.0 object. A object. - and a `stdFont` during project upgrade. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + and a `stdFont` during project upgrade. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -821,13 +821,13 @@ Converts the Visual Basic 6.0 function to be compatible with Visual Basic. A that contains the formatted data. - @@ -866,13 +866,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement. A that contains the converted Visual Basic 6.0 . - @@ -911,13 +911,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement. A that contains the converted Visual Basic 6.0 . - @@ -958,13 +958,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement. A that contains the converted Visual Basic 6.0 . - @@ -1005,13 +1005,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement. A that contains the converted Visual Basic 6.0 . - @@ -1048,13 +1048,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement for a given . A that contains the Visual Basic 6.0 value for the specified . - @@ -1091,13 +1091,13 @@ Converts a pixel measurement to a Visual Basic 6.0 measurement for a given . A that contains the Visual Basic 6.0 value for the specified . - @@ -1129,13 +1129,13 @@ Gets the control that currently has focus. The control that currently has focus. - in Visual Basic. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + in Visual Basic. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1171,13 +1171,13 @@ if is the cancel button; otherwise . - property of a . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + property of a . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1213,13 +1213,13 @@ if is the default button; otherwise . - property of a . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + property of a . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1251,11 +1251,11 @@ Gets the name of the executable file (.exe) for the current application. A that contains the name without a file name extension. - @@ -1287,13 +1287,13 @@ Gets the instance handle (HINSTANCE) for the current application. An for the current application instance. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1330,13 +1330,13 @@ Gets an associated with a or item. The associated with the specified . - methods can be used to emulate the behavior of `ItemData`. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + methods can be used to emulate the behavior of `ItemData`. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1373,13 +1373,13 @@ Gets a associated with a or item. The associated with the specified . - or property instead. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + or property instead. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1411,11 +1411,11 @@ Gets the current path for the application. A that contains the path of the currently executing assembly. - @@ -1450,13 +1450,13 @@ Gets an OLE object for a given . An representing the OLE object. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1491,13 +1491,13 @@ Converts a Visual Basic 6.0 object to a . A specified object to convert. - and a `stdFont` during project upgrade. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + and a `stdFont` during project upgrade. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1532,13 +1532,13 @@ Gets an OLE object for a given . An representing the OLE object. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1573,13 +1573,13 @@ Gets an OLE object for a given . An representing the OLE object. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1625,15 +1625,15 @@ Performs a logical implication on two expressions. A that contains the result. - Not Operator (Visual Basic) @@ -1672,15 +1672,15 @@ Performs a logical implication on two expressions. A that contains the result. - Not Operator (Visual Basic) @@ -1719,15 +1719,15 @@ Performs a logical implication on two expressions. A that contains the result. - Not Operator (Visual Basic) @@ -1766,15 +1766,15 @@ Performs a logical implication on two expressions. An that contains the result. - Not Operator (Visual Basic) @@ -1813,15 +1813,15 @@ Performs a logical implication on two expressions. A that contains the result. - Not Operator (Visual Basic) @@ -1860,15 +1860,15 @@ Performs a logical implication on two expressions. An that contains the result. - . - - In Visual Basic, use `Not` and `XOr` to replace `Imp`. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + In Visual Basic, use `Not` and `XOr` to replace `Imp`. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> Not Operator (Visual Basic) @@ -1905,13 +1905,13 @@ Gets an for a given OLE object. An image object. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1946,13 +1946,13 @@ Gets an for a given OLE object. A converted object to image. - . - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + . + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -1998,18 +1998,18 @@ Loads data of several possible types from a resource (.res) file. An that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2046,18 +2046,18 @@ Loads data of several possible types from a resource (.res) file, specifying a locale. An that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2101,18 +2101,18 @@ Loads a bitmap, icon, or cursor from a resource (.res) file. An that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2149,18 +2149,18 @@ Loads a bitmap, icon, or cursor from a resource (.res) file, specifying a locale. An that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2202,18 +2202,18 @@ Loads a string from a resource (.res) file. A that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2248,18 +2248,18 @@ Loads a string from a resource (.res) file, specifying a locale. A that contains the resource. - - Globalizing Windows Forms + Globalizing Windows Forms @@ -2292,13 +2292,13 @@ Converts an X coordinate from pixels to twips. A that contains the X coordinate expressed in twips. - @@ -2333,13 +2333,13 @@ Converts a Y coordinate from pixels to twips. A that contains the Y coordinate expressed in twips. - @@ -2375,13 +2375,13 @@ to process keystrokes before control is returned to the procedure; otherwise . Sends one or more keystrokes to the active window as if typed at the keyboard. - @@ -2418,15 +2418,15 @@ if the Visual Basic 6.0 control's property is ; otherwise . Sets the property of a . - control no longer has `Default` or `Cancel` properties. The object has and properties that provide the same functionality; these properties take the name of a control as an argument. - - This function is used by the upgrade tools to set the property of a .based on the `Cancel` property of an upgraded Visual Basic 6.0 `CommandButton` control. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + control no longer has `Default` or `Cancel` properties. The object has and properties that provide the same functionality; these properties take the name of a control as an argument. + + This function is used by the upgrade tools to set the property of a .based on the `Cancel` property of an upgraded Visual Basic 6.0 `CommandButton` control. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -2463,15 +2463,15 @@ if the Visual Basic 6.0 control's property is ; otherwise . Sets the property of a . - control no longer has `Default` or `Cancel` properties. The object has and properties that provide the same functionality; these properties take the name of a control as an argument. - - This function is used by the upgrade tools to set the property of a .based on the `Default` property of an upgraded Visual Basic 6.0 `CommandButton` control. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + control no longer has `Default` or `Cancel` properties. The object has and properties that provide the same functionality; these properties take the name of a control as an argument. + + This function is used by the upgrade tools to set the property of a .based on the `Default` property of an upgraded Visual Basic 6.0 `CommandButton` control. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -2509,13 +2509,13 @@ An to assign to the property. Sets the property for a . - and `SetItemData` methods can be used to emulate the behavior of `ItemData`. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + and `SetItemData` methods can be used to emulate the behavior of `ItemData`. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -2553,13 +2553,13 @@ A to assign to the property. Sets the property for a . - or property instead. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + or property instead. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -2602,13 +2602,13 @@ A resource file (.res). Assigns the name of a Visual Basic 6.0 resource file to the current Visual Basic project namespace. - @@ -2644,13 +2644,13 @@ A resource file (.res). Assigns the name of a Visual Basic 6.0 resource file to a Visual Basic project namespace. - @@ -2687,13 +2687,13 @@ Optional. The owner parameter of the method. Displays a form by calling either the or method. - and methods. This function is used by the upgrade tools to map the Visual Basic 6.0 `Show` method to either the or method. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + and methods. This function is used by the upgrade tools to map the Visual Basic 6.0 `Show` method to either the or method. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -2735,13 +2735,13 @@ Formats strings to simulate the Visual Basic 6.0 functionality. A formatted . - @@ -2780,13 +2780,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement. A that contains the converted Visual Basic 6.0 . - @@ -2825,13 +2825,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement. A that contains the converted Visual Basic 6.0 . - @@ -2872,13 +2872,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement. A that contains the converted Visual Basic 6.0 . - @@ -2919,13 +2919,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement. A that contains the converted Visual Basic 6.0 . - @@ -2962,13 +2962,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement for a given . A that contains the pixel value for the specified . - @@ -3005,13 +3005,13 @@ Converts a Visual Basic 6.0 measurement to a pixel measurement for a given . A that contains the pixel value for the specified . - @@ -3043,13 +3043,13 @@ Gets a value that is used to convert twips to pixels based on screen settings. A that contains the conversion factor. - @@ -3081,13 +3081,13 @@ Gets a value that is used to convert twips to pixels based on screen settings. A that contains the conversion factor. - @@ -3122,13 +3122,13 @@ Converts an X coordinate from twips to pixels. A that contains the X coordinate expressed in pixels. - @@ -3163,13 +3163,13 @@ Converts a Y coordinate from twips to pixels. A that contains the Y coordinate expressed in pixels. - @@ -3203,15 +3203,15 @@ The where the control is parented. Emulates the behavior of the Visual Basic 6.0 method. - method, which returns `true` or `false`. - - This function is used by the upgrade tools to emulate the Visual Basic 6.0 behavior. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + method, which returns `true` or `false`. + + This function is used by the upgrade tools to emulate the Visual Basic 6.0 behavior. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -3245,13 +3245,13 @@ A . Displays pop-up Help for a form upgraded from Visual Basic 6.0. - property of a form. This function is used by the upgrade tools to change the method of displaying pop-up Help in an upgraded application. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + property of a form. This function is used by the upgrade tools to change the method of displaying pop-up Help in an upgraded application. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> @@ -3287,13 +3287,13 @@ A enumeration. Converts the Visual Basic method for use in Visual Basic. - and methods. This function is used by the upgrade tools to map between the methods. - - [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] - + and methods. This function is used by the upgrade tools to map between the methods. + + [!INCLUDE[Note_compatibility](~/includes/note-compatibility-md.md)] + ]]> diff --git a/xml/Microsoft.VisualBasic.Devices/Ports.xml b/xml/Microsoft.VisualBasic.Devices/Ports.xml index c8ddf7a2073..1aaf012ae6b 100644 --- a/xml/Microsoft.VisualBasic.Devices/Ports.xml +++ b/xml/Microsoft.VisualBasic.Devices/Ports.xml @@ -21,45 +21,45 @@ Provides a property and a method for accessing the computer's serial ports. - . - - The following table lists examples of tasks involving the `My.Computer.Ports` object. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to a serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| -|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + . + + The following table lists examples of tasks involving the `My.Computer.Ports` object. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to a serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| +|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> Objects (Visual Basic) @@ -132,46 +132,46 @@ Creates and opens a object. An open object, configured with the supplied arguments. - object. The arguments to the `OpenSerialPort` method determine the settings of the object. - - Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. - - The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + object. The arguments to the `OpenSerialPort` method determine the settings of the object. + + Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. + + The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> @@ -215,46 +215,46 @@ Creates and opens a object. An open object, configured with the supplied arguments. - object. The arguments to the `OpenSerialPort` method determine the settings of the object. - - Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. - - The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + object. The arguments to the `OpenSerialPort` method determine the settings of the object. + + Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. + + The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> @@ -303,46 +303,46 @@ Creates and opens a object. An open object, configured with the supplied arguments. - object. The arguments to the `OpenSerialPort` method determine the settings of the object. - - Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. - - The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + object. The arguments to the `OpenSerialPort` method determine the settings of the object. + + Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. + + The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> @@ -396,46 +396,46 @@ Creates and opens a object. An open object, configured with the supplied arguments. - object. The arguments to the `OpenSerialPort` method determine the settings of the object. - - Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. - - The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + object. The arguments to the `OpenSerialPort` method determine the settings of the object. + + Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. + + The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> @@ -492,46 +492,46 @@ Creates and opens a object. An open object, configured with the supplied arguments. - object. The arguments to the `OpenSerialPort` method determine the settings of the object. - - Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. - - The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. - -|To|See| -|-|-| -|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| -|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| -|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| - -## Availability by Project Type - -|Project type|Available| -|-|-| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example describes how to send strings to the computer's `COM1` serial port. - - The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. - - The method sends the data to the serial port. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: - - For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). - + object. The arguments to the `OpenSerialPort` method determine the settings of the object. + + Your code should close the object when it is finished using the object. You can use the method to close the object explicitly or the `Using` statement to close it implicitly. See the example in this topic for more information. + + The following table lists examples of tasks involving the `My.Computer.Ports.OpenSerialPort` method. + +|To|See| +|-|-| +|Dial a modem attached to a serial port|[How to: Dial Modems Attached to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-dial-modems-attached-to-serial-ports)| +|Send a string to serial port|[How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports)| +|Receive strings from a serial port|[How to: Receive Strings From Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-receive-strings-from-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example describes how to send strings to the computer's `COM1` serial port. + + The `Using` block allows the application to close the serial port even if it generates an exception. All code that manipulates the serial port should appear within this block, or within a `Try...Catch...Finally` block with a call to use the method. + + The method sends the data to the serial port. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet33"::: + + For more information, see [How to: Send Strings to Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-send-strings-to-serial-ports). + ]]> @@ -571,46 +571,46 @@ Gets a collection of the names of the serial ports on the computer. A collection of the names of the serial ports on the computer. - control. For more information, see [ListBox Control](/dotnet/framework/winforms/controls/listbox-control-windows-forms). - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet45"::: - - This example requires: - -- A reference to the namespace. - -- That your form have a control named `ListBox1`. - - For more information, see [How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports). - + + The following table lists an example of a task involving the `My.Computer.Ports.SerialPortNames` property. + +|To|See| +|-|-| +|Show available serial ports|[How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports)| + +## Availability by Project Type + +|Project type|Available| +|-|-| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example loops over all the strings that the `My.Computer.Ports.SerialPortNames` property returns. These strings are the names of the available serial ports on the computer. + + Typically, a user selects which serial port the application should use from the list of available ports. In this example, the serial port names are stored in a control. For more information, see [ListBox Control](/dotnet/desktop/winforms/controls/listbox-control-windows-forms). + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbalrMyComputer/VB/Class2.vb" id="Snippet45"::: + + This example requires: + +- A reference to the namespace. + +- That your form have a control named `ListBox1`. + + For more information, see [How to: Show Available Serial Ports](/dotnet/visual-basic/developing-apps/programming/computer-resources/how-to-show-available-serial-ports). + ]]> diff --git a/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml b/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml index 83d991c7989..9ab1cbf19e2 100644 --- a/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml +++ b/xml/Microsoft.VisualBasic.MyServices/ClipboardProxy.xml @@ -36,42 +36,42 @@ Provides methods for manipulating the Clipboard. - . When an item is moved or copied to the Clipboard, items in other formats are cleared. To make other formats persist, use , which copies everything existing on the current Clipboard, including items pasted from other applications. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. - - Because all Windows applications share the system Clipboard, the contents may change when you switch to another application. - - A class must be serializable for it to be put on the Clipboard. For more information, see [Serialization - C#](/dotnet/csharp/programming-guide/concepts/serialization/) or [Serialization - Visual Basic](/dotnet/visual-basic/programming-guide/concepts/serialization/). - - When accessing the Clipboard remotely, a is thrown unless the accessing thread operates in STA (single-threaded apartment) mode. To resolve this issue, set the `ThreadApartmentState` to `STA`. For more information, see . - - For more information, see [Storing Data to and Reading from the Clipboard](/dotnet/visual-basic/developing-apps/programming/computer-resources/storing-data-to-and-reading-from-the-clipboard). - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example will fail if there is no text on the Clipboard. - + . When an item is moved or copied to the Clipboard, items in other formats are cleared. To make other formats persist, use , which copies everything existing on the current Clipboard, including items pasted from other applications. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. + + Because all Windows applications share the system Clipboard, the contents may change when you switch to another application. + + A class must be serializable for it to be put on the Clipboard. For more information, see [Serialization - C#](/dotnet/csharp/programming-guide/concepts/serialization/) or [Serialization - Visual Basic](/dotnet/visual-basic/programming-guide/concepts/serialization/). + + When accessing the Clipboard remotely, a is thrown unless the accessing thread operates in STA (single-threaded apartment) mode. To resolve this issue, set the `ThreadApartmentState` to `STA`. For more information, see . + + For more information, see [Storing Data to and Reading from the Clipboard](/dotnet/visual-basic/developing-apps/programming/computer-resources/storing-data-to-and-reading-from-the-clipboard). + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example will fail if there is no text on the Clipboard. + ]]> @@ -108,34 +108,34 @@ Clears the Clipboard. - class controls access to the Clipboard, and the associated enumeration value indicates the level of access. For more information, see [Additional Security Considerations in Windows Forms](/dotnet/framework/winforms/additional-security-considerations-in-windows-forms). - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example clears the Clipboard. - -``` -My.Computer.Clipboard.Clear() -``` - - This removes all data from the Clipboard. - + class controls access to the Clipboard, and the associated enumeration value indicates the level of access. For more information, see [Additional Security Considerations in Windows Forms](/dotnet/desktop/winforms/additional-security-considerations-in-windows-forms). + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example clears the Clipboard. + +``` +My.Computer.Clipboard.Clear() +``` + + This removes all data from the Clipboard. + ]]> @@ -175,29 +175,29 @@ My.Computer.Clipboard.Clear() if audio data is stored on the Clipboard; otherwise . - @@ -243,32 +243,32 @@ My.Computer.Clipboard.Clear() if data in the specified custom format is stored on the Clipboard; otherwise . - @@ -312,32 +312,32 @@ My.Computer.Clipboard.Clear() if a file drop list is stored on the Clipboard; otherwise . - @@ -379,31 +379,31 @@ My.Computer.Clipboard.Clear() if an image is stored on the Clipboard; otherwise . - @@ -454,30 +454,30 @@ My.Computer.Clipboard.Clear() if the Clipboard contains text; otherwise . - , , and . - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: - + , , and . + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: + ]]> @@ -524,30 +524,30 @@ My.Computer.Clipboard.Clear() if the Clipboard contains text; otherwise . - , , and . - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: - + , , and . + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example determines if HTML text is stored on the Clipboard and reads from the Clipboard if it does. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet5"::: + ]]> @@ -589,29 +589,29 @@ My.Computer.Clipboard.Clear() Retrieves an audio stream from the Clipboard. A object containing audio data or if the Clipboard does not contain any audio data. - @@ -663,31 +663,31 @@ My.Computer.Clipboard.Clear() Retrieves data in a custom format from the Clipboard. An representing the Clipboard data or if the Clipboard does not contain any data that is in the specified format or can be converted to that format. - @@ -736,32 +736,32 @@ My.Computer.Clipboard.Clear() Retrieves data from the Clipboard as an . An object that represents the data currently on the Clipboard, or if there is no data on the Clipboard. - and then writes it to a file. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet1"::: - - Replace `C:\mylogfile` with the name of the file to which you want to write. - + and then writes it to a file. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet1"::: + + Replace `C:\mylogfile` with the name of the file to which you want to write. + ]]> @@ -805,34 +805,34 @@ My.Computer.Clipboard.Clear() Retrieves a collection of strings representing file names from the Clipboard. A containing file names or if the Clipboard does not contain any data that is in the format or can be converted to that format. - @@ -874,31 +874,31 @@ My.Computer.Clipboard.Clear() Retrieves an image from the Clipboard. An representing the Clipboard image data or if the Clipboard does not contain any data that is in the format or can be converted to that format. - @@ -949,32 +949,32 @@ My.Computer.Clipboard.Clear() Retrieves text from the Clipboard. The Clipboard text data or an empty string if the Clipboard does not contain data in the or format, depending on the operating system. - , , and . - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example fails if there is no text on the Clipboard. - + , , and . + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example fails if there is no text on the Clipboard. + ]]> @@ -1020,32 +1020,32 @@ My.Computer.Clipboard.Clear() Retrieves text from the Clipboard. The Clipboard text data or an empty string if the Clipboard does not contain data in the specified format. - , , and . - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example reads text from the Clipboard into the string `textOnClipboard`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: - - This example fails if there is no text on the Clipboard. - + , , and . + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example reads text from the Clipboard into the string `textOnClipboard`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet6"::: + + This example fails if there is no text on the Clipboard. + ]]> @@ -1099,34 +1099,34 @@ My.Computer.Clipboard.Clear() array. Audio data to be written to the Clipboard. Required. Writes audio data to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: - - Replace `cool.wav` with the name and path of the file you wish to read. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: + + Replace `cool.wav` with the name and path of the file you wish to read. + ]]> @@ -1170,34 +1170,34 @@ My.Computer.Clipboard.Clear() Audio data to be written to the clipboard. Required. Writes audio data to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: - - Replace `cool.wav` with the name and path of the file you wish to read. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example creates the byte array `musicReader`, reads the file `cool.wav` into it, and then writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet2"::: + + Replace `cool.wav` with the name and path of the file you wish to read. + ]]> @@ -1245,34 +1245,34 @@ My.Computer.Clipboard.Clear() . Data object to be written to the Clipboard. Required. Writes data in a custom format to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the `DataObject.dataChunk` to the Clipboard in the custom format `specialFormat`. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet7"::: - - This example depends on the existence of the custom data format `specialFormat`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the `DataObject.dataChunk` to the Clipboard in the custom format `specialFormat`. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet7"::: + + This example depends on the existence of the custom data format `specialFormat`. + ]]> @@ -1354,35 +1354,35 @@ My.Computer.Clipboard.Clear() . Data object to be written to the Clipboard. Required. Writes a to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the data object `dataChunk` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet9"::: - - This example depends on the existence of the data object `dataChunk`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the data object `dataChunk` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet9"::: + + This example depends on the existence of the data object `dataChunk`. + ]]> @@ -1428,33 +1428,33 @@ My.Computer.Clipboard.Clear() . List of file names. Required. Writes a collection of strings representing file paths to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example gets the collection of file names from **MyDocuments**, converts it to a file drop list, and writes it to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet3"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example gets the collection of file names from **MyDocuments**, converts it to a file drop list, and writes it to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbRefClipbd/VB/Class1.vb" id="Snippet3"::: + ]]> @@ -1499,34 +1499,34 @@ My.Computer.Clipboard.Clear() . Image to be written. Required. Writes an image to the Clipboard. - [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the image `coolPicture` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet8"::: - - This example depends on the existence of the image `coolPicture`. - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the image `coolPicture` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet8"::: + + This example depends on the existence of the image `coolPicture`. + ]]> @@ -1580,35 +1580,35 @@ My.Computer.Clipboard.Clear() . Text to be written. Required. Writes text to the Clipboard. - , , and . - - Previous Clipboard formats are not preserved. - + , , and . + + Previous Clipboard formats are not preserved. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the string `This is a test string.` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the string `This is a test string.` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: + ]]> @@ -1660,35 +1660,35 @@ My.Computer.Clipboard.Clear() . Format to be used when writing text. Default is . Required. Writes text to the Clipboard. - , , and . - - Previous Clipboard formats are not preserved. - + , , and . + + Previous Clipboard formats are not preserved. + > [!IMPORTANT] -> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. - -## Availability by Project Type - -|Project type|Available| -|------------------|---------------| -|Windows Application|**Yes**| -|Class Library|**Yes**| -|Console Application|**Yes**| -|Windows Control Library|**Yes**| -|Web Control Library|No| -|Windows Service|**Yes**| -|Web Site|No| - - - -## Examples - This example writes the string `This is a test string.` to the Clipboard. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: - +> Because the Clipboard can be accessed by other users, do not use it to store sensitive information, such as passwords or confidential data. + +## Availability by Project Type + +|Project type|Available| +|------------------|---------------| +|Windows Application|**Yes**| +|Class Library|**Yes**| +|Console Application|**Yes**| +|Windows Control Library|**Yes**| +|Web Control Library|No| +|Windows Service|**Yes**| +|Web Site|No| + + + +## Examples + This example writes the string `This is a test string.` to the Clipboard. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_VBCSharp/VbVbcnMyClipboard/VB/Class1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Configuration/ApplicationScopedSettingAttribute.xml b/xml/System.Configuration/ApplicationScopedSettingAttribute.xml index 70c13fd5c9b..22c771ce9e1 100644 --- a/xml/System.Configuration/ApplicationScopedSettingAttribute.xml +++ b/xml/System.Configuration/ApplicationScopedSettingAttribute.xml @@ -53,7 +53,7 @@ - Application Settings Architecture + Application Settings Architecture diff --git a/xml/System.Configuration/ApplicationSettingsBase.xml b/xml/System.Configuration/ApplicationSettingsBase.xml index 0b6c871e78c..f6e7023645c 100644 --- a/xml/System.Configuration/ApplicationSettingsBase.xml +++ b/xml/System.Configuration/ApplicationSettingsBase.xml @@ -36,58 +36,58 @@ Acts as a base class for deriving concrete wrapper classes to implement the application settings feature in Window Forms applications. - adds the following functionality to the class, which is used by Web-based applications: - -- The ability to detect attributes on a derived, settings wrapper class. supports the declarative model used for wrapper class properties, as described later. - -- Higher-level and methods. - -- Additional validation events that you can handle to ensure the correctness of individual settings. - - In the application settings architecture, to access a group of settings properties you need to derive a concrete wrapper class from . The wrapper class customizes in the following ways: - -- For every settings property to be accessed, a corresponding strongly typed public property is added to the wrapper class. This property has `get` and `set` accessors for read/write application settings, but only a `get` accessor for read-only settings. - -- Appropriated attributes must be applied to the wrapper class's public properties to indicate characteristics of the settings property, such as the setting's scope (application or user), whether the setting should support roaming, the default value for the setting, the settings provider to be used, and so on. Each property is required to specify its scope, using either or . Application-scoped settings are read-only if the default is used. - - The class uses reflection to detect these attributes at run time. Most of this information gets passed to the settings provider layer, which is responsible for storage, persistence format, and so on. - - When an application has multiple settings wrapper classes, each class defines a *settings group*. Each group has the following characteristics: - -- A group can contain any number or type of property settings. - -- If the group name is not explicitly set by the decorating the wrapper class with a , then a name is automatically generated. - - By default, all client-based applications use the to provide storage. If an alternate settings provider is desired, then the wrapper class or property must be decorated with a corresponding . - - For more information about using application settings, see [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms). - - - -## Examples - The following code example demonstrates the use of application settings to persist the following attributes of the main form: location, size, background color, and title bar text. All of these attributes are persisted as single application settings properties in the `FormSettings` class, named `FormLocation`, `FormSize`, `FormBackColor` and `FormText`, respectively. All except for `FormText` and `Size` are data bound to their associated form properties and have a default setting value applied using . - - The form contains four child controls that have the following names and functions: - -- A button named `btnBackColor` used to display the **Color** common dialog box. - -- A button named `btnReload` used to the application settings. - -- A button named `btnReset` used to the application settings. - -- A textbox named `tbStatus` used to display status information about the program. - - Notice that after every execution of the application, an additional period character is appended to the title text of the form. - - This code example requires a Form with a class named `colorDialog1`, and a control with a named `tbStatus`. Additionally, it requires three objects named `btnReload`, `btnReset`, and `btnBackColor`. - + adds the following functionality to the class, which is used by Web-based applications: + +- The ability to detect attributes on a derived, settings wrapper class. supports the declarative model used for wrapper class properties, as described later. + +- Higher-level and methods. + +- Additional validation events that you can handle to ensure the correctness of individual settings. + + In the application settings architecture, to access a group of settings properties you need to derive a concrete wrapper class from . The wrapper class customizes in the following ways: + +- For every settings property to be accessed, a corresponding strongly typed public property is added to the wrapper class. This property has `get` and `set` accessors for read/write application settings, but only a `get` accessor for read-only settings. + +- Appropriated attributes must be applied to the wrapper class's public properties to indicate characteristics of the settings property, such as the setting's scope (application or user), whether the setting should support roaming, the default value for the setting, the settings provider to be used, and so on. Each property is required to specify its scope, using either or . Application-scoped settings are read-only if the default is used. + + The class uses reflection to detect these attributes at run time. Most of this information gets passed to the settings provider layer, which is responsible for storage, persistence format, and so on. + + When an application has multiple settings wrapper classes, each class defines a *settings group*. Each group has the following characteristics: + +- A group can contain any number or type of property settings. + +- If the group name is not explicitly set by the decorating the wrapper class with a , then a name is automatically generated. + + By default, all client-based applications use the to provide storage. If an alternate settings provider is desired, then the wrapper class or property must be decorated with a corresponding . + + For more information about using application settings, see [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms). + + + +## Examples + The following code example demonstrates the use of application settings to persist the following attributes of the main form: location, size, background color, and title bar text. All of these attributes are persisted as single application settings properties in the `FormSettings` class, named `FormLocation`, `FormSize`, `FormBackColor` and `FormText`, respectively. All except for `FormText` and `Size` are data bound to their associated form properties and have a default setting value applied using . + + The form contains four child controls that have the following names and functions: + +- A button named `btnBackColor` used to display the **Color** common dialog box. + +- A button named `btnReload` used to the application settings. + +- A button named `btnReset` used to the application settings. + +- A textbox named `tbStatus` used to display status information about the program. + + Notice that after every execution of the application, an additional period character is appended to the title text of the form. + + This code example requires a Form with a class named `colorDialog1`, and a control with a named `tbStatus`. Additionally, it requires three objects named `btnReload`, `btnReset`, and `btnBackColor`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -95,7 +95,7 @@ - Application Settings for Windows Forms + Application Settings for Windows Forms @@ -134,25 +134,25 @@ Initializes an instance of the class to its default state. - . - - When an instance of a wrapper class is created, inherited code will automatically perform the following actions: - -1. Reflect over the class. - -2. For each property on the wrapper marked with either `[UserScopedSettingAttribute]` or `[ApplicationScopedSettingAttribute]`, a corresponding is created. - -3. Each has some of its properties set based on other attributes that are optionally present on the wrapper's properties, such as the default value or the settings provider. - -4. All other attributes are simply put into an attribute bag, the property of the class. - -5. All objects are added to a represented by the property of the class. This collection is then passed to the method. - - As implied by step 3 mentioned previously, natively works with several property attributes, specifically the following: , , and . All other settings attributes are simply passed through to the appropriate underlying provider. - + . + + When an instance of a wrapper class is created, inherited code will automatically perform the following actions: + +1. Reflect over the class. + +2. For each property on the wrapper marked with either `[UserScopedSettingAttribute]` or `[ApplicationScopedSettingAttribute]`, a corresponding is created. + +3. Each has some of its properties set based on other attributes that are optionally present on the wrapper's properties, such as the default value or the settings provider. + +4. All other attributes are simply put into an attribute bag, the property of the class. + +5. All objects are added to a represented by the property of the class. This collection is then passed to the method. + + As implied by step 3 mentioned previously, natively works with several property attributes, specifically the following: , , and . All other settings attributes are simply passed through to the appropriate underlying provider. + ]]> @@ -191,15 +191,15 @@ The component that will act as the owner of the application settings object. Initializes an instance of the class using the supplied owner component. - constructor using the invocation: - - `ApplicationSettingsBase(owner, String.Empty)` - - For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. - + constructor using the invocation: + + `ApplicationSettingsBase(owner, String.Empty)` + + For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. + ]]> @@ -239,13 +239,13 @@ A that uniquely identifies separate instances of the wrapper class. Initializes an instance of the class using the supplied settings key. - property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class in the same application domain. - - For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. - + property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the settings wrapper class in the same application domain. + + For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. + ]]> @@ -284,15 +284,15 @@ A that uniquely identifies separate instances of the wrapper class. Initializes an instance of the class using the supplied owner component and settings key. - object specified by the `owner` parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from , the owner's site is queried for a . If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the . - - This constructor initializes the property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain. - - For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. - + object specified by the `owner` parameter acts as the owner of the current instance of this applications settings class. During the initialization of the settings wrapper class derived from , the owner's site is queried for a . If one exists, it is used in preference to native settings provider for all the properties of the wrapper class, as specified by the . + + This constructor initializes the property to the value of the `settingsKey` parameter. This property is useful in disambiguating different instances of the wrapper class in the same application domain. + + For information about how reflection is used during the instantiation of a wrapper class, see the default constructor. + ]]> @@ -339,13 +339,13 @@ Gets the application settings context associated with the settings group. A associated with the settings group. - has a context associated with it. The context is passed to the settings provider for each property to identify how the property is used. Context therefore acts as a hint to help the settings provider determine how best to persist the associated application settings values. - - In contrast, the property enables the settings provider to disambiguate multiple instances of the same wrapper class. - + has a context associated with it. The context is passed to the settings provider for each property to identify how the property is used. Context therefore acts as a hint to help the settings provider determine how best to persist the associated application settings values. + + In contrast, the property enables the settings provider to disambiguate multiple instances of the same wrapper class. + ]]> @@ -390,11 +390,11 @@ Returns the value of the named settings property for the previous version of the same application. An containing the value of the specified if found; otherwise, . - method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. - + method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. + ]]> The property does not exist. The property count is zero or the property cannot be found in the data store. @@ -441,17 +441,17 @@ Gets or sets the value of the specified application settings property. If found, the value of the named settings property; otherwise, . - property, also known as the indexer, is routinely used in the settings wrapper class derived from . binds the public property of the wrapper class to the corresponding settings property. - - raises several events depending on the operation being performed: - -- The first time a property is retrieved, the event is raised. - -- When a property is set, the event is raised. If the handler does not cancel the event, then the property value is set and the event is raised. - + property, also known as the indexer, is routinely used in the settings wrapper class derived from . binds the public property of the wrapper class to the corresponding settings property. + + raises several events depending on the operation being performed: + +- The first time a property is retrieved, the event is raised. + +- When a property is set, the event is raised. If the handler does not cancel the event, then the property value is set and the event is raised. + ]]> There are no properties associated with the current wrapper or the specified property could not be found. @@ -498,13 +498,13 @@ 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. + ]]> @@ -549,13 +549,13 @@ 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. + ]]> @@ -602,13 +602,13 @@ 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. + ]]> @@ -655,13 +655,13 @@ 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. + ]]> @@ -709,13 +709,13 @@ Gets the collection of settings properties in the wrapper. A containing all the objects used in the current wrapper. - property reflects over the metadata of the settings wrapper class, which is derived from , to dynamically determine the set of available application settings properties. - - The class natively recognizes certain characteristics of an application setting, such as its name, property type, settings provider, default value, read only status, and a serialization preference. These characteristics are mirrored as properties in the class. All other attributes of the settings property are just passed through to its associated settings provider. - + property reflects over the metadata of the settings wrapper class, which is derived from , to dynamically determine the set of available application settings properties. + + The class natively recognizes certain characteristics of an application setting, such as its name, property type, settings provider, default value, read only status, and a serialization preference. These characteristics are mirrored as properties in the class. All other attributes of the settings property are just passed through to its associated settings provider. + ]]> The associated settings provider could not be found or its instantiation failed. @@ -759,13 +759,13 @@ Occurs after the value of an application settings property is changed. - event is raised when a settings property is changed through the `set` accessor of the method, or for every property that is restored when a call is made to the or methods. - - There is no corresponding `PropertyChanging` event for this class; instead, see the event. - + event is raised when a settings property is changed through the `set` accessor of the method, or for every property that is restored when a call is made to the or methods. + + There is no corresponding `PropertyChanging` event for this class; instead, see the event. + ]]> @@ -852,11 +852,11 @@ Gets the collection of application settings providers used by the wrapper. A containing all the objects used by the settings properties of the current settings wrapper. - determines what setting provider is used by a settings wrapper class or an individual setting property. If this attribute is not specified, a client application will use the . - + determines what setting provider is used by a settings wrapper class or an individual setting property. If this attribute is not specified, a client application will use the . + ]]> @@ -895,26 +895,26 @@ Refreshes the application settings property values from persistent storage. - method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: - -- It clears the currently cached properties by clearing the collection represented by the property. - -- It raises the event for every member of the collection. - - contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. - - - -## Examples - The following code example shows the method being invoked in the body of the event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. - + method clears the currently cached property values, causing a reload of these values from persistent storage when they are subsequently accessed. This method performs the following actions: + +- It clears the currently cached properties by clearing the collection represented by the property. + +- It raises the event for every member of the collection. + + contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + + + +## Examples + The following code example shows the method being invoked in the body of the event handler for a button named `btnReload`. As a result of this call, the currently stored values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet6"::: + ]]> @@ -957,26 +957,26 @@ Restores the persisted application settings values to their corresponding default properties. - method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: - -- It calls the method on every settings provider that supports this optional method. - -- It calls the method to force a refresh of the settings property values. - - contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. - - - -## Examples - The following code example shows the method being invoked in the body of the event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. - + method overwrites the user-scoped settings properties by restoring the currently persisted value of each application settings. This method performs the following actions: + +- It calls the method on every settings provider that supports this optional method. + +- It calls the method to force a refresh of the settings property values. + + contrasts with in that the former will load the last set of saved application settings values, whereas the latter will load the saved default values. + + + +## Examples + The following code example shows the method being invoked in the body of the event handler for a button named `btnReset`. As a result of this call, the stored default values for the application settings are reloaded into their corresponding properties. The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet5"::: + ]]> The configuration file could not be parsed. @@ -1016,29 +1016,29 @@ Stores the current values of the application settings properties. - method writes the current value of each settings property to its associated data store. For each property, this method calls the method on the associated settings provider. - - This method differs from the base class implementation in that it raises the event before the values are written. - - If the only settings defined are application-scoped settings, will have no effect and return no error if called with the default . only saves user-scoped settings. - + method writes the current value of each settings property to its associated data store. For each property, this method calls the method on the associated settings provider. + + This method differs from the base class implementation in that it raises the event before the values are written. + + If the only settings defined are application-scoped settings, will have no effect and return no error if called with the default . only saves user-scoped settings. + > [!IMPORTANT] -> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the method to persist the current values of the application settings. This is typically performed in the event handler of the primary or containing . - - - -## Examples - The following code example shows the method being called from the event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's property. - - The full code example is listed in the class overview. - +> There is no corresponding Load method because the values of application settings are automatically loaded during wrapper class initialization. In contrast, these values are not automatically saved when an application ends. Therefore, you must explicitly call the method to persist the current values of the application settings. This is typically performed in the event handler of the primary or containing . + + + +## Examples + The following code example shows the method being called from the event handler for the primary form. This method also appends an extra period to the settings property that is associated with the form's property. + + The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet3"::: + ]]> @@ -1078,31 +1078,31 @@ Occurs before the value of an application settings property is changed. - event occurs before an application setting value property is changed through the method. This event is not raised when the or methods are called. can be canceled through the event data class. - - You typically use the event to handle immediate validation of an individual settings property. For more information about validation, see [How to: Validate Application Settings](/dotnet/framework/winforms/advanced/how-to-validate-application-settings). - - There is no corresponding `SettingChanged` event for this class; instead, see the event. - - - -## Examples - The following code example shows the event handler for object of type `FormSettings`, which is a wrapper class derived from . The handler displays the event information in a textbox named `tbStatus`. The full code example is listed in the class overview. - + event occurs before an application setting value property is changed through the method. This event is not raised when the or methods are called. can be canceled through the event data class. + + You typically use the event to handle immediate validation of an individual settings property. For more information about validation, see [How to: Validate Application Settings](/dotnet/desktop/winforms/advanced/how-to-validate-application-settings). + + There is no corresponding `SettingChanged` event for this class; instead, see the event. + + + +## Examples + The following code example shows the event handler for object of type `FormSettings`, which is a wrapper class derived from . The handler displays the event information in a textbox named `tbStatus`. The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet7"::: + ]]> - How to: Validate Application Settings + How to: Validate Application Settings @@ -1146,21 +1146,21 @@ Gets or sets the settings key for the application settings group. A containing the settings key for the current settings group. - property is provided to enable client code, and in particular the settings provider, to disambiguate between multiple instances of the same application settings class. - - Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of should be set according to how the property values are intended to be shared. - -- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then should have the same value in all of the instances. This is the default behavior of the class. - -- If the settings properties of the wrapper are intended to be per instance, then should have a unique value for every instance. The version of the constructor enables you to initialize to a unique string. - - In contrast, the property provides hints to the settings provider to enable it to persist values in an efficient and orderly manner. - - The class contains a similar property that helps identify the source of the event. - + property is provided to enable client code, and in particular the settings provider, to disambiguate between multiple instances of the same application settings class. + + Unless the settings wrapper class is designed using the singleton pattern, there can be multiple instances of the same application settings class in a single application. The value of should be set according to how the property values are intended to be shared. + +- If the settings properties of the wrapper are intended to be shared across all instances of the wrapper in the same application, then should have the same value in all of the instances. This is the default behavior of the class. + +- If the settings properties of the wrapper are intended to be per instance, then should have a unique value for every instance. The version of the constructor enables you to initialize to a unique string. + + In contrast, the property provides hints to the settings provider to enable it to persist values in an efficient and orderly manner. + + The class contains a similar property that helps identify the source of the event. + ]]> @@ -1197,11 +1197,11 @@ Occurs after the application settings are retrieved from storage. - event occurs only after the initial `get` access of the first configuration property used, typically through the method. Subsequent accesses use values for the settings property that are cached locally. The and methods will clear all cached values so this event will be raised again upon subsequent property access. - + event occurs only after the initial `get` access of the first configuration property used, typically through the method. Subsequent accesses use values for the settings property that are cached locally. The and methods will clear all cached values so this event will be raised again upon subsequent property access. + ]]> @@ -1241,20 +1241,20 @@ Occurs before values are saved to the data store. - event is raised by the method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. - - - -## Examples - The following code example shows the event handler for object of type `FormSettings`, which is a wrapper class derived from . The handler queries the user to save the current application settings property values. The full code example is listed in the class overview. - + event is raised by the method before it stores the application settings properties to their associated data store. The associated event handler can cancel this event. + + + +## Examples + The following code example shows the event handler for object of type `FormSettings`, which is a wrapper class derived from . The handler queries the user to save the current application settings property values. The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet8"::: + ]]> @@ -1292,21 +1292,21 @@ Updates application settings to reflect a more recent installation of the application. - method performs two actions to assure smooth transition to a new version of an application: - -- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their method, assuming they have implemented the interface. This action is not performed if the settings wrapper class is marked with . - -- It reloads the values for all of the application settings. - - You can override the default behavior of to implement custom upgrading or merging behavior. Use the method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: - -- Using new policy defaults that override one or more of the previous user-specified values or previous defaults. - -- Special translation of old values to be compatible with newer ranges, a different settings property group, and so on. - + method performs two actions to assure smooth transition to a new version of an application: + +- It notifies all of the corresponding settings providers of the existence of the upgraded application through a call to their method, assuming they have implemented the interface. This action is not performed if the settings wrapper class is marked with . + +- It reloads the values for all of the application settings. + + You can override the default behavior of to implement custom upgrading or merging behavior. Use the method to retrieve individual values for a setting for the previous version of the application. Examples of custom upgrade behavior include: + +- Using new policy defaults that override one or more of the previous user-specified values or previous defaults. + +- Special translation of old values to be compatible with newer ranges, a different settings property group, and so on. + ]]> The configuration file could not be parsed. diff --git a/xml/System.Configuration/ClientSettingsSection.xml b/xml/System.Configuration/ClientSettingsSection.xml index 5f354fdb2e2..8dde93cc2f3 100644 --- a/xml/System.Configuration/ClientSettingsSection.xml +++ b/xml/System.Configuration/ClientSettingsSection.xml @@ -33,21 +33,21 @@ Represents a group of user-scoped application settings in a configuration file. - , which stores configuration data to the local file system in files with the extension `.config`. The contents of configuration files are structured as XML documents. User-scoped settings are persisted in a file with the name `username.config`. Within this file, data is stored as elements within a `` section. Each of these sections is represented by a corresponding . Each section object is owned and administered by a configuration section handler, which is an . - - The class represents a simple extension of the class, which is used in the .NET Framework support for general configuration files. - - For more information about application settings, see the topic [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms). - + , which stores configuration data to the local file system in files with the extension `.config`. The contents of configuration files are structured as XML documents. User-scoped settings are persisted in a file with the name `username.config`. Within this file, data is stored as elements within a `` section. Each of these sections is represented by a corresponding . Each section object is owned and administered by a configuration section handler, which is an . + + The class represents a simple extension of the class, which is used in the .NET Framework support for general configuration files. + + For more information about application settings, see the topic [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms). + ]]> - Application Settings for Windows Forms + Application Settings for Windows Forms @@ -83,11 +83,11 @@ Initializes a new instance of the class. - constructor initializes the property. - + constructor initializes the property. + ]]> @@ -172,11 +172,11 @@ Gets the collection of client settings for the section. A containing all the client settings found in the current configuration section. - property is itself a configuration property. - + property is itself a configuration property. + ]]> diff --git a/xml/System.Configuration/DefaultSettingValueAttribute.xml b/xml/System.Configuration/DefaultSettingValueAttribute.xml index 97758453624..d1f85638afb 100644 --- a/xml/System.Configuration/DefaultSettingValueAttribute.xml +++ b/xml/System.Configuration/DefaultSettingValueAttribute.xml @@ -38,37 +38,37 @@ Specifies the default value for an application settings property. - [!IMPORTANT] -> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. - - Different settings providers may have different requirements or limitations on the use of the . For example, the does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. - - requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the . - +> can only be applied to individual settings properties; it is invalid to apply this attribute to an entire application settings class. + + Different settings providers may have different requirements or limitations on the use of the . For example, the does not require this attribute, and will override any value provided by this attribute if there are any values - default or user-modified - already present in the data store. + + requires that the default value can be represented as a string. As a result, settings using XML serialization cannot have a default value specified by means of this attribute. Some providers may choose to support multiple serialization schemes which can be specified at compile time using the . + > [!CAUTION] -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. - - - -## Examples - The following code example demonstrates the use of the applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. - - The full code example is listed in the class overview. - +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. + + + +## Examples + The following code example demonstrates the use of the applied to three of the four properties of the `FormSettings` wrapper class, which is derived from the class. This class is used to persist the location, size, background color, and text of form. The first three of these form properties have default values associated with them. + + The full code example is listed in the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/AppSettingsSample/cpp/AppSettingsSample.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Configuration/ApplicationSettingsBase/Overview/AppSettingsSample.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/AppSettingsSample/VB/Form1.vb" id="Snippet9"::: + ]]> - Application Settings for Windows Forms + Application Settings for Windows Forms @@ -108,14 +108,14 @@ A that represents the default value for the property. Initializes an instance of the class. - , then a `value` of `"Azure"` would be valid. - + , then a `value` of `"Azure"` would be valid. + > [!CAUTION] -> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. - +> The default values specified by this attribute are stored as plain text in the resultant compiled .exe or .dll file. Therefore these default values are inherently insecure. + ]]> @@ -159,13 +159,13 @@ Gets the default value for the application settings property. A that represents the default value for the property. - property is set in the constructor. - - Setting providers may support multiple serialization schemes that can be specified with the . - + property is set in the constructor. + + Setting providers may support multiple serialization schemes that can be specified with the . + ]]> diff --git a/xml/System.Configuration/IApplicationSettingsProvider.xml b/xml/System.Configuration/IApplicationSettingsProvider.xml index d54bfa0b123..42ae92224bf 100644 --- a/xml/System.Configuration/IApplicationSettingsProvider.xml +++ b/xml/System.Configuration/IApplicationSettingsProvider.xml @@ -30,27 +30,27 @@ Defines extended capabilities for client-based application settings providers. - . Such a class contains the basic functionality for storing and retrieving properties. However, you can add additional standardized functionality by implementing the interface in the custom settings provider. This interface contains three methods that primarily enable the settings provider to more intelligently handle application version changes. Typically, the settings provider will store application settings for different versions of an application separately to anticipate the following circumstances: - -- Side-by-side execution of different versions of an application. - -- Retaining application settings when upgrading an application. - -- Resetting the application settings to their default values for the currently used version. - - The class implements the interface. The same set of methods contained by is also found in the class, enabling the establishment of a predefined communication channel between an application settings wrapper and its settings provider. - + . Such a class contains the basic functionality for storing and retrieving properties. However, you can add additional standardized functionality by implementing the interface in the custom settings provider. This interface contains three methods that primarily enable the settings provider to more intelligently handle application version changes. Typically, the settings provider will store application settings for different versions of an application separately to anticipate the following circumstances: + +- Side-by-side execution of different versions of an application. + +- Retaining application settings when upgrading an application. + +- Resetting the application settings to their default values for the currently used version. + + The class implements the interface. The same set of methods contained by is also found in the class, enabling the establishment of a predefined communication channel between an application settings wrapper and its settings provider. + > [!NOTE] -> This interface is optional. If a provider does not implement this interface, the settings infrastructure will fail without notification if it attempts to access any of the methods defined by this interface. - +> This interface is optional. If a provider does not implement this interface, the settings infrastructure will fail without notification if it attempts to access any of the methods defined by this interface. + ]]> - Application Settings Architecture + Application Settings Architecture @@ -90,11 +90,11 @@ Returns the value of the specified settings property for the previous version of the same application. A containing the value of the specified property setting as it was last set in the previous version of the application; or if the setting cannot be found. - method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. - + method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. + ]]> @@ -136,13 +136,13 @@ A describing the current application usage. Resets the application settings associated with the specified application to their default values. - method reinitializes the stored values of the specified application settings group. In contrast, supplies a default value for a single settings property during property initialization, if it has no stored value. - - The settings provider determines what reasonable defaults are for the specified group of application settings. For example, the implementation in resets user-scoped settings to their shared values in the `application.exe.config` file; in contrast, it leaves the application-scoped settings unchanged. - + method reinitializes the stored values of the specified application settings group. In contrast, supplies a default value for a single settings property during property initialization, if it has no stored value. + + The settings provider determines what reasonable defaults are for the specified group of application settings. For example, the implementation in resets user-scoped settings to their shared values in the `application.exe.config` file; in contrast, it leaves the application-scoped settings unchanged. + ]]> @@ -185,15 +185,15 @@ A containing the settings property group whose values are to be retrieved. Indicates to the provider that the application has been upgraded. This offers the provider an opportunity to upgrade its stored settings as appropriate. - method, implemented in a class derived from . - - You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. - - This method should be suppressed for every application setting that has the is applied to it, or to the entire settings wrapper class, derived from . - + method, implemented in a class derived from . + + You can use the method in conjunction with the method to migrate application settings during or after the installation of a new version of an application. + + This method should be suppressed for every application setting that has the is applied to it, or to the entire settings wrapper class, derived from . + ]]> diff --git a/xml/System.Configuration/IPersistComponentSettings.xml b/xml/System.Configuration/IPersistComponentSettings.xml index 8ae71245a2d..abba951bd0b 100644 --- a/xml/System.Configuration/IPersistComponentSettings.xml +++ b/xml/System.Configuration/IPersistComponentSettings.xml @@ -30,15 +30,15 @@ Defines standard functionality for controls or libraries that store and retrieve application settings. - , and then add special properties to this class. However, this approach does not sufficiently encapsulate application settings for a control so that its container is shielded from the details. The interface provides an application with a standard interface for communicating application settings state change requests to a control, component, or library module. Design-time tools also depend on this interface to properly manage controls and components. - + , and then add special properties to this class. However, this approach does not sufficiently encapsulate application settings for a control so that its container is shielded from the details. The interface provides an application with a standard interface for communicating application settings state change requests to a control, component, or library module. Design-time tools also depend on this interface to properly manage controls and components. + ]]> - Application Settings for Custom Controls + Application Settings for Custom Controls @@ -72,15 +72,15 @@ Reads the control's application settings into their corresponding properties and updates the control's state. - method performs two essential operations: - -- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their methods. - -- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, should ensure that the control's property is updated to reflect this reloaded setting. - + method performs two essential operations: + +- It causes each application settings instance contained by the control to refresh the values of its application settings properties, typically by calling their methods. + +- As required, it updates those general properties that depend on these reloaded settings properties. For example, if the settings class contained a `location` settings property, should ensure that the control's property is updated to reflect this reloaded setting. + ]]> @@ -119,11 +119,11 @@ Resets the control's application settings properties to their default values. - method typically calls the method on each instance of an application settings class it contains. - + method typically calls the method on each instance of an application settings class it contains. + ]]> @@ -161,14 +161,14 @@ Persists the control's application settings properties. - method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the . You can override the choice of the settings provider by using the interface. - + method writes the values of the control's application settings properties to the associated data store. The data store and serialization technique the method uses is determined by the settings provider associated with each settings class through the . You can override the choice of the settings provider by using the interface. + > [!NOTE] -> If the property is `true`, the control should call in its own method so that the control's configuration data is stored automatically before the application ends. - +> If the property is `true`, the control should call in its own method so that the control's configuration data is stored automatically before the application ends. + ]]> @@ -212,40 +212,40 @@ if the control should automatically persist its state; otherwise, . - method or sometimes implicitly when the control's method is invoked. The property determines whether a control automatically persists its configuration data when it is disposed. - - The default value of depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the property is. - - - -## Examples - The following code example shows the proper way for a control to check the value of the property before it attempts to automatically persist its configuration data. - - `protected override void Dispose( bool disposing ) {` - - `if(disposing) {` - - `try {` - - `if (SaveSettings) {` - - `SaveComponentSettings();` - - `}` - - `}` - - `finally {` - - `//...` - - `}` - - `}` - + method or sometimes implicitly when the control's method is invoked. The property determines whether a control automatically persists its configuration data when it is disposed. + + The default value of depends on the implementation of the control. The documentation for the control should indicate whether it uses application settings, what data is persisted, and what the default value of the property is. + + + +## Examples + The following code example shows the proper way for a control to check the value of the property before it attempts to automatically persist its configuration data. + + `protected override void Dispose( bool disposing ) {` + + `if(disposing) {` + + `try {` + + `if (SaveSettings) {` + + `SaveComponentSettings();` + + `}` + + `}` + + `finally {` + + `//...` + + `}` + + `}` + ]]> @@ -283,26 +283,26 @@ Gets or sets the value of the application settings key for the current instance of the control. A containing the settings key for the current instance of the control. - property to disambiguate groups of application settings properties when there are multiple instances of the same wrapper class. For example, if a control contains an associated wrapper class, then placing multiple instances of the same control in the same application will typically result in multiple instances of the wrapper class. A settings key is required only when the configuration data differs on a per-instance basis; for example, the location of dynamically positioned controls. - - The following general rules apply to the use of : - -- A control, like any class, may contain zero or more application settings classes, derived from . Each settings class contains its own property, which helps disambiguate multiple instances of that class. - -- A control should separate its per-instance data and its shared data into different settings classes. - -- For a control with any per-instance configuration data, the `get` accessor of the property should default to the of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. - -- The `set` accessor for this property should be implemented to distinguish between settings classes containing per-instance and shared configuration data. For each settings class containing per-instance data, `set` should just pass-through to the property of the settings class. For settings classes containing shared data, `set` should perform no action for that settings class. - + property to disambiguate groups of application settings properties when there are multiple instances of the same wrapper class. For example, if a control contains an associated wrapper class, then placing multiple instances of the same control in the same application will typically result in multiple instances of the wrapper class. A settings key is required only when the configuration data differs on a per-instance basis; for example, the location of dynamically positioned controls. + + The following general rules apply to the use of : + +- A control, like any class, may contain zero or more application settings classes, derived from . Each settings class contains its own property, which helps disambiguate multiple instances of that class. + +- A control should separate its per-instance data and its shared data into different settings classes. + +- For a control with any per-instance configuration data, the `get` accessor of the property should default to the of the control. In most cases the name of the control will be unique within an application. If the control contains only shared configuration data, `get` should default to `null`. + +- The `set` accessor for this property should be implemented to distinguish between settings classes containing per-instance and shared configuration data. For each settings class containing per-instance data, `set` should just pass-through to the property of the settings class. For settings classes containing shared data, `set` should perform no action for that settings class. + ]]> - Application Settings for Custom Controls + Application Settings for Custom Controls diff --git a/xml/System.Configuration/ISettingsProviderService.xml b/xml/System.Configuration/ISettingsProviderService.xml index 68c9d06ae47..5c87f43207a 100644 --- a/xml/System.Configuration/ISettingsProviderService.xml +++ b/xml/System.Configuration/ISettingsProviderService.xml @@ -30,13 +30,13 @@ Provides an interface for defining an alternate application settings provider. - interface enables controls and components hosted in an application to persist their application settings in a manner largely transparent to the application. However, in some cases, the application or environment may need to override the settings provider natively used by a component with one of its own choosing. The interface enables the creation of a lightweight service that communicates such an alternate settings provider, typically offered through the owning . - - is commonly used by design-time tools and debuggers that provide special support for application settings. To make such an arrangement function seamlessly, the class contains constructors that take a reference to the owning component. These constructors automatically query for compatible settings providers. - + interface enables controls and components hosted in an application to persist their application settings in a manner largely transparent to the application. However, in some cases, the application or environment may need to override the settings provider natively used by a component with one of its own choosing. The interface enables the creation of a lightweight service that communicates such an alternate settings provider, typically offered through the owning . + + is commonly used by design-time tools and debuggers that provide special support for application settings. To make such an arrangement function seamlessly, the class contains constructors that take a reference to the owning component. These constructors automatically query for compatible settings providers. + ]]> @@ -44,7 +44,7 @@ - Application Settings for Custom Controls + Application Settings for Custom Controls @@ -82,11 +82,11 @@ Returns the settings provider compatible with the specified settings property. If found, the that can persist the specified settings property; otherwise, . - method enables an to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. - + method enables an to offer its serialization services to any sited component. This method determines if the associated settings provider can persist the specified application settings property type. If it can, this method returns a reference to that settings provider; otherwise it returns `null`. + ]]> diff --git a/xml/System.Configuration/LocalFileSettingsProvider.xml b/xml/System.Configuration/LocalFileSettingsProvider.xml index 73e5b5858f2..6027402b57d 100644 --- a/xml/System.Configuration/LocalFileSettingsProvider.xml +++ b/xml/System.Configuration/LocalFileSettingsProvider.xml @@ -36,19 +36,19 @@ Provides persistence for application settings classes. - , which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the . - - Typically, the client program does not explicitly access this class; rather, the application settings architecture automatically invokes the appropriate settings provider when its services are required. For example, many of the members of delegate their work to the associated settings provider. - - persists settings to configuration files that have the extension `.config`. The contents of configuration files are structured as XML documents. Depending on whether the setting is scoped at either the application-level or user-level, the configuration data is stored as elements within an `` or a `` section group, respectively. Each of these section groups is represented by a corresponding or , respectively. Each section object is owned and administered by a configuration section handler, which is an object of type . - - Application-scoped settings and the default user-scoped settings are stored in a file named `application.exe.config`, which is created in the same directory as the executable file. Application configuration settings are read-only. Specific user data is stored in a file named `user.config`, stored under the user's home directory. If roaming profiles are enabled, two versions of the user configuration file could exist. In such a case, the entries in the roaming version take precedence over duplicated entries in the local user configuration file. - - For more information about application settings, see [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms). - + , which stores configuration data to the local file system. An application settings property or group of properties are associated to a specific settings provider through the use of the . + + Typically, the client program does not explicitly access this class; rather, the application settings architecture automatically invokes the appropriate settings provider when its services are required. For example, many of the members of delegate their work to the associated settings provider. + + persists settings to configuration files that have the extension `.config`. The contents of configuration files are structured as XML documents. Depending on whether the setting is scoped at either the application-level or user-level, the configuration data is stored as elements within an `` or a `` section group, respectively. Each of these section groups is represented by a corresponding or , respectively. Each section object is owned and administered by a configuration section handler, which is an object of type . + + Application-scoped settings and the default user-scoped settings are stored in a file named `application.exe.config`, which is created in the same directory as the executable file. Application configuration settings are read-only. Specific user data is stored in a file named `user.config`, stored under the user's home directory. If roaming profiles are enabled, two versions of the user configuration file could exist. In such a case, the entries in the roaming version take precedence over duplicated entries in the local user configuration file. + + For more information about application settings, see [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms). + ]]> @@ -57,7 +57,7 @@ - Application Settings Architecture + Application Settings Architecture @@ -87,11 +87,11 @@ Initializes a new instance of the class. - property to . - + property to . + ]]> @@ -138,11 +138,11 @@ Gets or sets the name of the currently running application. A string that contains the application's display name. - and properties help to disambiguate similarly named setting properties in different applications. - + and properties help to disambiguate similarly named setting properties in different applications. + ]]> @@ -188,11 +188,11 @@ Returns the value of the named settings property for the previous version of the same application. A representing the application setting if found; otherwise, . - method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. For more information, see the method. - + method is often used in conjunction with the method when migrating application settings during the installation of a new version of an application. For more information, see the method. + ]]> @@ -238,14 +238,14 @@ Returns the collection of setting property values for the specified application instance and settings property group. A containing the values for the specified settings property group. - method also manages the special application settings type . Connection strings are stored in a special section of the configuration file delimited by the element ``. - + method also manages the special application settings type . Connection strings are stored in a special section of the configuration file delimited by the element ``. + > [!CAUTION] -> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). - +> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). + ]]> A user-scoped setting was encountered but the current configuration only supports application-scoped settings. @@ -330,17 +330,17 @@ A describing the current application usage. Resets all application settings properties associated with the specified application to their default values. - method restores the stored values of the specified application settings group. The action of depends on the scope of the application settings property: - -- Application-scoped settings are not affected. - -- User-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, `application.exe.config`. If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile. - - Notice that if roaming profiles are used, there can be two `user.config` files, one for the local settings and one for the roaming profile. - + method restores the stored values of the specified application settings group. The action of depends on the scope of the application settings property: + +- Application-scoped settings are not affected. + +- User-scoped settings are reset to the default values that are stored as read-only entries in the application configuration file, `application.exe.config`. If roaming profiles are being used, any application settings values in the roaming profile take precedence over duplicates found in the local profile. + + Notice that if roaming profiles are used, there can be two `user.config` files, one for the local settings and one for the roaming profile. + ]]> A user-scoped setting was encountered but the current configuration only supports application-scoped settings. @@ -387,32 +387,32 @@ A representing the group of property settings to set. Sets the values of the specified group of property settings. - , contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. - - individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. - - By default, the method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: - -1. If the type has an associated with a method implementation, this conversion is used. - -2. XML serialization is used. - - However, you can specify a preferred serialization mechanism by using the . does not support binary serialization in Visual Studio 2005. - - If a user-scoped settings property is set back to its default value explicitly, then the local file settings provider will remove the entry for the associated setting from the user configuration file. The next read access for this property will simply use the default value. - + , contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. + + individually serializes each user-scoped application settings property to its corresponding application setting in the appropriate `user.config` configuration file. + + By default, the method uses the following logical sequence to determine the serialization scheme, depending on type of the settings property: + +1. If the type has an associated with a method implementation, this conversion is used. + +2. XML serialization is used. + + However, you can specify a preferred serialization mechanism by using the . does not support binary serialization in Visual Studio 2005. + + If a user-scoped settings property is set back to its default value explicitly, then the local file settings provider will remove the entry for the associated setting from the user configuration file. The next read access for this property will simply use the default value. + > [!CAUTION] -> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). - +> does not use encryption to persist any settings. Therefore, do not store plain text passwords or other sensitive information using this provider without taking additional precautions, such as separately encrypting the information within the configuration file. For more information, see [Encrypting Configuration Information Using Protected Configuration](https://learn.microsoft.com/previous-versions/aspnet/53tyfkaw(v=vs.100)). + ]]> - A user-scoped setting was encountered but the current configuration only supports application-scoped settings. - - -or- - + A user-scoped setting was encountered but the current configuration only supports application-scoped settings. + + -or- + There was a general failure saving the settings to the configuration file. @@ -459,27 +459,27 @@ A containing the settings property group whose values are to be retrieved. Attempts to migrate previous user-scoped settings from a previous version of the same application. - migrates the local and roaming settings in separate operations. - - The method is suppressed for every application setting that has the applied to it, or to the entire settings wrapper class, derived from . - - This way this method is called depends on the type of application that is being upgraded: - -- Each version of a ClickOnce application is stored in its own isolated installation directory. After a new version of a ClickOnce application is installed, and when the new version is first run, internal logic will automatically call to migrate all common application settings to the new version. For more information, see [ClickOnce and Application Settings](/visualstudio/deployment/clickonce-and-application-settings). - -- Standard Windows Forms and console applications must manually call , because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. - - Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application. - + migrates the local and roaming settings in separate operations. + + The method is suppressed for every application setting that has the applied to it, or to the entire settings wrapper class, derived from . + + This way this method is called depends on the type of application that is being upgraded: + +- Each version of a ClickOnce application is stored in its own isolated installation directory. After a new version of a ClickOnce application is installed, and when the new version is first run, internal logic will automatically call to migrate all common application settings to the new version. For more information, see [ClickOnce and Application Settings](/visualstudio/deployment/clickonce-and-application-settings). + +- Standard Windows Forms and console applications must manually call , because there is not a general, automatic way to determine when such an application is first run. The two common ways to do this are either from the installation program or using from the application itself, using a persisted property, often named something like `IsFirstRun`. + + Note that for the newer version to migrate application settings, it must be able to also load and read the older version of the application settings. Therefore, it must contain wrapper classes compatible with both the new and previous versions of the application. + ]]> - A user-scoped setting was encountered but the current configuration only supports application-scoped settings. - - -or- - + A user-scoped setting was encountered but the current configuration only supports application-scoped settings. + + -or- + The previous version of the configuration file could not be accessed. diff --git a/xml/System.Configuration/SettingsManageabilityAttribute.xml b/xml/System.Configuration/SettingsManageabilityAttribute.xml index 7747a4a588c..d8212fad312 100644 --- a/xml/System.Configuration/SettingsManageabilityAttribute.xml +++ b/xml/System.Configuration/SettingsManageabilityAttribute.xml @@ -38,18 +38,18 @@ Specifies special services for application settings properties. This class cannot be inherited. - indicates that special, predefined services are to be provided to individual application settings properties and property groups. Most of these services will be provided by the Windows operating system. - - For more information about application settings properties and their use, see [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms). - + indicates that special, predefined services are to be provided to individual application settings properties and property groups. Most of these services will be provided by the Windows operating system. + + For more information about application settings properties and their use, see [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms). + ]]> - Application Settings for Windows Forms + Application Settings for Windows Forms @@ -89,11 +89,11 @@ A value that enumerates the services being requested. Initializes a new instance of the class. - enumeration with the logical `OR` operator. - + enumeration with the logical `OR` operator. + ]]> @@ -136,11 +136,11 @@ Gets the set of special services that have been requested. A value that results from using the logical operator to combine all the enumeration values corresponding to the requested services. - constructor. - + constructor. + ]]> diff --git a/xml/System.Configuration/SettingsProvider.xml b/xml/System.Configuration/SettingsProvider.xml index 572b5d37b6d..ad2b73f58eb 100644 --- a/xml/System.Configuration/SettingsProvider.xml +++ b/xml/System.Configuration/SettingsProvider.xml @@ -32,25 +32,25 @@ Acts as a base class for deriving custom settings providers in the application settings architecture. - , which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used. - - When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and . - - For client applications, you can add more standardized functionality to a custom provider by also implementing the interface. This interface mirrors methods found in the class, which mainly enables versioning support. - - Typically, you should design settings providers to be single-instanced to avoid storage resource contention. Providers should also be thread-safe because they can be called simultaneously from multiple wrapper instances in a single application domain or from multiple applications in different domains. - - At minimum, a settings provider must recognize three attributes - , , and . For a full listing of attributes that can be applied to application settings, see [Application Settings Attributes](/dotnet/framework/winforms/advanced/application-settings-attributes). A custom setting provider should resolve attributes applied to settings properties in the following manner: - -1. If the provider can fulfill the request implied by the attribute, obviously it should do so. - -2. If the provider cannot fulfill the request, it should ignore it silently. - -3. If two or more properties conflict; for example, a property being decorated with both and ; the provider should throw a . - + , which stores configuration data to the local file system. However, you can create alternate storage mechanisms by deriving from the abstract class. The provider that a wrapper class uses is determined by decorating the wrapper class with the . If this attribute is not provided, the default, , is used. + + When you create a custom settings provider, at minimum, you must provide implementations for the three methods of this class: , and . + + For client applications, you can add more standardized functionality to a custom provider by also implementing the interface. This interface mirrors methods found in the class, which mainly enables versioning support. + + Typically, you should design settings providers to be single-instanced to avoid storage resource contention. Providers should also be thread-safe because they can be called simultaneously from multiple wrapper instances in a single application domain or from multiple applications in different domains. + + At minimum, a settings provider must recognize three attributes - , , and . For a full listing of attributes that can be applied to application settings, see [Application Settings Attributes](/dotnet/desktop/winforms/advanced/application-settings-attributes). A custom setting provider should resolve attributes applied to settings properties in the following manner: + +1. If the provider can fulfill the request implied by the attribute, obviously it should do so. + +2. If the provider cannot fulfill the request, it should ignore it silently. + +3. If two or more properties conflict; for example, a property being decorated with both and ; the provider should throw a . + ]]> @@ -58,8 +58,8 @@ - Application Settings Architecture - Application Settings Attributes + Application Settings Architecture + Application Settings Attributes @@ -95,17 +95,17 @@ Initializes an instance of the class. - method typically performs all initialization. - - Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property: - -1. Call the method on the current or to return a reference to the current . - -2. Call the method of the retrieved in the first step to return the settings provider. - + method typically performs all initialization. + + Client code typically does not directly instantiate a settings provider; instead, you use the following procedure to find a settings provider for a particular settings property: + +1. Call the method on the current or to return a reference to the current . + +2. Call the method of the retrieved in the first step to return the settings provider. + ]]> @@ -144,11 +144,11 @@ Gets or sets the name of the currently running application. A that contains the application's shortened name, which does not contain a full path or extension, for example, SimpleAppSettings. - and properties help to disambiguate similarly named setting properties in different applications. - + and properties help to disambiguate similarly named setting properties in different applications. + ]]> @@ -191,11 +191,11 @@ Returns the collection of settings property values for the specified application instance and settings property group. A containing the values for the specified settings property group. - method must be implemented to handle special settings, those marked with , as well as reconcile application and user settings. - + method must be implemented to handle special settings, those marked with , as well as reconcile application and user settings. + ]]> @@ -238,17 +238,17 @@ A representing the group of property settings to set. Sets the values of the specified group of property settings. - contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. - - The method should be implemented with security in mind: - -- Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings. - -- Usage quotas should be considered to guard against resource attacks by partially trusted applications. - + contains the method, which is called to persist the values of all of its settings properties. This method enumerates through all the settings providers associated with its settings properties, and calls the method for each to perform the actual serialization operation. + + The method should be implemented with security in mind: + +- Only fully trusted code should be allowed to update application settings. Partially trusted code should be allowed to update only user application settings. Untrusted code is not typically allowed to update application settings. + +- Usage quotas should be considered to guard against resource attacks by partially trusted applications. + ]]> diff --git a/xml/System.Configuration/SettingsProviderAttribute.xml b/xml/System.Configuration/SettingsProviderAttribute.xml index d728071b564..60daf355fef 100644 --- a/xml/System.Configuration/SettingsProviderAttribute.xml +++ b/xml/System.Configuration/SettingsProviderAttribute.xml @@ -38,23 +38,23 @@ Specifies the settings provider used to provide storage for the current application settings class or property. This class cannot be inherited. - - that actually provides the storage mechanism. - - The specifies the settings provider used to provide storage for application settings properties. This attribute can be applied to the entire application settings class or individual application settings properties. A set at the property level will override the class-level attribute. If a settings provider is not explicitly specified, the default provider is used. For client applications, the default provider is . - - Setting providers cannot be determined at run time. Any run-time determination of storage methods must be coded into the settings provider class itself. - + - that actually provides the storage mechanism. + + The specifies the settings provider used to provide storage for application settings properties. This attribute can be applied to the entire application settings class or individual application settings properties. A set at the property level will override the class-level attribute. If a settings provider is not explicitly specified, the default provider is used. For client applications, the default provider is . + + Setting providers cannot be determined at run time. Any run-time determination of storage methods must be coded into the settings provider class itself. + > [!CAUTION] -> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. - +> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. + ]]> - Application Settings Architecture + Application Settings Architecture @@ -94,14 +94,14 @@ A containing the name of the settings provider. Initializes an instance of the class. - , that is being specified as the settings provider. - + , that is being specified as the settings provider. + > [!CAUTION] -> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. - +> Using custom settings providers from arbitrary third parties is inherently unsafe because these providers have full read/write access to your application's configuration information. A settings provider should be thoroughly vetted before it is adopted for general use. + ]]> @@ -178,11 +178,11 @@ Gets the type name of the settings provider. A containing the name of the settings provider. - property is set in the for the class. - + property is set in the for the class. + ]]> diff --git a/xml/System.Configuration/UserScopedSettingAttribute.xml b/xml/System.Configuration/UserScopedSettingAttribute.xml index 093efcd284b..4b88fdf7eb2 100644 --- a/xml/System.Configuration/UserScopedSettingAttribute.xml +++ b/xml/System.Configuration/UserScopedSettingAttribute.xml @@ -62,7 +62,7 @@ - Application Settings Architecture + Application Settings Architecture diff --git a/xml/System.Media/SoundPlayer.xml b/xml/System.Media/SoundPlayer.xml index dca90a74148..0e916ee0c77 100644 --- a/xml/System.Media/SoundPlayer.xml +++ b/xml/System.Media/SoundPlayer.xml @@ -47,35 +47,33 @@ Controls playback of a sound from a .wav file. - class provides a simple interface for loading and playing a .wav file. The class supports loading a .wav file from a file path, a URL, a that contains a .wav file, or an embedded resource that contains a .wav file. - - To play a sound using the class, configure a with a path to the .wav file and call one of the play methods. You can identify the .wav file to play by using one of the constructors or by setting either the or property. The file can be loaded prior to playing by using one of the load methods, or loading can be deferred until one of the play methods is called. A configured to load a .wav file from a or URL must load the .wav file into memory before playback begins. - - You can load or play a .wav file synchronously or asynchronously. If you call a synchronous load or play method, the calling thread will wait until the method returns, which may cause painting and other events to be interrupted. Calling an asynchronous load or play method will allow the calling thread to continue without interruption. For more information on asynchronous method calls, see [How to: Run an Operation in the Background](/dotnet/framework/winforms/controls/how-to-run-an-operation-in-the-background). - - When a has finished loading a .wav file, it raises the event. You can examine the in your event handler to determine if the load succeeded or failed. The event is raised when the audio source is set to a new file path or URL. The event is raised when the audio source is set to a new . For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - For more information about , see [SoundPlayer Class Overview](/dotnet/framework/winforms/controls/soundplayer-class-overview). - + class provides a simple interface for loading and playing a .wav file. The class supports loading a .wav file from a file path, a URL, a that contains a .wav file, or an embedded resource that contains a .wav file. + + To play a sound using the class, configure a with a path to the .wav file and call one of the play methods. You can identify the .wav file to play by using one of the constructors or by setting either the or property. The file can be loaded prior to playing by using one of the load methods, or loading can be deferred until one of the play methods is called. A configured to load a .wav file from a or URL must load the .wav file into memory before playback begins. + + You can load or play a .wav file synchronously or asynchronously. If you call a synchronous load or play method, the calling thread will wait until the method returns, which may cause painting and other events to be interrupted. Calling an asynchronous load or play method will allow the calling thread to continue without interruption. For more information on asynchronous method calls, see [How to: Run an Operation in the Background](/dotnet/desktop/winforms/controls/how-to-run-an-operation-in-the-background). + + When a has finished loading a .wav file, it raises the event. You can examine the in your event handler to determine if the load succeeded or failed. The event is raised when the audio source is set to a new file path or URL. The event is raised when the audio source is set to a new . For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + For more information about , see [SoundPlayer Class Overview](/dotnet/desktop/winforms/controls/soundplayer-class-overview). + > [!NOTE] -> The class cannot play other file types, such as .wma or .mp3. If you want to play other file types, you can use the Windows Media Player control. For more information, see [Using the Windows Media Player Control in a .NET Framework Solution](https://go.microsoft.com/fwlink/?LinkId=131267) and [Windows Media Player Object Model Reference for Visual Basic .NET and C#](https://go.microsoft.com/fwlink/?LinkId=131269) in the Windows Media Player SDK. - - - -## Examples - The following code example demonstrates the use of the class for playing .wav files from a local path or a Uniform Resource Identifier (URI). - +> The class cannot play other file types, such as .wma or .mp3. If you want to play other file types, you can use the [MediaPlayer](/uwp/api/windows.media.playback.mediaplayer). + +## Examples + The following code example demonstrates the use of the class for playing .wav files from a local path or a Uniform Resource Identifier (URI). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet1"::: + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -114,14 +112,14 @@ Initializes a new instance of the class. - with no audio source. Until it is configured with an audio source path, the will play a beep sound when one of its playback methods is called. - + with no audio source. Until it is configured with an audio source path, the will play a beep sound when one of its playback methods is called. + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -162,14 +160,14 @@ A to a .wav file. Initializes a new instance of the class, and attaches the .wav file within the specified . - passed to the `stream` parameter should be a containing a .wav file. The data returned by the method of the should be the data within a .wav file. - + passed to the `stream` parameter should be a containing a .wav file. The data returned by the method of the should be the data within a .wav file. + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -203,15 +201,15 @@ The location of a .wav file to load. Initializes a new instance of the class, and attaches the specified .wav file. - will still be constructed, but subsequent calls to a load or play method will fail. - + will still be constructed, but subsequent calls to a load or play method will fail. + ]]> The URL value specified by cannot be resolved. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -258,7 +256,7 @@ Initializes a new instance of the class. To be added. The specified in cannot be resolved. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -299,7 +297,7 @@ if a .wav file is loaded; if a .wav file has not yet been loaded. To be added. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -333,30 +331,30 @@ Loads a sound synchronously. - method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. - + method uses the current thread to load a .wav file, preventing the thread from handling other messages until the load is complete. + > [!CAUTION] -> The method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the method to load a sound asynchronously, which allows the calling thread to continue without interruption. - +> The method may produce a delay while loading a large .wav file. In addition, painting and other events will be blocked until the load is completed. Use the method to load a sound asynchronously, which allows the calling thread to continue without interruption. + This method raises the event when loading completes, even if the load was not successful. - -## Examples - The following code example demonstrates the use of the method to attach a .wav file to an instance of the class. This code example is part of a larger example provided for the class. - + +## Examples + The following code example demonstrates the use of the method to attach a .wav file to an instance of the class. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: + ]]> The elapsed time during loading exceeds the time, in milliseconds, specified by . The file specified by cannot be found. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -390,22 +388,22 @@ Loads a .wav file from a stream or a Web resource using a new thread. - is configured to load a .wav file from a or Web resource, this method begins loading a .wav file from the location using a new thread. - - This method raises the event when loading completes, even if the load was not successful. - - If a is configured to load a .wav file from a local file path, this method does nothing, because loading is deferred until playing begins. - - For more information about asynchronous loading, see [How to: Load a Sound Asynchronously within a Windows Form](/dotnet/framework/winforms/controls/how-to-load-a-sound-asynchronously-within-a-windows-form). - + is configured to load a .wav file from a or Web resource, this method begins loading a .wav file from the location using a new thread. + + This method raises the event when loading completes, even if the load was not successful. + + If a is configured to load a .wav file from a local file path, this method does nothing, because loading is deferred until playing begins. + + For more information about asynchronous loading, see [How to: Load a Sound Asynchronously within a Windows Form](/dotnet/desktop/winforms/controls/how-to-load-a-sound-asynchronously-within-a-windows-form). + This method stores in the task it returns all non-usage exceptions that the method's synchronous counterpart can throw. If an exception is stored into the returned task, that exception will be thrown when the task is awaited. Usage exceptions, such as , are still thrown synchronously. For the stored exceptions, see the exceptions thrown by . - -## Examples - The following code example demonstrates the use of the method to asynchronously load a .wav file for use by an instance of the class. This code example is part of a larger example provided for the class. - + +## Examples + The following code example demonstrates the use of the method to asynchronously load a .wav file for use by an instance of the class. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet3"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet3"::: @@ -416,8 +414,8 @@ This method stores in the task it returns all non-usage exceptions that the meth The file specified by cannot be found. - SoundPlayer Class Overview (Windows Forms) - How to: Load a Sound Asynchronously within a Windows Form + SoundPlayer Class Overview (Windows Forms) + How to: Load a Sound Asynchronously within a Windows Form @@ -451,26 +449,26 @@ This method stores in the task it returns all non-usage exceptions that the meth Occurs when a .wav file has been successfully or unsuccessfully loaded. - event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the class. - + event handler to receive a notification indicating that the contents of a .wav file have been loaded. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet8"::: + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -510,14 +508,14 @@ This method stores in the task it returns all non-usage exceptions that the meth Gets or sets the time, in milliseconds, in which the .wav file must load. The number of milliseconds to wait. The default is 10000 (10 seconds). - exception is thrown. - + exception is thrown. + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -554,22 +552,22 @@ This method stores in the task it returns all non-usage exceptions that the meth 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. + ]]> When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -606,22 +604,22 @@ This method stores in the task it returns all non-usage exceptions that the meth An that contains the event data. Raises the event. - has been set. - - Raising an event invokes the event handler through a delegate. For more information, see How to: Provide Event functionality and [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + has been set. + + Raising an event invokes the event handler through a delegate. For more information, see How to: Provide Event functionality and [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -658,22 +656,22 @@ This method stores in the task it returns all non-usage exceptions that the meth An that contains the event data. Raises the event. - audio source for this has been set. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + audio source for this has been set. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -713,22 +711,22 @@ This method stores in the task it returns all non-usage exceptions that the meth Plays the .wav file using a new thread, and loads the .wav file first if it has not been loaded. - method plays the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. - - - -## Examples - The following code example demonstrates the use of the method to asynchronously play a .wav file. This code example is part of a larger example provided for the class. - + method plays the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + + + +## Examples + The following code example demonstrates the use of the method to asynchronously play a .wav file. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet5"::: + ]]> The elapsed time during loading exceeds the time, in milliseconds, specified by . @@ -736,7 +734,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The .wav header is corrupted; the file specified by is not a PCM .wav file. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -776,24 +774,24 @@ This method stores in the task it returns all non-usage exceptions that the meth Plays and loops the .wav file using a new thread, and loads the .wav file first if it has not been loaded. - method plays and loops the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. - - For more information about , see [How to: Loop a Sound Playing on a Windows Form](/dotnet/framework/winforms/controls/how-to-loop-a-sound-playing-on-a-windows-form). - - - -## Examples - The following code example demonstrates the use of the method to repeatedly play a .wav file. The .wav will be played until the method is called. This code example is part of a larger example provided for the class. - + method plays and loops the sound using a new thread. If you call before the .wav file has been loaded into memory, the .wav file will be loaded before playback starts. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + + For more information about , see [How to: Loop a Sound Playing on a Windows Form](/dotnet/desktop/winforms/controls/how-to-loop-a-sound-playing-on-a-windows-form). + + + +## Examples + The following code example demonstrates the use of the method to repeatedly play a .wav file. The .wav will be played until the method is called. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet6"::: + ]]> The elapsed time during loading exceeds the time, in milliseconds, specified by . @@ -801,7 +799,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The .wav header is corrupted; the file specified by is not a PCM .wav file. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -841,22 +839,22 @@ This method stores in the task it returns all non-usage exceptions that the meth Plays the .wav file and loads the .wav file first if it has not been loaded. - method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. - - If the .wav file has not been specified or it fails to load, the method will play the default beep sound. - - - -## Examples - The following code example demonstrates the use of the method to synchronously play a .wav file. - + method uses the current thread to play a .wav file, preventing the thread from handling other messages until the load is complete. You can use the or method to load the .wav file to memory in advance. After a .wav file is successfully loaded from a or URL, future calls to playback methods for the will not need to reload the .wav file until the path for the sound changes. + + If the .wav file has not been specified or it fails to load, the method will play the default beep sound. + + + +## Examples + The following code example demonstrates the use of the method to synchronously play a .wav file. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/CPP/system.windows.forms.sound.playasync.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/PlaySync/system.windows.forms.sound.playasync.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/VB/system.windows.forms.sound.playasync.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PlaySync/VB/system.windows.forms.sound.playasync.vb" id="Snippet1"::: + ]]> The elapsed time during loading exceeds the time, in milliseconds, specified by . @@ -864,7 +862,7 @@ This method stores in the task it returns all non-usage exceptions that the meth The .wav header is corrupted; the file specified by is not a PCM .wav file. - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -904,23 +902,23 @@ This method stores in the task it returns all non-usage exceptions that the meth Gets or sets the file path or URL of the .wav file to load. The file path or URL from which to load a .wav file, or if no file path is present. The default is . - when the property is set to a . - - - -## Examples - The following code example demonstrates the use of the property to assign the .wav file source to an instance of the class. This code example is part of a larger example provided for the class. - + when the property is set to a . + + + +## Examples + The following code example demonstrates the use of the property to assign the .wav file source to an instance of the class. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet2"::: + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -954,25 +952,25 @@ This method stores in the task it returns all non-usage exceptions that the meth Occurs when a new audio source path for this has been set. - has been set. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates the use of the event handler to receive a notification when the has been attached to a different .wav file. This code example is part of a larger example provided for the class. - + has been set. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates the use of the event handler to receive a notification when the has been attached to a different .wav file. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet9"::: + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -1006,18 +1004,18 @@ This method stores in the task it returns all non-usage exceptions that the meth Stops playback of the sound if playback is occurring. - method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the class. - + method to halt a .wav file that is currently playing. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.Sound/CPP/soundtestform.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SoundPlayer/Overview/soundtestform.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Sound/VB/soundtestform.vb" id="Snippet7"::: + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -1052,15 +1050,15 @@ This method stores in the task it returns all non-usage exceptions that the meth Gets or sets the from which to load the .wav file. A from which to load the .wav file, or if no stream is available. The default is . - property is set to a new and valid sound location. - + property is set to a new and valid sound location. + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -1094,16 +1092,16 @@ This method stores in the task it returns all non-usage exceptions that the meth Occurs when a new audio source for this has been set. - audio source for this has been set. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - + audio source for this has been set. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + ]]> - SoundPlayer Class Overview (Windows Forms) + SoundPlayer Class Overview (Windows Forms) @@ -1146,11 +1144,11 @@ This method stores in the task it returns all non-usage exceptions that the meth The destination (see ) for this serialization. For a description of this member, see the method. - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Media/SystemSound.xml b/xml/System.Media/SystemSound.xml index 9d808bbae01..cc123412e32 100644 --- a/xml/System.Media/SystemSound.xml +++ b/xml/System.Media/SystemSound.xml @@ -28,20 +28,20 @@ Represents a system sound type. - property. - + property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -75,25 +75,25 @@ Plays the system sound type. - method plays the sound asynchronously. - - - -## Examples - The following code example demonstrates the use of the property. - + method plays the sound asynchronously. + + + +## Examples + The following code example demonstrates the use of the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) diff --git a/xml/System.Media/SystemSounds.xml b/xml/System.Media/SystemSounds.xml index 55ce7c95352..147a827a423 100644 --- a/xml/System.Media/SystemSounds.xml +++ b/xml/System.Media/SystemSounds.xml @@ -38,18 +38,18 @@ Retrieves sounds associated with a set of Windows operating system sound-event types. This class cannot be inherited. - class provides methods for retrieving the sounds associated with a set of operating system sound-event types for the current user. The sounds associated with each type of operating system sound event can be configured in Windows Control Panel. - - provides static methods to access the sounds associated with the , , , and sound events. Each property returns a that can be used to play the sound. - + class provides methods for retrieving the sounds associated with a set of operating system sound-event types for the current user. The sounds associated with each type of operating system sound event can be configured in Windows Control Panel. + + provides static methods to access the sounds associated with the , , , and sound events. Each property returns a that can be used to play the sound. + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -83,20 +83,20 @@ Gets the sound associated with the program event in the current Windows sound scheme. A associated with the program event in the current Windows sound scheme. - property. - + property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet1"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -133,20 +133,20 @@ property. - + +The following code example demonstrates the use of the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet2"::: -:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet2"::: - +:::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet2"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -180,20 +180,20 @@ The following code example demonstrates the use of the Gets the sound associated with the program event in the current Windows sound scheme. A associated with the program event in the current Windows sound scheme. - property. - + property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet3"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -227,20 +227,20 @@ The following code example demonstrates the use of the Gets the sound associated with the program event in the current Windows sound scheme. A associated with the program event in the current Windows sound scheme. - property. - + property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet4"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) @@ -274,20 +274,20 @@ The following code example demonstrates the use of the Gets the sound associated with the program event in the current Windows sound scheme. A associated with the program event in the current Windows sound scheme. - property. - + property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SystemSoundsExample/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Media/SystemSound/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SystemSoundsExample/VB/form1.vb" id="Snippet5"::: + ]]> - SoundPlayer Class (Windows Forms) + SoundPlayer Class (Windows Forms) diff --git a/xml/System.Windows.Data/RelativeSource.xml b/xml/System.Windows.Data/RelativeSource.xml index 2f1ab2ec0ac..12569221c39 100644 --- a/xml/System.Windows.Data/RelativeSource.xml +++ b/xml/System.Windows.Data/RelativeSource.xml @@ -33,27 +33,27 @@ Implements a markup extension that describes the location of the binding source relative to the position of the binding target. - property. This is the property type of that property. is simultaneously a markup extension implementation and a data object. When the extension returns itself (see ), the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form, so that the mode can be defined inline with the two extra arguments for ancestor type and level that the other modes do not require. - - For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - -## Examples - The following example shows a style trigger that creates a that reports a validation error message. Using the property, the value of the setter binds to the error content of the current (the using the style). For more information on this example, see [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation). - - :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: - - The following example shows the definition of a custom control called `NumericUpDown`. The property of the is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this is applied to in this case. - + property. This is the property type of that property. is simultaneously a markup extension implementation and a data object. When the extension returns itself (see ), the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form, so that the mode can be defined inline with the two extra arguments for ancestor type and level that the other modes do not require. + + For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). + +## Examples + The following example shows a style trigger that creates a that reports a validation error message. Using the property, the value of the setter binds to the error content of the current (the using the style). For more information on this example, see [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation). + + :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: + + The following example shows the definition of a custom control called `NumericUpDown`. The property of the is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this is applied to in this case. + :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/DefaultStyleKey/themes/generic.xaml" id="Snippetrelativesource"::: - - The following returns the second encountered on the upward path starting at the target element of the binding. - + + The following returns the second encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]> @@ -150,18 +150,18 @@ The ordinal position of the desired ancestor among all ancestors of the given type. Initializes a new instance of the class with an initial mode and additional tree-walking qualifiers for finding the desired relative source. - . Do not use this signature for the other values. - -## Examples - The following returns the second encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]> @@ -198,23 +198,23 @@ Gets or sets the level of ancestor to look for, in mode. Use 1 to indicate the one nearest to the binding target element. The ancestor level. Use 1 to indicate the one nearest to the binding target element. - property is not set explicitly, setting the or the property will implicitly lock the property value to . - - +If the property is not set explicitly, setting the or the property will implicitly lock the property value to . + + ## XAML Text Usage For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - -## Examples - The following returns the second encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]> @@ -253,23 +253,23 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Gets or sets the type of ancestor to look for. The type of ancestor. The default value is . - property is not set explicitly, setting the or the property will implicitly lock the property value to . - - +If the property is not set explicitly, setting the or the property will implicitly lock the property value to . + + ## XAML Text Usage For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - -## Examples - The following returns the second encountered on the upward path starting at the target element of the binding. - + +## Examples + The following returns the second encountered on the upward path starting at the target element of the binding. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Data/BindingOperations/SetBinding/Window1.xaml.cs" id="Snippetrelativesource"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Wpf/BindConversion/visualbasic/window1.xaml.vb" id="Snippetrelativesource"::: + ]]> The is not in the mode. @@ -315,15 +315,15 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Gets or sets a value that describes the location of the binding source relative to the position of the binding target. One of the values. The default value is . - or the and the properties will implicitly lock this property value to . - - -## XAML Text Usage - For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - + or the and the properties will implicitly lock this property value to . + + +## XAML Text Usage + For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). + ]]> This property is immutable after initialization. Instead of changing the on this instance, create a new or use a different static instance. @@ -357,15 +357,15 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Gets a static value that is used to return a constructed for the mode. A static . - values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. - - -## XAML Text Usage - For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - + values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. + + +## XAML Text Usage + For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). + ]]> @@ -402,11 +402,11 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Returns an object that should be set as the value on the target object's property for this markup extension. For , this is another , using the appropriate source for the specified mode. Another . - is simultaneously a markup extension implementation and a data object. When the extension returns itself, the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form so that the mode can be defined inline, with the two extra arguments for ancestor type and level that the other modes do not require. - + is simultaneously a markup extension implementation and a data object. When the extension returns itself, the relevant information is contained in the data. The main purpose of the markup extension is to allow a variable-argument constructor syntax in attribute form so that the mode can be defined inline, with the two extra arguments for ancestor type and level that the other modes do not require. + ]]> @@ -437,20 +437,20 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Gets a static value that is used to return a constructed for the mode. A static . - values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. - - -## XAML Text Usage + values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. + + +## XAML Text Usage For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - -## Examples - The following example shows a style trigger that creates a that reports a validation error message. The value of the setter binds to the error content of the current (the using the style) using the property. See [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation) for more information on this example. - - :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: - + +## Examples + The following example shows a style trigger that creates a that reports a validation error message. The value of the setter binds to the error content of the current (the using the style) using the property. See [How to: Implement Binding Validation](/dotnet/framework/wpf/data/how-to-implement-binding-validation) for more information on this example. + + :::code language="xaml" source="~/snippets/csharp/System.Windows/Setter/Value/Window1.xaml" id="Snippet5"::: + ]]> @@ -491,11 +491,11 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf if the property value has changed from its default; otherwise, . - property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the or developing your own control incorporating the . - + property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the or developing your own control incorporating the . + ]]> @@ -534,13 +534,13 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf if the property value has changed from its default; otherwise, . - property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the or developing your own control incorporating the . - - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). - + property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer for the or developing your own control incorporating the . + + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + ]]> @@ -633,20 +633,20 @@ For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf Gets a static value that is used to return a constructed for the mode. A static . - values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. - - -## XAML Text Usage + values, , , or , can produce a that is wholly static, containing no unique private values. All uses of the static property can share the same object, eliminating the need to allocate separate objects for each use. Therefore, using the static property reduces memory usage. + + +## XAML Text Usage For XAML information, see [RelativeSource MarkupExtension](/dotnet/framework/wpf/advanced/relativesource-markupextension). - -## Examples - The following example shows the definition of a custom control called `NumericUpDown`. The property of the is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this is applied to in this case. - + +## Examples + The following example shows the definition of a custom control called `NumericUpDown`. The property of the is bound to the `Value` of the object that is the `TemplatedParent`, which is the `NumericUpDown` control that this is applied to in this case. + :::code language="xaml" source="~/snippets/csharp/System.Windows/FrameworkElement/DefaultStyleKey/themes/generic.xaml" id="Snippetrelativesource"::: - + ]]> diff --git a/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml b/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml index 765b5c24e70..d4ce4adeb5f 100644 --- a/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml +++ b/xml/System.Windows.Forms.Design.Behavior/SnapLine.xml @@ -42,37 +42,37 @@ Represents the horizontal and vertical line segments that are dynamically created in the user interface (UI) to assist in the design-time layout of controls in a container. This class cannot be inherited. - class and related types help support the Snapline mode. - - Snaplines are generated dynamically and automatically as a control edge moves near another control or near the boundaries of its container. This can occur when a control is added from the toolbox, or moved or resized by mouse operations or keyboard commands. Controls typically have both horizontal and vertical snaplines defined; for rectangular controls, these typically extend from all four edges. - - The class uses only a few properties to describe each snapline, as shown in the following table. - -|Property|Description| -|--------------|-----------------| -||Specifies the location and direction of the line with respect to its associated control. Typically, only snaplines of similar types will auto-align to each other.| -||Specifies the distance in pixels from the origin, which is the upper-left corner of the control, to where the snapline starts.| -||Specifies the relative importance of the snapline. During any given layout decision point, only the snaplines that are active and have the highest priority are displayed.| -||Defines custom categories of snaplines. This is an optional string.| -| and |Indicates whether a snapline has horizontal or vertical orientation, respectively.| - - The class stores snaplines for its corresponding control type in the property. This base class handling of snaplines will suffice for the majority of controls, as it defines the , , , and snaplines, which are aligned along the edges of the control. When you are developing a custom control, if this default organization does not suffice, override the property of the class derived from . For example, you may want to align the horizontal snaplines of text-based controls, such as labels, with the top and base lines of the text (instead of the top and bottom edges of the control). - - The class cannot be derived from. - - There is extensive support for this feature in Visual Studio, see [Walkthrough: Arranging Controls on Windows Forms Using Snaplines](/dotnet/framework/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-snaplines). - + class and related types help support the Snapline mode. + + Snaplines are generated dynamically and automatically as a control edge moves near another control or near the boundaries of its container. This can occur when a control is added from the toolbox, or moved or resized by mouse operations or keyboard commands. Controls typically have both horizontal and vertical snaplines defined; for rectangular controls, these typically extend from all four edges. + + The class uses only a few properties to describe each snapline, as shown in the following table. + +|Property|Description| +|--------------|-----------------| +||Specifies the location and direction of the line with respect to its associated control. Typically, only snaplines of similar types will auto-align to each other.| +||Specifies the distance in pixels from the origin, which is the upper-left corner of the control, to where the snapline starts.| +||Specifies the relative importance of the snapline. During any given layout decision point, only the snaplines that are active and have the highest priority are displayed.| +||Defines custom categories of snaplines. This is an optional string.| +| and |Indicates whether a snapline has horizontal or vertical orientation, respectively.| + + The class stores snaplines for its corresponding control type in the property. This base class handling of snaplines will suffice for the majority of controls, as it defines the , , , and snaplines, which are aligned along the edges of the control. When you are developing a custom control, if this default organization does not suffice, override the property of the class derived from . For example, you may want to align the horizontal snaplines of text-based controls, such as labels, with the top and base lines of the text (instead of the top and bottom edges of the control). + + The class cannot be derived from. + + There is extensive support for this feature in Visual Studio, see [Walkthrough: Arranging Controls on Windows Forms Using Snaplines](/dotnet/desktop/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-snaplines). + ]]> @@ -89,11 +89,11 @@ Initializes a new instance of the class. - property of the class. - + property of the class. + ]]> @@ -136,11 +136,11 @@ The position of the snapline, in pixels, relative to the upper-left origin of the owning control. Initializes a new instance of the class using the specified snapline type and offset. - property to `null` and the property to . - + property to `null` and the property to . + ]]> @@ -188,11 +188,11 @@ A used to specify a programmer-defined category of snaplines. Initializes a new instance of the class using the specified snapline type, offset, and filter name. - property to . - + property to . + ]]> @@ -240,11 +240,11 @@ The of the snapline. Initializes a new instance of the class using the specified snapline type, offset, and priority. - property to `null`. - + property to `null`. + ]]> @@ -295,11 +295,11 @@ The of the snapline. Initializes a new instance of the class using the specified snapline type, offset, filter name, and priority. - @@ -341,11 +341,11 @@ The number of pixels to change the snapline offset by. Adjusts the property of the snapline. - property value. - + property value. + ]]> @@ -393,13 +393,13 @@ Gets the programmer-defined filter category associated with this snapline. A that defines the filter category. The default is . - property is used to define custom categories of snaplines. Only snaplines with the same filter name are able to snap to each other. This property can be used in custom control designers to expose different categories of snaplines depending upon the state of the control or the type of operation being performed. For example, round controls could offer a custom snapline with the filter value of "Center". - - This property is initialized during construction and cannot be changed thereafter. - + property is used to define custom categories of snaplines. Only snaplines with the same filter name are able to snap to each other. This property can be used in custom control designers to expose different categories of snaplines depending upon the state of the control or the type of operation being performed. For example, round controls could offer a custom snapline with the filter value of "Center". + + This property is initialized during construction and cannot be changed thereafter. + ]]> @@ -437,11 +437,11 @@ if the snapline is horizontal; otherwise, . - , , , and . - + , , , and . + ]]> @@ -478,11 +478,11 @@ if the snapline is vertical; otherwise, . - , , and . - + , , and . + ]]> @@ -524,13 +524,13 @@ Gets the number of pixels that the snapline is offset from the origin of the associated control. The offset, in pixels, of the snapline. - property is initialized at construction time, but it can be changed thereafter with the method. - + property is initialized at construction time, but it can be changed thereafter with the method. + ]]> @@ -572,15 +572,15 @@ Gets a value indicating the relative importance of the snapline. A that represents the priority category of a snapline. - property establishes categories of importance for the snaplines associated with a control. - - The Windows Forms Designer uses this property to determine which snaplines to display during a control addition, resize, or move operation. For more information, see the enumeration. - - This property is initialized during construction and cannot be changed thereafter. - + property establishes categories of importance for the snaplines associated with a control. + + The Windows Forms Designer uses this property to determine which snaplines to display during a control addition, resize, or move operation. For more information, see the enumeration. + + This property is initialized during construction and cannot be changed thereafter. + ]]> @@ -663,13 +663,13 @@ Gets the type of a snapline, which indicates the general location and orientation. A that represents the orientation and general location, relative to control edges, of a snapline. - property to direct snap alignment operations. Typically only snaplines that are similarly oriented can snap to each other. For example, two snaplines of type can snap together, but a and a snapline cannot. - - This property is initialized during construction and cannot be changed thereafter. - + property to direct snap alignment operations. Typically only snaplines that are similarly oriented can snap to each other. For example, two snaplines of type can snap together, but a and a snapline cannot. + + This property is initialized during construction and cannot be changed thereafter. + ]]> @@ -708,11 +708,11 @@ Returns a string representation of the current snapline. A that represents the current . - diff --git a/xml/System.Windows.Forms.Integration/ElementHost.xml b/xml/System.Windows.Forms.Integration/ElementHost.xml index f952d926503..ae621e2dae7 100644 --- a/xml/System.Windows.Forms.Integration/ElementHost.xml +++ b/xml/System.Windows.Forms.Integration/ElementHost.xml @@ -134,7 +134,7 @@ if the control adjusts its size to closely fit its contents; otherwise, . The default is . To be added. - AutoSize Property Overview + AutoSize Property Overview diff --git a/xml/System.Windows.Forms/Application.xml b/xml/System.Windows.Forms/Application.xml index e5dca371ae4..6403037a089 100644 --- a/xml/System.Windows.Forms/Application.xml +++ b/xml/System.Windows.Forms/Application.xml @@ -241,7 +241,7 @@ Gets the default color mode (dark mode) for the application. To be added. - This is the ; which either has been set by or its default value . + This is the ; which either has been set by or its default value . If it has been set to , then the actual color mode is determined by the system settings (which can be retrieved by the static (shared in VB) property. @@ -491,7 +491,7 @@ ## Remarks When you run a Windows Form, it creates the new form, which then waits for events to handle. Each time the form handles an event, it processes all the code associated with that event. All other events wait in the queue. While your code handles the event, your application does not respond. For example, the window does not repaint if another window is dragged on top. - If you call in your code, your application can handle the other events. For example, if you have a form that adds data to a and add to your code, your form repaints when another window is dragged over it. If you remove from your code, your form will not repaint until the click event handler of the button is finished executing. For more information on messaging, see [User Input in Windows Forms](/dotnet/framework/winforms/user-input-in-windows-forms). + If you call in your code, your application can handle the other events. For example, if you have a form that adds data to a and add to your code, your form repaints when another window is dragged over it. If you remove from your code, your form will not repaint until the click event handler of the button is finished executing. For more information on messaging, see [User Input in Windows Forms](/dotnet/desktop/winforms/user-input-in-windows-forms). Unlike Visual Basic 6.0, the method does not call the method. @@ -1797,12 +1797,12 @@ Sets the default color mode (dark mode) for the application. - You should use this method to set the default color mode (dark mode) for the application. Set it before creating any UI elements to ensure that the correct color mode - is used. You can set it to dark mode (), light mode () + You should use this method to set the default color mode (dark mode) for the application. Set it before creating any UI elements to ensure that the correct color mode + is used. You can set it to dark mode (), light mode () or to the system setting (). - If you set it to , the actual color mode is determined by the Windows system settings. If the system setting is changed, + If you set it to , the actual color mode is determined by the Windows system settings. If the system setting is changed, the application will not automatically adapt to the new setting. diff --git a/xml/System.Windows.Forms/AutoSizeMode.xml b/xml/System.Windows.Forms/AutoSizeMode.xml index c5b76db3d8b..195fd6c77f3 100644 --- a/xml/System.Windows.Forms/AutoSizeMode.xml +++ b/xml/System.Windows.Forms/AutoSizeMode.xml @@ -22,25 +22,25 @@ Specifies how a control will behave when its property is enabled. - property enabled but which have no - - `AutoSizeMode` property. The and properties are respected, but the current value of the property is ignored. - - - -## Examples - The following code example shows a form created using code that automatically resizes to fit its contents. When ran, the form will display a , a for entering a URL, and a for displaying that URL inside of the user's default Web browser. The code example uses a to lay out the contained controls one after the other, and sets the and to grow and shrink to fit the contents of its form. - + property enabled but which have no + + `AutoSizeMode` property. The and properties are respected, but the current value of the property is ignored. + + + +## Examples + The following code example shows a form created using code that automatically resizes to fit its contents. When ran, the form will display a , a for entering a URL, and a for displaying that URL inside of the user's default Web browser. The code example uses a to lay out the contained controls one after the other, and sets the and to grow and shrink to fit the contents of its form. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoSizeMode/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Form.AutoSize/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Form.AutoSize/VB/Form1.vb" id="Snippet1"::: + ]]> - AutoSize Property Overview + AutoSize Property Overview diff --git a/xml/System.Windows.Forms/AutoValidate.xml b/xml/System.Windows.Forms/AutoValidate.xml index 4a1247198d4..e5b92ed4123 100644 --- a/xml/System.Windows.Forms/AutoValidate.xml +++ b/xml/System.Windows.Forms/AutoValidate.xml @@ -22,21 +22,21 @@ Determines how a control validates its data when it loses user input focus. - to determine how to validate its data. This type of validation is called implicit validation, because it occurs without the application developer having to make an explicit call to or . - - The property corresponding to this value will have different defaults based on the type of control. For more information, see [User Input Validation in Windows Forms](/dotnet/framework/winforms/user-input-validation-in-windows-forms). - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + to determine how to validate its data. This type of validation is called implicit validation, because it occurs without the application developer having to make an explicit call to or . + + The property corresponding to this value will have different defaults based on the type of control. For more information, see [User Input Validation in Windows Forms](/dotnet/desktop/winforms/user-input-validation-in-windows-forms). + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/BindingNavigator.xml b/xml/System.Windows.Forms/BindingNavigator.xml index 69ea74e245b..053f29e3962 100644 --- a/xml/System.Windows.Forms/BindingNavigator.xml +++ b/xml/System.Windows.Forms/BindingNavigator.xml @@ -94,7 +94,7 @@ ]]> - BindingNavigator Control (Windows Forms) + BindingNavigator Control (Windows Forms) @@ -459,7 +459,7 @@ ## Examples - The following code example demonstrates how to use a control to move through a data set. The set is contained in a , which is bound to a control with a component. This code example is part of a larger example provided in [How to: Move Through a DataSet with the Windows Forms BindingNavigator Control](/dotnet/framework/winforms/controls/move-through-a-dataset-with-wf-bindingnavigator-control). + The following code example demonstrates how to use a control to move through a data set. The set is contained in a , which is bound to a control with a component. This code example is part of a larger example provided in [How to: Move Through a DataSet with the Windows Forms BindingNavigator Control](/dotnet/desktop/winforms/controls/move-through-a-dataset-with-wf-bindingnavigator-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingNavigator/Overview/form1.cs" id="Snippet1"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataNavigator/VB/form1.vb" id="Snippet1"::: diff --git a/xml/System.Windows.Forms/BindingSource.xml b/xml/System.Windows.Forms/BindingSource.xml index 0813575867e..5dc2dd08414 100644 --- a/xml/System.Windows.Forms/BindingSource.xml +++ b/xml/System.Windows.Forms/BindingSource.xml @@ -90,7 +90,7 @@ component serves many purposes. First, it simplifies binding controls on a form to data by providing currency management, change notification, and other services between Windows Forms controls and data sources. This is accomplished by attaching the component to your data source using the property. For complex binding scenarios you can optionally set the property to a specific column or list in the data source. You then bind controls to the . All further interaction with the data is accomplished with calls to the component. For examples on how the can simplify the binding process, see [How to: Bind Windows Forms Controls to DBNull Database Values](/dotnet/framework/winforms/controls/how-to-bind-windows-forms-controls-to-dbnull-database-values) and [How to: Handle Errors and Exceptions that Occur with Databinding](/dotnet/framework/winforms/controls/how-to-handle-errors-and-exceptions-that-occur-with-databinding). Navigation and updating of the data source is accomplished through methods such as , , and . Operations such as sorting and filtering are handled through the and properties. For more information on using sorting and filtering with the , see [How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component](/dotnet/framework/winforms/controls/sort-and-filter-ado-net-data-with-wf-bindingsource-component). + The component serves many purposes. First, it simplifies binding controls on a form to data by providing currency management, change notification, and other services between Windows Forms controls and data sources. This is accomplished by attaching the component to your data source using the property. For complex binding scenarios you can optionally set the property to a specific column or list in the data source. You then bind controls to the . All further interaction with the data is accomplished with calls to the component. For examples on how the can simplify the binding process, see [How to: Bind Windows Forms Controls to DBNull Database Values](/dotnet/desktop/winforms/controls/how-to-bind-windows-forms-controls-to-dbnull-database-values) and [How to: Handle Errors and Exceptions that Occur with Databinding](/dotnet/desktop/winforms/controls/how-to-handle-errors-and-exceptions-that-occur-with-databinding). Navigation and updating of the data source is accomplished through methods such as , , and . Operations such as sorting and filtering are handled through the and properties. For more information on using sorting and filtering with the , see [How to: Sort and Filter ADO.NET Data with the Windows Forms BindingSource Component](/dotnet/desktop/winforms/controls/sort-and-filter-ado-net-data-with-wf-bindingsource-component). In addition, the component can act as a strongly typed data source. Typically the type of the underlying data source is fixed through one of the following mechanisms: @@ -98,7 +98,7 @@ - Set the property to a list, single object, or type. - Both of these mechanisms create a strongly-typed list. For more information on how to use the to bind to a type, see [How to: Bind a Windows Forms Control to a Type](/dotnet/framework/winforms/controls/how-to-bind-a-windows-forms-control-to-a-type). You can also use the to bind your controls to a factory object. For more information on how to do this, see [How to: Bind a Windows Forms Control to a Factory Object](/dotnet/framework/winforms/controls/how-to-bind-a-windows-forms-control-to-a-factory-object). + Both of these mechanisms create a strongly-typed list. For more information on how to use the to bind to a type, see [How to: Bind a Windows Forms Control to a Type](/dotnet/desktop/winforms/controls/how-to-bind-a-windows-forms-control-to-a-type). You can also use the to bind your controls to a factory object. For more information on how to do this, see [How to: Bind a Windows Forms Control to a Factory Object](/dotnet/desktop/winforms/controls/how-to-bind-a-windows-forms-control-to-a-factory-object). > [!NOTE] > Because a handles both simple and complex data sources, terminology is problematic. Within this class documentation, the term *list* refers to a data collection within the hosted data source, and *item* denotes a single element. When discussing functionality associated with complex data sources, the equivalent terms *table* and *row* are used. @@ -129,7 +129,7 @@ - BindingSource Component + BindingSource Component @@ -355,7 +355,7 @@ ## Examples - The following code example uses a component to bind a list to a control. New items are added to the list by the event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/framework/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). + The following code example uses a component to bind a list to a control. New items are added to the list by the event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/desktop/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.AddingNew/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AddingNewEventArgs/Overview/form1.cs" id="Snippet8"::: @@ -419,7 +419,7 @@ ## Examples - The following code example uses a component to bind a list to a control. New items are added to the list by the event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/framework/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). + The following code example uses a component to bind a list to a control. New items are added to the list by the event handler. This code example is part of a larger example provided in [How to: Customize Item Addition with the Windows Forms BindingSource](/dotnet/desktop/winforms/controls/how-to-customize-item-addition-with-the-windows-forms-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.AddingNew/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/AddingNewEventArgs/Overview/form1.cs" id="Snippet7"::: @@ -1417,7 +1417,7 @@ ## Examples - The following code example assigns a list of customers to the of a component. This code example is part of a larger example provided at [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/framework/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). + The following code example assigns a list of customers to the of a component. This code example is part of a larger example provided at [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/desktop/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetItem/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/DataSource/form1.cs" id="Snippet6"::: @@ -3511,7 +3511,7 @@ ## Examples - The following code example uses a component to bind an array list, which does not provide change notification. An item is removed from the list, and the bound controls are notified of the change by calling the method. This code example is part of a larger example provided in [How to: Reflect Data Source Updates in a Windows Forms Control with the BindingSource](/dotnet/framework/winforms/controls/reflect-data-source-updates-in-a-wf-control-with-the-bindingsource). + The following code example uses a component to bind an array list, which does not provide change notification. An item is removed from the list, and the bound controls are notified of the change by calling the method. This code example is part of a larger example provided in [How to: Reflect Data Source Updates in a Windows Forms Control with the BindingSource](/dotnet/desktop/winforms/controls/reflect-data-source-updates-in-a-wf-control-with-the-bindingsource). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetBindings/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/ResetBindings/form1.cs" id="Snippet3"::: @@ -3599,7 +3599,7 @@ ## Examples - The following code example uses a component to bind a list to a control. The list does not raise change notifications, so the method on the is used to raise the event. This code example is part of a larger example provided in [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/framework/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). + The following code example uses a component to bind a list to a control. The list does not raise change notifications, so the method on the is used to raise the event. This code example is part of a larger example provided in [How to: Raise Change Notifications Using the BindingSource ResetItem Method](/dotnet/desktop/winforms/controls/how-to-raise-change-notifications-using-the-bindingsource-resetitem-method). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataConnector.ResetItem/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/BindingSource/DataSource/form1.cs" id="Snippet7"::: diff --git a/xml/System.Windows.Forms/ButtonRenderer.xml b/xml/System.Windows.Forms/ButtonRenderer.xml index b8ff7e694b5..d9a95eda918 100644 --- a/xml/System.Windows.Forms/ButtonRenderer.xml +++ b/xml/System.Windows.Forms/ButtonRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a button control with or without visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a button control. Rendering a control refers to drawing the user interface of a control. To draw a button, use one of the methods. These methods provide a variety of options, such as drawing text or an image on the button. - - If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the button with the current visual style. Otherwise, will draw the button with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the method to draw a button. When the button is clicked, the control draws a smaller button inside the bounds of the original button, and the control uses the method to paint over the rest of the original button. - + class provides a set of `static` methods that can be used to render a button control. Rendering a control refers to drawing the user interface of a control. To draw a button, use one of the methods. These methods provide a variety of options, such as drawing text or an image on the button. + + If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the button with the current visual style. Otherwise, will draw the button with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the method to draw a button. When the button is clicked, the control draws a smaller button inside the bounds of the original button, and the control uses the method to paint over the rest of the original button. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -101,11 +101,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds. - @@ -147,11 +147,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds, and with an optional focus rectangle. - @@ -197,11 +197,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds, with the specified image, and with an optional focus rectangle. - @@ -261,20 +261,20 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds, with the specified text, and with an optional focus rectangle. - method in a custom control's method to draw a button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + method in a custom control's method to draw a button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet2"::: + ]]> @@ -330,11 +330,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds, with the specified text and text formatting, and with an optional focus rectangle. - @@ -405,11 +405,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds, with the specified text and image, and with an optional focus rectangle. - @@ -476,11 +476,11 @@ One of the values that specifies the visual state of the button. Draws a button control in the specified state and bounds; with the specified text, text formatting, and image; and with an optional focus rectangle. - @@ -518,15 +518,15 @@ The control whose parent's background will be drawn. Draws the background of a control's parent in the specified area. - method to paint over an area of a custom control. This code example is part of a larger example provided for the class. - + method to paint over an area of a custom control. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ButtonRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ButtonRenderer/VB/form1.vb" id="Snippet4"::: + ]]> @@ -601,11 +601,11 @@ if the application state is used to determine rendering style; otherwise, . The default is . - property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. - + property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. + ]]> diff --git a/xml/System.Windows.Forms/CheckBox.xml b/xml/System.Windows.Forms/CheckBox.xml index 628bf1a7764..06a23479865 100644 --- a/xml/System.Windows.Forms/CheckBox.xml +++ b/xml/System.Windows.Forms/CheckBox.xml @@ -58,40 +58,40 @@ Represents a Windows . - to give the user an option, such as true/false or yes/no. The control can display an image or text or both. - - and controls have a similar function: they allow the user to choose from a list of options. controls let the user pick a combination of options. In contrast, controls allow a user to choose from mutually exclusive options. - - The property determines whether the appears as a typical or as a button. - - The property determines whether the control supports two or three states. Use the property to get or set the value of a two-state control and use the property to get or set the value of a three-state control. - + to give the user an option, such as true/false or yes/no. The control can display an image or text or both. + + and controls have a similar function: they allow the user to choose from a list of options. controls let the user pick a combination of options. In contrast, controls allow a user to choose from mutually exclusive options. + + The property determines whether the appears as a typical or as a button. + + The property determines whether the control supports two or three states. Use the property to get or set the value of a two-state control and use the property to get or set the value of a three-state control. + > [!NOTE] -> If the property is set to `true`, the property will return `true` for either a checked or indeterminate state. - - The property determines the style and appearance of the control. If the property is set to , the user's operating system determines the appearance of the control. - +> If the property is set to `true`, the property will return `true` for either a checked or indeterminate state. + + The property determines the style and appearance of the control. If the property is set to , the user's operating system determines the appearance of the control. + > [!NOTE] -> When the property is set to , the property is ignored and the control is displayed using the or alignment. If the property is set to one of the right alignments, the control is displayed using the alignment; otherwise, it is displayed using the alignment. - - The following describes an indeterminate state: You have a that determines if the selected text in a is bold. When you select text you can click the to bold the selection. Likewise, when you select some text, the displays whether the selected text is bold. If your selected text contains text that is bold and normal, the will have an indeterminate state. - - - -## Examples - The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . - +> When the property is set to , the property is ignored and the control is displayed using the or alignment. If the property is set to one of the right alignments, the control is displayed using the alignment; otherwise, it is displayed using the alignment. + + The following describes an indeterminate state: You have a that determines if the selected text in a is bold. When you select text you can click the to bold the selection. Likewise, when you select some text, the displays whether the selected text is bold. If your selected text contains text that is bold and normal, the will have an indeterminate state. + + + +## Examples + The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]> - CheckBox Control (Windows Forms) + CheckBox Control (Windows Forms) @@ -117,20 +117,20 @@ Initializes a new instance of the class. - is instantiated, is set to `true`, is set to `false`, and is set to . - - - -## Examples - The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . - + is instantiated, is set to `true`, is set to `false`, and is set to . + + + +## Examples + The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -177,20 +177,20 @@ Gets or sets the value that determines the appearance of a control. One of the values. The default value is . - value is set to , the has a typical appearance. If the value is set to `Button`, the appears like a toggle button, which can be toggled to an up or down state. - - - -## Examples - The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . - + value is set to , the has a typical appearance. If the value is set to `Button`, the appears like a toggle button, which can be toggled to an up or down state. + + + +## Examples + The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned is not one of the values. @@ -230,21 +230,21 @@ 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 type named `CheckBox1`. Then 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 type named `CheckBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet139"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet139"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet139"::: + ]]> @@ -292,20 +292,20 @@ if the value or value and the appearance of the control are automatically changed on the event; otherwise, . The default value is . - is set to false, you will need to add code to update the or values in the event handler. - - - -## Examples - The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . - + is set to false, you will need to add code to update the or values in the event handler. + + + +## Examples + The following code example creates and initializes a , gives it the appearance of a toggle button, sets to `false`, and adds it to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckBox Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -355,15 +355,15 @@ Gets or sets the horizontal and vertical alignment of the check mark on a control. One of the values. The default value is . - property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. - + property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned is not one of the enumeration values. @@ -419,22 +419,22 @@ Gets or set a value indicating whether the is in the checked state. - if the is in the checked state; otherwise, . The default value is . - + if the is in the checked state; otherwise, . The default value is . + Note: If the property is set to , the property will return for either a or . - portion of the control displays a check mark. If the property is set to `Button`, the control will appear sunken when is `true` and raised like a standard button when `false`. - -## Examples - The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between a value of `MiddleRight` and `MiddleLeft`. This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. - + +## Examples + The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between a value of `MiddleRight` and `MiddleLeft`. This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -474,21 +474,21 @@ Note: If the property 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 type named `CheckBox1`. Then 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 type named `CheckBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet140"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet140"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet140"::: + ]]> @@ -543,28 +543,28 @@ Note: If the property Gets or sets the state of the . One of the enumeration values. The default value is . - property is set to `false`, the property value can only be set to `CheckState.Indeterminate` in code and not by user interaction. - - The following table describes the of the control in its different states for the `Normal` and `Button` style control . - -|CheckState|Appearance.Normal|Appearance.Button| -|----------------|-----------------------|-----------------------| -|`Checked`|The displays a check mark.|The control appears sunken.| -|`Unchecked`|The is empty.|The control appears raised.| -|`Indeterminate`|The displays a check mark and is shaded.|The control appears flat.| - - - -## Examples - The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. - + property is set to `false`, the property value can only be set to `CheckState.Indeterminate` in code and not by user interaction. + + The following table describes the of the control in its different states for the `Normal` and `Button` style control . + +|CheckState|Appearance.Normal|Appearance.Button| +|----------------|-----------------------|-----------------------| +|`Checked`|The displays a check mark.|The control appears sunken.| +|`Unchecked`|The is empty.|The control appears raised.| +|`Indeterminate`|The displays a check mark and is shaded.|The control appears flat.| + + + +## Examples + The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This example requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned is not one of the enumeration values. @@ -605,21 +605,21 @@ Note: If the property 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 type named `CheckBox1`. Then 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 type named `CheckBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet141"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet141"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet141"::: + ]]> @@ -653,14 +653,14 @@ Note: If the property 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. - +> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -695,15 +695,15 @@ Note: If the property 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 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 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"::: + ]]> @@ -778,13 +778,13 @@ Note: If the property Occurs when the user double-clicks the control. - and enumerations are set to false for the control, and the event is not raised. - - This event is not relevant to this class. - + and enumerations are set to false for the control, and the event is not raised. + + This event is not relevant to this class. + ]]> @@ -829,13 +829,13 @@ Note: If the property Occurs when the user double-clicks the control. - and style bits are set to `false` for the control, and the event is not raised. - - This event is not relevant to this class. - + and style bits are set to `false` for the control, and the event is not raised. + + This event is not relevant to this class. + ]]> @@ -870,13 +870,13 @@ Note: If the property 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. + ]]> @@ -915,13 +915,13 @@ Note: If the property 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. + ]]> @@ -960,13 +960,13 @@ Note: If the property 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. + ]]> @@ -1005,15 +1005,15 @@ Note: If the property An that contains the event data. Raises the event. - method changes the property. If the property is set to `true`, subsequent clicks of the will result in cycling through all the values of the enumeration. Otherwise, switches between and . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 changes the property. If the property is set to `true`, subsequent clicks of the will result in cycling through all the values of the enumeration. Otherwise, switches between and . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1149,30 +1149,30 @@ Note: If the property 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"::: + ]]> @@ -1290,20 +1290,20 @@ if (CanSelect && IsMnemonic(charCode, MyControl.Text) { if the is able to display three check states; otherwise, . The default value is . - property is set to `false`, the property value can only be set to the `Indeterminate` value of in code and not by user interaction. - - - -## Examples - The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This code requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. - + property is set to `false`, the property value can only be set to the `Indeterminate` value of in code and not by user interaction. + + + +## Examples + The following code example displays the values of three properties in a label. The property alternates between `true` and `false` with alternating clicks of the control and the alternates between the `MiddleRight` and `MiddleLeft` values of . This example shows how the property values change as the property changes and the control is checked. This code requires that a , and have all been instantiated on a form and that the label is large enough to display three lines of text, as well as a reference to the namespace. This code should be called in the event handler of the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBox/CheckAlign/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckBox.CheckAlign Example/VB/source.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/CheckBoxRenderer.xml b/xml/System.Windows.Forms/CheckBoxRenderer.xml index 63fac80f4a5..51ba9a8406f 100644 --- a/xml/System.Windows.Forms/CheckBoxRenderer.xml +++ b/xml/System.Windows.Forms/CheckBoxRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a check box control with or without visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a check box control. Rendering a control refers to drawing the user interface of a control. To draw a check box, use one of the methods. These methods provide a variety of options, such as drawing text or an image with the check box. - - If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the check box with the current visual style. Otherwise, will draw the check box with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to write a custom control that uses the method to draw a check box that responds to mouse clicks. - + class provides a set of `static` methods that can be used to render a check box control. Rendering a control refers to drawing the user interface of a control. To draw a check box, use one of the methods. These methods provide a variety of options, such as drawing text or an image with the check box. + + If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the check box with the current visual style. Otherwise, will draw the check box with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to write a custom control that uses the method to draw a check box that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -101,11 +101,11 @@ One of the values that specifies the visual state of the check box. Draws a check box control in the specified state and location. - @@ -167,11 +167,11 @@ One of the values that specifies the visual state of the check box. Draws a check box control in the specified state and location, with the specified text, and with an optional focus rectangle. - @@ -229,20 +229,20 @@ One of the values that specifies the visual state of the check box. Draws a check box control in the specified state and location, with the specified text and text formatting, and with an optional focus rectangle. - method in a custom control's method to draw a check box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + method in a custom control's method to draw a check box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]> @@ -315,11 +315,11 @@ One of the values that specifies the visual state of the check box. Draws a check box control in the specified state and location, with the specified text and image, and with an optional focus rectangle. - @@ -388,11 +388,11 @@ One of the values that specifies the visual state of the check box. Draws a check box control in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle. - @@ -465,20 +465,20 @@ Returns the size of the check box glyph. A that represents the size of the check box glyph. - method to determine the bounds of the check box text. This code example is part of a larger example provided for the class. - + method to determine the bounds of the check box text. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.CheckBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> @@ -554,11 +554,11 @@ if the application state is used to determine rendering style; otherwise, . The default is . - property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. - + property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. + ]]> diff --git a/xml/System.Windows.Forms/CheckedListBox.xml b/xml/System.Windows.Forms/CheckedListBox.xml index 809d3892e22..a721ef416b1 100644 --- a/xml/System.Windows.Forms/CheckedListBox.xml +++ b/xml/System.Windows.Forms/CheckedListBox.xml @@ -43,69 +43,69 @@ Displays a in which a check box is displayed to the left of each item. - and . - - To add objects to the list at run time, assign an array of object references with the method. The list then displays the default string value for each object. You can add individual items to the list with the method. - - The object supports three states through the enumeration: , , and . You must set the state of in the code because the user interface for a does not provide a mechanism to do so. - - If is `true`, the will recognize and expand tab characters in an item's text, creating columns. These tab stops are preset and cannot be changed. To use custom tab stops, set to `false`, set to `true`, and add the custom values to the collection. - + and . + + To add objects to the list at run time, assign an array of object references with the method. The list then displays the default string value for each object. You can add individual items to the list with the method. + + The object supports three states through the enumeration: , , and . You must set the state of in the code because the user interface for a does not provide a mechanism to do so. + + If is `true`, the will recognize and expand tab characters in an item's text, creating columns. These tab stops are preset and cannot be changed. To use custom tab stops, set to `false`, set to `true`, and add the custom values to the collection. + > [!NOTE] -> If the property is `false`, the property will be ignored and replaced with standard tab offsets. - - The class supports the following three indexed collections: - -|Collection|Encapsulating Class| -|----------------|-------------------------| -|All items contained in the control.|| -|Checked items (including items in an indeterminate state), which is a subset of the items contained in the control.|| -|Checked indexes, which is a subset of the indexes into the items collection. These indexes specify items in a checked or indeterminate state.|| - - The following three tables are examples of the three indexed collections that the class supports. - - The first table provides an example of the indexed collection of items in the control (all items contained in the control). - -|Index|Item|Check State| -|-----------|----------|-----------------| -|0|Object 1|| -|1|Object 2|| -|2|Object 3|| -|3|Object 4|| -|4|Object 5|| - - The second table provides an example of the indexed collection of the checked items. - -|Index|Item| -|-----------|----------| -|0|Object 2| -|1|Object 4| -|2|Object 5| - - The third table provides an example of the indexed collection of indexes of checked items. - -|Index|Index of Item| -|-----------|-------------------| -|0|1| -|1|3| -|2|4| - - - -## Examples - The following example illustrates how you can use the methods, properties, and collections of a . This is a complete sample ready to run once you have copied it to your project. You can check and uncheck items, use the text box to add items and once you have clicked the save button, clear the checked items. - +> If the property is `false`, the property will be ignored and replaced with standard tab offsets. + + The class supports the following three indexed collections: + +|Collection|Encapsulating Class| +|----------------|-------------------------| +|All items contained in the control.|| +|Checked items (including items in an indeterminate state), which is a subset of the items contained in the control.|| +|Checked indexes, which is a subset of the indexes into the items collection. These indexes specify items in a checked or indeterminate state.|| + + The following three tables are examples of the three indexed collections that the class supports. + + The first table provides an example of the indexed collection of items in the control (all items contained in the control). + +|Index|Item|Check State| +|-----------|----------|-----------------| +|0|Object 1|| +|1|Object 2|| +|2|Object 3|| +|3|Object 4|| +|4|Object 5|| + + The second table provides an example of the indexed collection of the checked items. + +|Index|Item| +|-----------|----------| +|0|Object 2| +|1|Object 4| +|2|Object 5| + + The third table provides an example of the indexed collection of indexes of checked items. + +|Index|Index of Item| +|-----------|-------------------| +|0|1| +|1|3| +|2|4| + + + +## Examples + The following example illustrates how you can use the methods, properties, and collections of a . This is a complete sample ready to run once you have copied it to your project. You can check and uncheck items, use the text box to add items and once you have clicked the save button, clear the checked items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic CheckedListBox Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckedListBox Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic CheckedListBox Example/VB/source.vb" id="Snippet1"::: + ]]> - CheckedListBox Control (Windows Forms) + CheckedListBox Control (Windows Forms) @@ -131,11 +131,11 @@ Initializes a new instance of the class. - uses and the `ResizeRedraw` value of to specify that the control is redrawn when resized. - + uses and the `ResizeRedraw` value of to specify that the control is redrawn when resized. + ]]> @@ -181,22 +181,22 @@ Collection of checked indexes in this . The collection for the . - control. These indexes specify items in a checked or indeterminate state. - - - -## Examples - The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the property to get the , and the property to get the . - - The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. - + control. These indexes specify items in a checked or indeterminate state. + + + +## Examples + The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the property to get the , and the property to get the . + + The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]> @@ -243,38 +243,38 @@ Collection of checked items in this . The collection for the . - collection, representing only those items whose is `Checked` or `Indeterminate`. The indexes in this collection are in ascending order. - - - -## Examples - The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the property to get the , and the property to get the . - - The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. - - To run this example, perform the following steps: - -1. Create a new Windows Forms application. - -2. Add a and a to the form. - -3. Name the button `WhatIsChecked`, add a handler for its event, and copy in the code from the body of the following handler. - -4. Add some items to the . - -5. Run the example and check some of the check boxes in the list box. - -6. Click the button. - - You will see a series of message boxes that indicate which items were checked. - + collection, representing only those items whose is `Checked` or `Indeterminate`. The indexes in this collection are in ascending order. + + + +## Examples + The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the property to get the , and the property to get the . + + The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. + + To run this example, perform the following steps: + +1. Create a new Windows Forms application. + +2. Add a and a to the form. + +3. Name the button `WhatIsChecked`, add a handler for its event, and copy in the code from the body of the following handler. + +4. Add some items to the . + +5. Run the example and check some of the check boxes in the list box. + +6. Click the button. + + You will see a series of message boxes that indicate which items were checked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]> @@ -322,22 +322,22 @@ if the check mark is applied immediately; otherwise, . The default is . - indicates whether the check box should be toggled whenever an item is selected. The default behavior is to change the selection on the first click, and then have the user click again to apply the check mark. In some instances, however, you might prefer have the item checked as soon as it is clicked. - - - -## Examples - The following code example demonstrates initializing a control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. - - To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + indicates whether the check box should be toggled whenever an item is selected. The default behavior is to change the selection on the first click, and then have the user click again to apply the check mark. In some instances, however, you might prefer have the item checked as soon as it is clicked. + + + +## Examples + The following code example demonstrates initializing a control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. + + To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -391,23 +391,23 @@ Occurs when the user clicks the control. - event passes an to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (such as the button, number of clicks, wheel rotation, or location), use the and events, which pass a to the event handler. - - A double-click is determined by the mouse settings of the user's operating system. The user can adjust the amount of time that can pass between clicks during a double-click of a mouse button. The event is raised every time the user double-clicks a control. For example, if you have event-handling methods for the and events of a form, the events are raised when the form is double-clicked and both event-handling methods are called. If the user double-clicks a control that does not support the event, the event might be raised twice. - - - -## 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 type named `CheckedListBox1`. Then ensure that the event handler is associated with the event. - + event passes an to its event handler, so it only indicates that a click has occurred. If you need more specific mouse information (such as the button, number of clicks, wheel rotation, or location), use the and events, which pass a to the event handler. + + A double-click is determined by the mouse settings of the user's operating system. The user can adjust the amount of time that can pass between clicks during a double-click of a mouse button. The event is raised every time the user double-clicks a control. For example, if you have event-handling methods for the and events of a form, the events are raised when the form is double-clicked and both event-handling methods are called. If the user double-clicks a control that does not support the event, the event might be raised twice. + + + +## 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 type named `CheckedListBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet157"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet157"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet157"::: + ]]> @@ -440,14 +440,14 @@ 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. - +> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -513,21 +513,21 @@ Gets the required creation parameters when the control handle is created. A that contains the required parameters. - 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` structure documentation in the Windows Platform SDK reference at . - - - -## 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. - + + + +## 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"::: + ]]> @@ -659,24 +659,24 @@ The property should not be o Gets or sets a string that specifies a property of the objects contained in the list box whose contents you want to display. A string that specifies the name of a property of the objects contained in the list box. The default is an empty string (""). - displays the default string for the items it contains. However, the can display diverse types of objects and you may want to change the displayed string by specifying the property. If the specified property does not exist, or the value of the property is an empty string (""), the results of the object's method are displayed instead. - - If the new value of the cannot be set, the previous value is maintained. - - - -## Examples - The following code example demonstrates initializing a control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. - - To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + displays the default string for the items it contains. However, the can display diverse types of objects and you may want to change the displayed string by specifying the property. If the specified property does not exist, or the value of the property is an empty string (""), the results of the object's method are displayed instead. + + If the new value of the cannot be set, the previous value is maintained. + + + +## Examples + The following code example demonstrates initializing a control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. + + To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -765,13 +765,13 @@ The property should not be o Occurs when a visual aspect of an owner-drawn changes. This event is not relevant to this class. - . The event is raised only when the property is set to or . You can use this event to perform the tasks needed to draw items in the . If you have a variable-sized item (that is, is set to ), the event is raised before the item is drawn. You can create an event handler for the event to specify the size for the item that you are going to draw in your event handler for the event. - - This event is not relevant to this class. - + . The event is raised only when the property is set to or . You can use this event to perform the tasks needed to draw items in the . If you have a variable-sized item (that is, is set to ), the event is raised before the item is drawn. You can create an event handler for the event to specify the size for the item that you are going to draw in your event handler for the event. + + This event is not relevant to this class. + ]]> @@ -821,11 +821,11 @@ The property should not be o Gets a value indicating the mode for drawing elements of the . This property is not relevant to this class. Always a of . - @@ -862,17 +862,17 @@ The property should not be o if the item is checked; otherwise, . - returns `true` if the value of is `Checked` or `Indeterminate` for the item. To determine the specific state the item is in, use the method. - + returns `true` if the value of is `Checked` or `Indeterminate` for the item. To determine the specific state the item is in, use the method. + ]]> - The specified is less than zero. - - -or- - + The specified is less than zero. + + -or- + The specified is greater than or equal to the count of items in the list. @@ -909,28 +909,28 @@ The property should not be o Returns a value indicating the check state of the current item. One of the values. - method provides the ability to get the value of an item, given the index. If you never set the check state of an item to `Indeterminate`, then use the method. - - - -## Examples - The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the method to set the check state of an item. The example also demonstrates using the property to get the and the property to get the . - - The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. - + method provides the ability to get the value of an item, given the index. If you never set the check state of an item to `Indeterminate`, then use the method. + + + +## Examples + The following example enumerates the checked items in the to see what check state an item is in. The example demonstrates using the method to set the check state of an item. The example also demonstrates using the property to get the and the property to get the . + + The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]> - The specified is less than zero. - - -or- - + The specified is less than zero. + + -or- + The specified is greater than or equal to the count of items in the list. @@ -969,21 +969,21 @@ The property should not be o Occurs when the checked state of an item changes. - event occurs. - - - -## 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 type named `CheckedListBox1`. Then ensure that the event handler is associated with the event. - + event occurs. + + + +## 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 type named `CheckedListBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet156"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet156"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet156"::: + ]]> @@ -1033,13 +1033,13 @@ The property should not be o Gets the height of the item area. The height, in pixels, of the item area. - and override to return `base.ItemHeight+2`. - + and override to return `base.ItemHeight+2`. + ]]> @@ -1101,22 +1101,22 @@ The property should not be o Gets the collection of items in this . The collection representing the items in the . - property enables you to obtain a reference to the list of items that are currently stored in a control. With this reference, you can add items, remove items, and obtain a count of the items in the collection. For more information on the tasks that can be performed with the item collection, see the class reference topics. - - - -## Examples - The following example enumerates the checked items in the to see what check state an item is in. The example uses the property to get the to retrieve the index of an item using the method. The example also demonstrates using the property to get the , and the property to get the . - - The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. - + property enables you to obtain a reference to the list of items that are currently stored in a control. With this reference, you can add items, remove items, and obtain a count of the items in the collection. For more information on the tasks that can be performed with the item collection, see the class reference topics. + + + +## Examples + The following example enumerates the checked items in the to see what check state an item is in. The example uses the property to get the to retrieve the index of an item using the method. The example also demonstrates using the property to get the , and the property to get the . + + The first loop uses the method to get the of each checked item, given the index of the item. The second loop also uses , but uses the method to retrieve the index for the item. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet2"::: + ]]> @@ -1164,15 +1164,15 @@ The property should not be o Occurs when an owner-drawn is created and the sizes of the list items are determined. This event is not relevant to this class. - event. The event is raised only when the property is set to . - - The maximum height of a item is 255 pixels. - - This event is not relevant to this class. - + event. The event is raised only when the property is set to . + + The maximum height of a item is 255 pixels. + + This event is not relevant to this class. + ]]> @@ -1217,21 +1217,21 @@ The property should not be o Occurs when the user clicks the control with the mouse. - 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 type named `CheckedListBox1`. Then 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 type named `CheckedListBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet158"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet158"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet158"::: + ]]> @@ -1299,15 +1299,15 @@ The property should not be o An that contains the event data. Raises the event. - method selects or clears the check box of the item that is clicked. If the property is set to `true`, the check box is switched from a selected or cleared state the first time the item is clicked. Otherwise, the check box is switched only if the item is already selected. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 selects or clears the check box of the item that is clicked. If the property is set to `true`, the check box is switched from a selected or cleared state the first time the item is clicked. Otherwise, the check box is switched only if the item is already selected. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1345,13 +1345,13 @@ The property should not be o The object with the details. 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. + ]]> @@ -1389,13 +1389,13 @@ The property should not be o 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. + ]]> @@ -1433,13 +1433,13 @@ The property should not be o 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. + ]]> @@ -1477,13 +1477,13 @@ The property should not be o 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. + ]]> @@ -1521,15 +1521,15 @@ The property should not be o The that was raised. Raises the event. - property is not set to , the method switches the check state of the item currently selected. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + property is not set to , the method switches the check state of the item currently selected. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1567,13 +1567,13 @@ The property should not be o 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. + ]]> @@ -1611,13 +1611,13 @@ The property should not be o 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. + ]]> @@ -1669,13 +1669,13 @@ The property should not be o Gets or sets padding within the . This property is not relevant to this class. A representing the control's internal spacing characteristics. - that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications. - - This property is not relevant to this class. - + that are reasonably close to Windows user interface guidelines. Some adjustments might still be necessary for particular applications. + + This property is not relevant to this class. + ]]> @@ -1735,22 +1735,22 @@ The property should not be o Gets or sets a value specifying the selection mode. Either the or value of . - property determines whether one item in the list box can be selected or no items can be selected. For objects, multiple selection is not supported. You can set the mode to one item or no items. - - - -## Examples - The following code example demonstrates initializing a control by setting the to allow one item in the list to be selected. - - To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + property determines whether one item in the list box can be selected or no items can be selected. For objects, multiple selection is not supported. You can set the mode to one item or no items. + + + +## Examples + The following code example demonstrates initializing a control by setting the to allow one item in the list to be selected. + + To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]> An attempt was made to assign a value that is not a value of or . @@ -1791,28 +1791,28 @@ The property should not be o to set the item as checked; otherwise, . Sets for the item at the specified index to . - value to `Checked`. A value of `false` sets to `Unchecked`. - - - -## Examples - The following example enumerates the items in the and checks every other item in the list. The example demonstrates using the and methods to set the check state of an item. For every other item that is to be checked, is called to set the to `Indeterminate`, while is called on the other item to set the checked state to `Checked`. - - The example also demonstrates using the property to get the to get the of items. - + value to `Checked`. A value of `false` sets to `Unchecked`. + + + +## Examples + The following example enumerates the items in the and checks every other item in the list. The example demonstrates using the and methods to set the check state of an item. For every other item that is to be checked, is called to set the to `Indeterminate`, while is called on the other item to set the checked state to `Checked`. + + The example also demonstrates using the property to get the to get the of items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: + ]]> - The index specified is less than zero. - - -or- - + The index specified is less than zero. + + -or- + The index is greater than the count of items in the list. @@ -1848,30 +1848,30 @@ The property should not be o One of the values. Sets the check state of the item at the specified index. - method raises the event. - - Items whose is set to `Indeterminate` appear with a check mark in the check box, but the box is grayed to indicate the indeterminate status of the checked item. - - - -## Examples - The following example enumerates the items in the and checks every other item in the list. The example demonstrates using the and methods to set the check state of an item. For every other item that is to be checked, is called to set the to `Indeterminate`, while is called on the other item to set the checked state to `Checked`. - - The example also demonstrates using the property to get the to get the of items. - + method raises the event. + + Items whose is set to `Indeterminate` appear with a check mark in the check box, but the box is grayed to indicate the indeterminate status of the checked item. + + + +## Examples + The following example enumerates the items in the and checks every other item in the list. The example demonstrates using the and methods to set the check state of an item. For every other item that is to be checked, is called to set the to `Indeterminate`, while is called on the other item to set the checked state to `Checked`. + + The example also demonstrates using the property to get the to get the of items. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/CheckedListBox/CPP/source.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+CheckedIndexCollection/Overview/source.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/CheckedListBox/VB/source.vb" id="Snippet3"::: + ]]> - The specified is less than zero. - - -or- - + The specified is less than zero. + + -or- + The is greater than or equal to the count of items in the list. The is not one of the values. @@ -1911,17 +1911,17 @@ The property should not be o if the check box has a flat appearance; otherwise, . The default is . - control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. - - To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. - + control by setting the , , and properties. The example populates the with controls and sets the to the property of the control. + + To run the example, paste the following code in a form containing a named `CheckedListBox1` and call the `InitializeCheckListBox` method from the form's constructor or Load method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/CheckedListBox+ObjectCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PropertyGridExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1960,13 +1960,13 @@ The property should not be o if the class should be used to perform text rendering for compatibility with versions 1.0 and 1.1. of the .NET Framework; otherwise, . The default is . - class and .NET Framework 1.0 and .NET Framework 1.1 applications that perform custom text rendering using the class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. - - The GDI based class was introduced in the .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of the .NET Framework, the GDI+ based class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the class to render text, this could cause the text for controls that use to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true` for a specific control. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the method with a parameter of `true`. - + class and .NET Framework 1.0 and .NET Framework 1.1 applications that perform custom text rendering using the class. In most cases, if your application is not being upgraded from .NET Framework 1.0 or .NET Framework 1.1, it is recommended that you leave `UseCompatibleTextRendering` set to the default value of `false`. + + The GDI based class was introduced in the .NET Framework 2.0 to improve performance, make text look better, and improve support for international fonts. In earlier versions of the .NET Framework, the GDI+ based class was used to perform all text rendering. GDI calculates character spacing and word wrapping differently from GDI+. In a Windows Forms application that uses the class to render text, this could cause the text for controls that use to appear different from the other text in the application. To resolve this incompatibility, you can set the `UseCompatibleTextRendering` property to `true` for a specific control. To set `UseCompatibleTextRendering` to `true` for all supported controls in the application, call the method with a parameter of `true`. + ]]> @@ -2010,15 +2010,15 @@ The property should not be o Gets or sets a string that specifies the property of the data source from which to draw the value. A string that specifies the property of the data source from which to draw the value. - property in cases where you bind data. - - You can clear the property by setting the property to an empty string ("") or `null`. - - Setting a new property raises the and events. - + property in cases where you bind data. + + You can clear the property by setting the property to an empty string ("") or `null`. + + Setting a new property raises the and events. + ]]> The specified property cannot be found on the object specified by the property. @@ -2129,16 +2129,16 @@ The property should not be o The Windows to process. Processes Windows messages. - method to handle operating system messages identified in the structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at to understand the available , , and values. Actual constant values can be found in the Windows.h header file included in the Platform SDK (Core SDK section) download, which is also available at . -The following code example demonstrates overriding the method to handle operating system messages identified in the structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at to understand the available , , and values. Actual constant values can be found in the Windows.h header file included in the Platform SDK (Core SDK section) download, which is also available at . - :::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/Clipboard.xml b/xml/System.Windows.Forms/Clipboard.xml index 69bb3d691ca..3cd4ed3ba5c 100644 --- a/xml/System.Windows.Forms/Clipboard.xml +++ b/xml/System.Windows.Forms/Clipboard.xml @@ -34,48 +34,48 @@ Provides methods to place data on and retrieve data from the system Clipboard. This class cannot be inherited. - class, see the class. - - Call to put data on the Clipboard, replacing its current contents. To place a persistent copy of the data on the Clipboard, set the `copy` parameter to `true`. - + class, see the class. + + Call to put data on the Clipboard, replacing its current contents. To place a persistent copy of the data on the Clipboard, set the `copy` parameter to `true`. + > [!NOTE] -> To place data on the Clipboard in multiple formats, use the class or an implementation. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. - - Call to retrieve data from the Clipboard. The data is returned as an object that implements the interface. Use the methods specified by and fields in to extract the data from the object. If you do not know the format of the data you retrieved, call the method of the interface to get a list of all formats that data is stored in. Then call the method of the interface, and specify a format that your application can use. - - In .NET Framework 2.0, the class provides additional methods that make it easier to work with the system Clipboard. Call the method to remove all data from the Clipboard. To add data of a particular format to the Clipboard, replacing the existing data, call the appropriate `Set`*Format* method, such as , or call the method to specify the format. To retrieve data of a particular format from the Clipboard, first call the appropriate `Contains`*Format* method (such as ) method to determine whether the Clipboard contains data in that format, and then call the appropriate `Get`*Format* method (such as ) to retrieve the data if the Clipboard contains it. To specify the format in these operations, call the and methods instead. - +> To place data on the Clipboard in multiple formats, use the class or an implementation. Place data on the Clipboard in multiple formats to maximize the possibility that a target application, whose format requirements you might not know, can successfully retrieve the data. + + Call to retrieve data from the Clipboard. The data is returned as an object that implements the interface. Use the methods specified by and fields in to extract the data from the object. If you do not know the format of the data you retrieved, call the method of the interface to get a list of all formats that data is stored in. Then call the method of the interface, and specify a format that your application can use. + + In .NET Framework 2.0, the class provides additional methods that make it easier to work with the system Clipboard. Call the method to remove all data from the Clipboard. To add data of a particular format to the Clipboard, replacing the existing data, call the appropriate `Set`*Format* method, such as , or call the method to specify the format. To retrieve data of a particular format from the Clipboard, first call the appropriate `Contains`*Format* method (such as ) method to determine whether the Clipboard contains data in that format, and then call the appropriate `Get`*Format* method (such as ) to retrieve the data if the Clipboard contains it. To specify the format in these operations, call the and methods instead. + > [!NOTE] -> All Windows-based applications share the system Clipboard, so the contents are subject to change when you switch to another application. -> -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to a Clipboard method, the method will fail without throwing an exception. See for more information on serialization. If your target application requires a very specific data format, the headers added to the data in the serialization process may prevent the application from recognizing your data. To preserve your data format, add your data as a array to a and pass the to the method. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. -> +> All Windows-based applications share the system Clipboard, so the contents are subject to change when you switch to another application. +> +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to a Clipboard method, the method will fail without throwing an exception. See for more information on serialization. If your target application requires a very specific data format, the headers added to the data in the serialization process may prevent the application from recognizing your data. To preserve your data format, add your data as a array to a and pass the to the method. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. +> > Special considerations may be necessary when using the metafile format with the Clipboard. Due to a limitation in the current implementation of the class, the metafile format used by the .NET Framework may not be recognized by applications that use an older metafile format. In this case, you must interoperate with the Win32 Clipboard application programming interfaces (APIs). - - - -## Examples - The following code example uses methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on the form. - - The `button1_Click` method calls to take selected text from the text box and place it on the system Clipboard. - - The `button2_Click` method calls to retrieve data from the system Clipboard. The code uses and to extract the data returned and displays the data in `textBox2`. - + + + +## Examples + The following code example uses methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on the form. + + The `button1_Click` method calls to take selected text from the text box and place it on the system Clipboard. + + The `button2_Click` method calls to retrieve data from the system Clipboard. The code uses and to extract the data returned and displays the data in `textBox2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]> - Additional Security Considerations in Windows Forms + Additional Security Considerations in Windows Forms @@ -104,22 +104,22 @@ Removes all data from the Clipboard. - [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet1"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -154,22 +154,22 @@ if there is audio data on the Clipboard; otherwise, . - method. - + method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following code example demonstrates the use of this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -211,26 +211,26 @@ if there is data on the Clipboard that is in the specified or can be converted to that format; otherwise, . - class contains pre-defined format names that you can use with this method. - - Use this method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with the method. - + class contains pre-defined format names that you can use with this method. + + Use this method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with the method. + > [!NOTE] -> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -268,24 +268,24 @@ if there is a file drop list on the Clipboard; otherwise, . - method. - + method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -323,22 +323,22 @@ if there is image data on the Clipboard; otherwise, . - method. - + method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -388,24 +388,24 @@ if there is text data on the Clipboard; otherwise, . - format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method checks for the presence of data in the format. - - Use this method to determine whether the Clipboard contains text data before retrieving it with the method. - + format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method checks for the presence of data in the format. + + Use this method to determine whether the Clipboard contains text data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates an overload of the method that is similar to this overload. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates an overload of the method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -448,22 +448,22 @@ if there is text data on the Clipboard in the value specified for ; otherwise, . - method. - + method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -503,24 +503,24 @@ Retrieves an audio stream from the Clipboard. A containing audio data or if the Clipboard does not contain any data in the format. - method to determine whether the Clipboard contains audio data before retrieving it with this method. - - Use the method to add audio data to the Clipboard. - + method to determine whether the Clipboard contains audio data before retrieving it with this method. + + Use the method to add audio data to the Clipboard. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -568,28 +568,28 @@ Retrieves data from the Clipboard in the specified format. An representing the Clipboard data or if the Clipboard does not contain any data that is in the specified or can be converted to that format. - method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with this method. - - If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with automatic conversion set to `false`, this method returns `null`. - + method to determine whether the Clipboard contains data in the specified format or a compatible format before retrieving it with this method. + + If this method cannot find data in the specified format, it attempts to convert the data to the format. If the data cannot be converted to the specified format, or if the data was stored with automatic conversion set to `false`, this method returns `null`. + > [!NOTE] -> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - Use the method to add data to the Clipboard in a particular format. - - - -## Examples - The following example demonstrates this member. - +> Data can be converted to another format if it was stored specifying that conversion is allowed, and if the requested format is compatible with the stored format. For example, data stored as Unicode can be converted to text. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + Use the method to add data to the Clipboard in a particular format. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -629,29 +629,29 @@ Retrieves the data that is currently on the system Clipboard. An that represents the data currently on the Clipboard, or if there is no data on the Clipboard. - . Then you can use methods of the interface to extract the data in its proper data type. - - This method attempts to get the data ten times in 100-millisecond intervals, and throws an if all attempts are unsuccessful. - + . Then you can use methods of the interface to extract the data in its proper data type. + + This method attempts to get the data ten times in 100-millisecond intervals, and throws an if all attempts are unsuccessful. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following code example uses methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been placed on the form. - - The `button1_Click` method calls to take selected text from the text box and place it on the system Clipboard. - - The `button2_Click` method calls to retrieve data from the system Clipboard. The code uses and to extract the data returned. The data is displayed in `textBox2`. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following code example uses methods to place data on and retrieve it from the system Clipboard. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been placed on the form. + + The `button1_Click` method calls to take selected text from the text box and place it on the system Clipboard. + + The `button2_Click` method calls to retrieve data from the system Clipboard. The code uses and to extract the data returned. The data is displayed in `textBox2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]> Data could not be retrieved from the Clipboard. This typically occurs when the Clipboard is being used by another process. @@ -689,28 +689,28 @@ Retrieves a collection of file names from the Clipboard. A containing file names or if the Clipboard does not contain any data that is in the format or can be converted to that format. - array. This method converts this array to a and returns the collection. - - Use the method to determine whether the Clipboard contains a file drop list before retrieving it with this method. - - Use the method to add a file drop list to the Clipboard. - + array. This method converts this array to a and returns the collection. + + Use the method to determine whether the Clipboard contains a file drop list before retrieving it with this method. + + Use the method to add a file drop list to the Clipboard. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -749,24 +749,24 @@ Retrieves an image from the Clipboard. An representing the Clipboard image data or if the Clipboard does not contain any data that is in the format or can be converted to that format. - method to determine whether the Clipboard contains image data before retrieving it with this method. - - Use the method to add image data to the Clipboard. - + method to determine whether the Clipboard contains image data before retrieving it with this method. + + Use the method to add image data to the Clipboard. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -816,26 +816,26 @@ Retrieves text data from the Clipboard in the or format, depending on the operating system. The Clipboard text data or if the Clipboard does not contain data in the or format, depending on the operating system. - format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method returns text data in the format. - - Use the method to determine whether the Clipboard contains text data before retrieving it with this method. - - Use the method to add text data to the Clipboard. - + format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method returns text data in the format. + + Use the method to determine whether the Clipboard contains text data before retrieving it with this method. + + Use the method to add text data to the Clipboard. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates an overload of the method that is similar to this overload. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates an overload of the method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -875,24 +875,24 @@ Retrieves text data from the Clipboard in the format indicated by the specified value. The Clipboard text data or if the Clipboard does not contain data in the specified format. - method to determine whether the Clipboard contains text data before retrieving it with this method. - - Use the method to add text data to the Clipboard. - + method to determine whether the Clipboard contains text data before retrieving it with this method. + + Use the method to add text data to the Clipboard. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -945,22 +945,22 @@ A array containing the audio data. Clears the Clipboard and then adds a array in the format after converting it to a . - method to determine whether the Clipboard contains audio data before retrieving it with the method. - + method to determine whether the Clipboard contains audio data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates an overload of the method that is similar to this overload. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates an overload of the method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1001,22 +1001,22 @@ A containing the audio data. Clears the Clipboard and then adds a in the format. - method to determine whether the Clipboard contains audio data before retrieving it with the method. - + method to determine whether the Clipboard contains audio data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet20"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1059,26 +1059,26 @@ An representing the data to add. Clears the Clipboard and then adds data in the specified format. - method to determine whether the Clipboard contains data in that format before retrieving it with the method. - + method to determine whether the Clipboard contains data in that format before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet10"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1176,27 +1176,27 @@ The data to place on the Clipboard. Clears the Clipboard and then places nonpersistent data on it. - if all attempts are unsuccessful. - + if all attempts are unsuccessful. + > [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following code example uses to place nonpersistent text data onto the system Clipboard. In the `button1_Click` method, the selected text is copied from `textBox1` and pasted on the Clipboard. In the `button2_Click` method, the information is retrieved from the Clipboard and displayed in `textBox2`. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on a form. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following code example uses to place nonpersistent text data onto the system Clipboard. In the `button1_Click` method, the selected text is copied from `textBox1` and pasted on the Clipboard. In the `button2_Click` method, the information is retrieved from the Clipboard and displayed in `textBox2`. This code assumes `button1`, `button2`, `textBox1`, and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard Example/VB/source.vb" id="Snippet1"::: + ]]> Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process. @@ -1247,33 +1247,33 @@ if you want data to remain on the Clipboard after this application exits; otherwise, . Clears the Clipboard and then places data on it and specifies whether the data should remain after the application exits. - if all attempts are unsuccessful. - + if all attempts are unsuccessful. + > [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following method is run in an application. It places a persistent copy of the selected text data in the text box on the system Clipboard. This code assumes `button1`, `textBox1`, and `textBox2` have been created and placed on a form. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following method is run in an application. It places a persistent copy of the selected text data in the text box on the system Clipboard. This code assumes `button1`, `textBox1`, and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/SetDataObject/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet1"::: - - In a different application, the following method retrieves the text from the system Clipboard and pastes the text into `textBox2`. This code assumes `button2` and `textBox2` have been created and placed on a form. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet1"::: + + In a different application, the following method retrieves the text from the system Clipboard and pastes the text into `textBox2`. This code assumes `button2` and `textBox2` have been created and placed on a form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/CPP/source.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/SetDataObject/source.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic Clipboard.SetDataObject1 Example/VB/source.vb" id="Snippet2"::: + ]]> Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process. @@ -1321,28 +1321,28 @@ The number of milliseconds to pause between attempts. Clears the Clipboard and then attempts to place data on it the specified number of times and with the specified delay between attempts, optionally leaving the data on the Clipboard after the application exits. - [!NOTE] -> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. -> -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - +> An object must be serializable for it to be put on the Clipboard. If you pass a non-serializable object to this method, it will fail without throwing an exception. See for more information on serialization. +> +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + ]]> The current thread is not in single-threaded apartment (STA) mode. Add the to your application's method. is . - is less than zero. - - -or- - + is less than zero. + + -or- + is less than zero. Data could not be placed on the Clipboard. This typically occurs when the Clipboard is being used by another process. @@ -1380,26 +1380,26 @@ A containing the file names. Clears the Clipboard and then adds a collection of file names in the format. - array. This method converts `filePaths` to a array before adding it to the Clipboard. - - To retrieve a file drop list from the Clipboard, first use the method to determine whether the Clipboard contains data in that format before retrieving it with the method. - + array. This method converts `filePaths` to a array before adding it to the Clipboard. + + To retrieve a file drop list from the Clipboard, first use the method to determine whether the Clipboard contains data in that format before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet30"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1407,12 +1407,12 @@ is . - does not contain any strings. - - -or- - - At least one of the strings in is , contains only white space, contains one or more invalid characters as defined by , is , contains a colon (:), or exceeds the system-defined maximum length. - + does not contain any strings. + + -or- + + At least one of the strings in is , contains only white space, contains one or more invalid characters as defined by , is , contains a colon (:), or exceeds the system-defined maximum length. + See the property of the for more information. @@ -1448,22 +1448,22 @@ The to add to the Clipboard. Clears the Clipboard and then adds an in the format. - method to determine whether the Clipboard contains image data before retrieving it with the method. - + method to determine whether the Clipboard contains image data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet40"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1516,24 +1516,24 @@ The text to add to the Clipboard. Clears the Clipboard and then adds text data in the or format, depending on the operating system. - format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method adds text data in the format. - - To retrieve text data from the Clipboard, first use the method to determine whether the Clipboard contains text data before retrieving it with the method. - + format on Windows XP Home Edition, Windows XP Professional, Windows Server 2003 and Windows 2000. Otherwise, this method adds text data in the format. + + To retrieve text data from the Clipboard, first use the method to determine whether the Clipboard contains text data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates an overload of the method that is similar to this overload. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates an overload of the method that is similar to this overload. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. @@ -1576,22 +1576,22 @@ One of the values. Clears the Clipboard and then adds text data in the format indicated by the specified value. - method to determine whether the Clipboard contains text data before retrieving it with the method. - + method to determine whether the Clipboard contains text data before retrieving it with the method. + > [!NOTE] -> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. - - - -## Examples - The following example demonstrates this member. - +> The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. + + + +## Examples + The following example demonstrates this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Clipboard/Clear/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Clipboard/vb/form1.vb" id="Snippet50"::: + ]]> The Clipboard could not be cleared. This typically occurs when the Clipboard is being used by another process. diff --git a/xml/System.Windows.Forms/ComboBoxRenderer.xml b/xml/System.Windows.Forms/ComboBoxRenderer.xml index 32671c32f15..91e2ad656ea 100644 --- a/xml/System.Windows.Forms/ComboBoxRenderer.xml +++ b/xml/System.Windows.Forms/ComboBoxRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a combo box control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a combo box control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a combo box, use the method to draw the text box and the method to draw the drop-down arrow. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, and will draw the combo box with the current visual style. Otherwise, these methods will throw an . To determine whether the members of this class can be used, you can check the value of the property. - - This class wraps the functionality of a that is set to one of the elements exposed by the and classes. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the and methods to draw a combo box that responds to mouse clicks. - + class provides a set of `static` methods that can be used to render a combo box control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a combo box, use the method to draw the text box and the method to draw the drop-down arrow. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, and will draw the combo box with the current visual style. Otherwise, these methods will throw an . To determine whether the members of this class can be used, you can check the value of the property. + + This class wraps the functionality of a that is set to one of the elements exposed by the and classes. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the and methods to draw a combo box that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -90,30 +90,30 @@ One of the values that specifies the visual state of the drop-down arrow. Draws a drop-down arrow with the current visual style of the operating system. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a drop-down arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a drop-down arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -159,21 +159,21 @@ One of the values that specifies the visual state of the text box. Draws a text box in the specified state and bounds. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -228,21 +228,21 @@ One of the values that specifies the visual state of the text box. Draws a text box in the specified state and bounds, with the specified text. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -299,30 +299,30 @@ One of the values that specifies the visual state of the text box. Draws a text box in the specified state and bounds, with the specified text and text bounds. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a text box. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a text box. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -373,21 +373,21 @@ One of the values that specifies the visual state of the text box. Draws a text box in the specified state and bounds, with the specified text and text formatting. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -440,21 +440,21 @@ One of the values that specifies the visual state of the text box. Draws a text box in the specified state and bounds, with the specified text, text formatting, and text bounds. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -485,20 +485,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, . - or methods will throw an . - - - -## Examples - The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. - + or methods will throw an . + + + +## Examples + The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ComboBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ComboBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/ContainerControl.xml b/xml/System.Windows.Forms/ContainerControl.xml index 0a3e0938411..235b7915db7 100644 --- a/xml/System.Windows.Forms/ContainerControl.xml +++ b/xml/System.Windows.Forms/ContainerControl.xml @@ -42,18 +42,18 @@ Provides focus-management functionality for controls that can function as a container for other controls. - represents a control that can function as a container for other controls and provides focus management. Controls that inherit from this class can track the active control they contain, even when the focus moves somewhere within a different container. - - objects provide a logical boundary for contained controls. The container control can capture the TAB key press and move focus to the next control in the collection. - + represents a control that can function as a container for other controls and provides focus management. Controls that inherit from this class can track the active control they contain, even when the focus moves somewhere within a different container. + + objects provide a logical boundary for contained controls. The container control can capture the TAB key press and move focus to the next control in the collection. + > [!NOTE] -> The container control does not receive focus; the focus is always set to the first child control in the collection of contained controls. - - You do not typically inherit directly from the class. , , and classes inherit from . - +> The container control does not receive focus; the focus is always set to the first child control in the collection of contained controls. + + You do not typically inherit directly from the class. , , and classes inherit from . + ]]> @@ -86,15 +86,15 @@ Initializes a new instance of the class. - class and implements the interface. Implementation is added to the property and the method. - + class and implements the interface. Implementation is added to the property and the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]> @@ -156,22 +156,22 @@ Gets or sets the active control on the container control. The that is currently active on the . - property activates or retrieves the active control on the container control. - - In order to receive a valid value from this property, the object that calls it must either contain or be contained in the control it is calling. If one form tries to call another form's properties, it will receive an undefined value. In this case, you need to define your own communication mechanism between the forms to pass this data. - - - -## Examples - The following code example inherits from the class and implements the interface. Implementation is added to the property and the method. - + property activates or retrieves the active control on the container control. + + In order to receive a valid value from this property, the object that calls it must either contain or be contained in the control it is calling. If one form tries to call another form's properties, it will receive an undefined value. In this case, you need to define your own communication mechanism between the forms to pass this data. + + + +## Examples + The following code example inherits from the class and implements the interface. Implementation is added to the property and the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]> The assigned could not be activated. @@ -271,13 +271,13 @@ Gets or sets the dimensions that the control was designed to. A containing the dots per inch (DPI) or size that the control was designed to. - property represents the DPI or font setting of the screen that the control was scaled to or designed for. Specifically, at design time this property will be set by the Windows Forms designer to the value your monitor is currently using. Then, when the form loads at run time, if the property is different from the , the method will be called to perform scaling of the control and all of its children. Afterwards, will be updated to reflect the new scaling size. - - For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). - + property represents the DPI or font setting of the screen that the control was scaled to or designed for. Specifically, at design time this property will be set by the Windows Forms designer to the value your monitor is currently using. Then, when the form loads at run time, if the property is different from the , the method will be called to perform scaling of the control and all of its children. Afterwards, will be updated to reflect the new scaling size. + + For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). + ]]> The width or height of the value is less than 0 when setting this value. @@ -313,13 +313,13 @@ Gets the scaling factor between the current and design-time automatic scaling dimensions. A containing the scaling ratio between the current and design-time scaling automatic scaling dimensions. - property represents the scaling factor between the and properties. This value is calculated when it is required. For example, if is (192, 144) and is (96, 96) then the is (2.0, 1.5). - - For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). - + property represents the scaling factor between the and properties. This value is calculated when it is required. For example, if is (192, 144) and is (96, 96) then the is (2.0, 1.5). + + For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). + ]]> @@ -376,13 +376,13 @@ Gets or sets the automatic scaling mode of the control. An that represents the current scaling mode. The default is . - property specifies the current automatic scaling mode of this control. Scaling by is useful if you want to have a control or form stretch or shrink according to the size of the fonts in the operating system, and should be used when the absolute size of the control or form does not matter. Scaling by is useful when you want to size a control or form relative to the screen. For example, you may want to use dots per inch (DPI) scaling on a control displaying a chart or other graphic so that it always occupies a certain percentage of the screen. - - For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). - + property specifies the current automatic scaling mode of this control. Scaling by is useful if you want to have a control or form stretch or shrink according to the size of the fonts in the operating system, and should be used when the absolute size of the control or form does not matter. Scaling by is useful when you want to size a control or form relative to the screen. For example, you may want to use dots per inch (DPI) scaling on a control displaying a chart or other graphic so that it always occupies a certain percentage of the screen. + + For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). + ]]> An value that is not valid was used to set this property. @@ -432,21 +432,21 @@ Gets or sets a value that indicates whether controls in this container will be automatically validated when the focus changes. An enumerated value that indicates whether contained controls are implicitly validated on focus change. The default is . - will differ for each control. For more details on implicit validation, see [User Input Validation in Windows Forms](/dotnet/framework/winforms/user-input-validation-in-windows-forms). - - Setting this property to a new value will raise the event. - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + will differ for each control. For more details on implicit validation, see [User Input Validation in Windows Forms](/dotnet/desktop/winforms/user-input-validation-in-windows-forms). + + Setting this property to a new value will raise the event. + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]> An value that is not valid was used to set this property. @@ -495,18 +495,18 @@ Occurs when the property changes. - - - - + + + + ]]> @@ -579,13 +579,13 @@ in all cases. - class can enable native IME support by overriding this property to return `true`. However, the application is then responsible for making sure that there are no conflicts between the native IME and the Windows Forms IME. This scenario is not supported. - + class can enable native IME support by overriding this property to return `true`. However, the application is then responsible for making sure that there are no conflicts between the native IME and the Windows Forms IME. This scenario is not supported. + ]]> @@ -655,21 +655,21 @@ Gets the current run-time dimensions of the screen. A containing the current dots per inch (DPI) or size of the screen. - property represents the reference dimensions on the current screen. In contrast, the property represents the design-time reference dimensions of the design environment for the current control, while the property is the ratio of the two. - - The interpretation of the dimension value depends on the property in the following ways: - -- If the mode is , this property represents the resolution of the screen, in dots per inch. - -- If the mode is , this property represents the average font character size in pixels. - - If the property is set to , is set equal to . - - For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). - + property represents the reference dimensions on the current screen. In contrast, the property represents the design-time reference dimensions of the design environment for the current control, while the property is the ratio of the two. + + The interpretation of the dimension value depends on the property in the following ways: + +- If the mode is , this property represents the resolution of the screen, in dots per inch. + +- If the mode is , this property represents the average font character size in pixels. + + If the property is set to , is set equal to . + + For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). + ]]> A Win32 device context could not be created for the current screen. @@ -742,13 +742,13 @@ 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. + ]]> @@ -825,15 +825,15 @@ An that contains the event data. Raises the event. - will cause the layout to be recalculated and reapplied to the contained controls if the property has a value of . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + will cause the layout to be recalculated and reapplied to the contained controls if the property has a value of . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1007,19 +1007,19 @@ Gets the form that the container control is assigned to. The that the container control is assigned to. This property will return null if the control is hosted inside of Internet Explorer or in another hosting context where there is no parent form. - property of `Form1` to `true` and make it the of `Form2`. Next, create a button, `button1`, on each form. When the button on the parent form is clicked, the event handler displays the child form. When the button on the child form is clicked, the event handler displays the property of its parent form. Use the following two code segments to overwrite `button1` event handlers in both forms. - + property of `Form1` to `true` and make it the of `Form2`. Next, create a button, `button1`, on each form. When the button on the parent form is clicked, the event handler displays the child form. When the button on the child form is clicked, the event handler displays the property of its parent form. Use the following two code segments to overwrite `button1` event handlers in both forms. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ParentForm2/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ParentForm/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form1.vb" id="Snippet1"::: + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ParentForm2/CPP/form2.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ParentForm/form2.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form2.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ParentForm2/VB/form2.vb" id="Snippet2"::: + ]]> @@ -1057,15 +1057,15 @@ Performs scaling of the container control and its children. - method is typically only required after programmatic changes to the layout during run time. is implicitly called from the method. - - is recursive; each child control, if it is a container, will have its version of this method called when the container's version executes. - - For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). - + method is typically only required after programmatic changes to the layout during run time. is implicitly called from the method. + + is recursive; each child control, if it is a container, will have its version of this method called when the container's version executes. + + For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). + ]]> @@ -1258,11 +1258,11 @@ if a control is selected; otherwise, . - property set to `false` cannot be selected, so the next available control will be selected. - + property set to `false` cannot be selected, so the next available control will be selected. + ]]> @@ -1401,20 +1401,20 @@ if the control is successfully activated; otherwise, . - class and implement the interface. Implementation is added to the property and the method. - + class and implement the interface. Implementation is added to the property and the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/IContainerControl Implementation/CPP/mycontainercontrol.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/.ctor/mycontainercontrol.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/IContainerControl Implementation/VB/mycontainercontrol.vb" id="Snippet1"::: + ]]> @@ -1447,11 +1447,11 @@ When overridden by a derived class, updates which button is the default button. - class does not provide an implementation for the method. Classes that inherit this method must implement to update the default button. - + class does not provide an implementation for the method. Classes that inherit this method must implement to update the default button. + ]]> @@ -1500,11 +1500,11 @@ if validation is successful; otherwise, . If called from the or event handlers, this method will always return . - method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version always performs validation, regardless of the value of the property of the control's parent. Therefore use it to unconditionally force validation. - + method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version always performs validation, regardless of the value of the property of the control's parent. Therefore use it to unconditionally force validation. + ]]> @@ -1543,15 +1543,15 @@ if validation is successful; otherwise, . If called from the or event handlers, this method will always return . - method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version performs validation based on the following conditions: - -- If the `checkAutoValidate` parameter is `true`, validation always occurs for child controls that are not validated. - -- If the `checkAutoValidate` parameter is `false`, validation occurs only if the property of the control's parent is enabled. - + method validates the last child control that is not validated and its ancestors up through, but not including, the current container control. This overloaded version performs validation based on the following conditions: + +- If the `checkAutoValidate` parameter is `true`, validation always occurs for child controls that are not validated. + +- If the `checkAutoValidate` parameter is `false`, validation occurs only if the property of the control's parent is enabled. + ]]> @@ -1611,23 +1611,23 @@ if all of the children validated successfully; otherwise, . If called from the or event handlers, this method will always return . - will descend a control's hierarchy and examine each control to see if it supports validation. If the control can be selected by the user and its property is `true`, will cause the event to occur. If any of the controls cancel the event, this method will return `false`; otherwise, it will return `true`. - - If a control is bound to a data source, and the event occurs, it will cause the control to push its current data back to the data source. - - Calling is equivalent to calling with a of . - - - -## Examples - The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. - + will descend a control's hierarchy and examine each control to see if it supports validation. If the control can be selected by the user and its property is `true`, will cause the event to occur. If any of the controls cancel the event, this method will return `false`; otherwise, it will return `true`. + + If a control is bound to a data source, and the event occurs, it will cause the control to push its current data back to the data source. + + Calling is equivalent to calling with a of . + + + +## Examples + The following code example turns off implicit validation for a form and all of its contained controls, and instead manually performs validation of all of the form's children when a mouse button is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/AutoValidate/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildren/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -1673,27 +1673,27 @@ if all of the children validated successfully; otherwise, . If called from the or event handlers, this method will always return . - will examine all the children of the current control, causing the event to occur on a control if it meets the criteria spelled out by . - - You may use several parameters at once by combining them with a bitwise OR operator. Combining parameters with a bitwise OR operator will result in a logical AND operation. For example, calling `ValidateChildren(ValidationConstraints.ImmediateChildren | ValidationConstraints.Enabled)` will only raise the event on controls that are both immediate children of the container AND are enabled. - - Regardless of which parameters you specify for this method, a control must have its property set to `true` in order for its event to occur. You should also set the property of the control or of the control's container to `false` if you want validation to happen only when you call , and not when the user shifts focus from the control. - - If a control is bound to a data source, and the event occurs, it will cause the control to push its current data back to the data source. - - You cannot achieve the opposite effect of a parameter by applying a bitwise negation operator. For example, if you supply the negative value of the field to , it will not validate all children that are not visible on the container. Supplying any negative parameter to will have no effect on the container or its children. - - - -## Examples - The following code example will only cause the event to occur for immediate children of the form whose property is `true`. - + will examine all the children of the current control, causing the event to occur on a control if it meets the criteria spelled out by . + + You may use several parameters at once by combining them with a bitwise OR operator. Combining parameters with a bitwise OR operator will result in a logical AND operation. For example, calling `ValidateChildren(ValidationConstraints.ImmediateChildren | ValidationConstraints.Enabled)` will only raise the event on controls that are both immediate children of the container AND are enabled. + + Regardless of which parameters you specify for this method, a control must have its property set to `true` in order for its event to occur. You should also set the property of the control or of the control's container to `false` if you want validation to happen only when you call , and not when the user shifts focus from the control. + + If a control is bound to a data source, and the event occurs, it will cause the control to push its current data back to the data source. + + You cannot achieve the opposite effect of a parameter by applying a bitwise negation operator. For example, if you supply the negative value of the field to , it will not validate all children that are not visible on the container. Supplying any negative parameter to will have no effect on the container or its children. + + + +## Examples + The following code example will only cause the event to occur for immediate children of the form whose property is `true`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContainerControl/ValidateChildren/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildrenWithConstraints/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidateChildrenWithConstraints/VB/Form1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/ContextMenuStrip.xml b/xml/System.Windows.Forms/ContextMenuStrip.xml index 652d1d9b1bb..35b6e395bd8 100644 --- a/xml/System.Windows.Forms/ContextMenuStrip.xml +++ b/xml/System.Windows.Forms/ContextMenuStrip.xml @@ -78,7 +78,7 @@ - ContextMenuStrip Control + ContextMenuStrip Control diff --git a/xml/System.Windows.Forms/Control.xml b/xml/System.Windows.Forms/Control.xml index 76b850351fd..0f84babdd1b 100644 --- a/xml/System.Windows.Forms/Control.xml +++ b/xml/System.Windows.Forms/Control.xml @@ -108,7 +108,7 @@ , 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). + To create your own control class, inherit from the , 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/desktop/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`). @@ -129,7 +129,7 @@ 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://learn.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). + 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/desktop/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). ]]> @@ -2625,7 +2625,7 @@ The following table lists Windows Forms controls and which event ( 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). + For more information about drawing on controls, see [Rendering a Windows Forms Control](/dotnet/desktop/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). +> You cannot bind application settings to this property. For more information on application settings, see [Application Settings Overview](/dotnet/desktop/winforms/advanced/application-settings-overview). @@ -9026,7 +9026,7 @@ MyControl.Font = New Font(MyControl.Font, _ > [!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). + For more information about multithreaded Windows Forms controls, see [How to: Use a Background Thread to Search for Files](/dotnet/desktop/winforms/controls/how-to-use-a-background-thread-to-search-for-files) and [How to: Make Thread-Safe Calls to Windows Forms Controls](/dotnet/desktop/winforms/controls/how-to-make-thread-safe-calls-to-windows-forms-controls). ]]> @@ -16126,7 +16126,7 @@ MyControl.Font = New Font(MyControl.Font, _ ## Remarks The 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). + 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/desktop/winforms/controls/overriding-the-onpaint-method) and [Custom Control Painting and Rendering](/dotnet/desktop/winforms/controls/custom-control-painting-and-rendering). For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -19968,7 +19968,7 @@ The following code example selects the specified 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. + For more information about drawing on controls, see Rendering a Windows Forms Control. diff --git a/xml/System.Windows.Forms/DataGrid.xml b/xml/System.Windows.Forms/DataGrid.xml index adf9e2eb6ce..de02c14693b 100644 --- a/xml/System.Windows.Forms/DataGrid.xml +++ b/xml/System.Windows.Forms/DataGrid.xml @@ -71,115 +71,115 @@ Displays ADO.NET data in a scrollable grid. - + This class is not available in .NET Core 3.1 and later versions. Use the control instead, which replaces and extends the control. - control instead. - The displays Web-like links to child tables. You can click on a link to navigate to the child table. When a child table is displayed, a back button appears in the caption that can be clicked to navigate back to the parent table. The data from the parent rows is displayed below the caption and above the column headers. You can hide the parent row information by clicking the button to the right of the back button. - - To display a table in the at run time, use the method to set the and properties to a valid data source. The following data sources are valid: - -- A - -- A - -- A - -- A - -- A single dimension array - -- Any component that implements the interface - -- Any component that implements the interface - - For more information about the class, see [DataSets, DataTables, and DataViews](/dotnet/framework/data/adonet/dataset-datatable-dataview/). - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. - - Data sources are further managed by objects. For each table in a data source, a can be returned from the form's . For example, you can determine the number of rows contained by a data source by returning the associated object's property. - - To validate data, use the underlying objects that represent data and their events. For example, if the data comes from a in a , use the and events. - + The displays Web-like links to child tables. You can click on a link to navigate to the child table. When a child table is displayed, a back button appears in the caption that can be clicked to navigate back to the parent table. The data from the parent rows is displayed below the caption and above the column headers. You can hide the parent row information by clicking the button to the right of the back button. + + To display a table in the at run time, use the method to set the and properties to a valid data source. The following data sources are valid: + +- A + +- A + +- A + +- A + +- A single dimension array + +- Any component that implements the interface + +- Any component that implements the interface + + For more information about the class, see [DataSets, DataTables, and DataViews](/dotnet/framework/data/adonet/dataset-datatable-dataview/). + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. + + Data sources are further managed by objects. For each table in a data source, a can be returned from the form's . For example, you can determine the number of rows contained by a data source by returning the associated object's property. + + To validate data, use the underlying objects that represent data and their events. For example, if the data comes from a in a , use the and events. + > [!NOTE] -> Because the number of columns can be customized (by adding or deleting members of the ) and the rows can be sorted by column, the and property values cannot be guaranteed to correspond to and indexes in a . Therefore you should avoid using those properties in the event to validate data. - - To determine which cell is selected, use the property. Change the value of any cell by using the property, which can take either the row and column indexes of the cell, or a single . Monitor the event to detect when the user selects another cell. - - To determine which part of the control the user clicked, use the method in the event. The method returns a object, which contains the row and column of a clicked area. - - To manage the appearance of the control at run time, several properties for setting the color and caption attributes are available, including the , , , and so on. - - The appearance of the displayed grid (or grids) can be further modified by creating objects and adding them to the , which is accessed through the property. For example, if the is set to a containing three objects, you can add three objects to the collection, one for each table. To synchronize each object with a , set the of the to the of the . For more information about binding to an array of objects, see the property. - - To create a customized view of a table, create an instance of a or class and add the object to the accessed through the property. Both classes inherit from . For each column style, set the to the of a column that you want to show in the grid. To hide a column, set its to something other than a valid . - - To format the text of a column, set the property of the to one of the values found in [Formatting Types](/dotnet/standard/base-types/formatting-types) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). - - To bind the to a strongly typed array of objects, the object type must contain public properties. To create a that displays the array, set the property to `typename[]` where `typename` is replaced by the name of the object type. Also note that the property is case-sensitive; the type name must be matched exactly. See the property for an example. - - You can also bind the to an . A feature of the is that it can contain objects of multiple types, but the can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a , the second item could be a (which inherits from ). If, on the other hand, the first item is a , the second object cannot be a . Further, the must have items in it when it is bound. An empty will result in an empty grid. In addition, the objects in the must contain public properties. When binding to an , set the of the to "ArrayList" (the type name). - - For each , you can set color and caption attributes that override the settings for the control. However, if those properties are not set, the settings for the control are used by default. The following properties can be overridden by properties: - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - To customize the appearance of individual columns, add objects to the , which is accessed through the property of each . To synchronize each with a in the , set the to the of a . When constructing a , you can also set a formatting string that specifies how the column displays data. For example, you can specify that the column use a short-date format to display dates contained in the table. - +> Because the number of columns can be customized (by adding or deleting members of the ) and the rows can be sorted by column, the and property values cannot be guaranteed to correspond to and indexes in a . Therefore you should avoid using those properties in the event to validate data. + + To determine which cell is selected, use the property. Change the value of any cell by using the property, which can take either the row and column indexes of the cell, or a single . Monitor the event to detect when the user selects another cell. + + To determine which part of the control the user clicked, use the method in the event. The method returns a object, which contains the row and column of a clicked area. + + To manage the appearance of the control at run time, several properties for setting the color and caption attributes are available, including the , , , and so on. + + The appearance of the displayed grid (or grids) can be further modified by creating objects and adding them to the , which is accessed through the property. For example, if the is set to a containing three objects, you can add three objects to the collection, one for each table. To synchronize each object with a , set the of the to the of the . For more information about binding to an array of objects, see the property. + + To create a customized view of a table, create an instance of a or class and add the object to the accessed through the property. Both classes inherit from . For each column style, set the to the of a column that you want to show in the grid. To hide a column, set its to something other than a valid . + + To format the text of a column, set the property of the to one of the values found in [Formatting Types](/dotnet/standard/base-types/formatting-types) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). + + To bind the to a strongly typed array of objects, the object type must contain public properties. To create a that displays the array, set the property to `typename[]` where `typename` is replaced by the name of the object type. Also note that the property is case-sensitive; the type name must be matched exactly. See the property for an example. + + You can also bind the to an . A feature of the is that it can contain objects of multiple types, but the can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a , the second item could be a (which inherits from ). If, on the other hand, the first item is a , the second object cannot be a . Further, the must have items in it when it is bound. An empty will result in an empty grid. In addition, the objects in the must contain public properties. When binding to an , set the of the to "ArrayList" (the type name). + + For each , you can set color and caption attributes that override the settings for the control. However, if those properties are not set, the settings for the control are used by default. The following properties can be overridden by properties: + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + To customize the appearance of individual columns, add objects to the , which is accessed through the property of each . To synchronize each with a in the , set the to the of a . When constructing a , you can also set a formatting string that specifies how the column displays data. For example, you can specify that the column use a short-date format to display dates contained in the table. + > [!CAUTION] -> Always create objects and add them to the before adding objects to the . When you add an empty with a valid value to the collection, objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new objects with duplicate values to the . - +> Always create objects and add them to the before adding objects to the . When you add an empty with a valid value to the collection, objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new objects with duplicate values to the . + > [!NOTE] -> The control replaces and adds functionality to the control; however, the control is retained for both backward compatibility and future use, if you choose. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid Controls](/dotnet/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). - - - -## Examples - The following code example creates a Windows form, a containing two objects, and a that relates the two tables. To display the data, a control is then bound to the through the method. A button on the form changes the appearance of the grid by creating two objects and setting the of each object to a of one of the objects. The example also contains code in the event that uses the method to print the column, row, and part of the grid that has been clicked. - +> The control replaces and adds functionality to the control; however, the control is retained for both backward compatibility and future use, if you choose. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid Controls](/dotnet/desktop/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). + + + +## Examples + The following code example creates a Windows form, a containing two objects, and a that relates the two tables. To display the data, a control is then bound to the through the method. A button on the form changes the appearance of the grid by creating two objects and setting the of each object to a of one of the objects. The example also contains code in the event that uses the method to print the column, row, and part of the grid that has been clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -207,18 +207,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Initializes a new instance of the class. - control, set the property to a valid source, such as a , , or . - - - -## Examples - The following code example creates a new and uses the method to set the and properties. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataGrid Example/VB/source.vb" id="Snippet1"::: - + control, set the property to a valid source, such as a , , or . + + + +## Examples + The following code example creates a new and uses the method to set the and properties. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataGrid Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -258,20 +258,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the if navigation is allowed; otherwise, . The default is . - property between the `true` and `false`. - + property between the `true` and `false`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: + ]]> @@ -297,20 +297,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property has changed. - property is set to `false`, then no links to child tables are shown. - - - -## Examples - The following code example resets the property and raises the event. - + property is set to `false`, then no links to child tables are shown. + + + +## Examples + The following code example resets the property and raises the event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet1"::: + ]]> @@ -344,26 +344,26 @@ This class is not available in .NET Core 3.1 and later versions. Use the if columns can be sorted; otherwise, . - property if there is a currently in effect for the control. - - If sorting is allowed, clicking on a column header will sort the table data by that column. - - You can also sort using an expression for a . See for details on creating a sort expression. - - If the is bound to a , you can set a custom sort for the table using the class's property. Similarly, if the is bound to a , each table in the can have a custom sort by setting the class's property. - - - -## Examples - The following code example toggles the property. - + property if there is a currently in effect for the control. + + If sorting is allowed, clicking on a column header will sort the table data by that column. + + You can also sort using an expression for a . See for details on creating a sort expression. + + If the is bound to a , you can set a custom sort for the table using the class's property. Similarly, if the is bound to a , each table in the can have a custom sort by setting the class's property. + + + +## Examples + The following code example toggles the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowSorting/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AllowSorting Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -395,18 +395,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of odd-numbered rows of the grid. A that represents the alternating background color. The default is the system color for windows (). - and the properties are set to the same color. Setting the property affects only even-numbered rows, while setting the affects only odd-numbered rows. - - - -## Examples - The following code example sets the to a value. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AlternatingBackColor Example/VB/source.vb" id="Snippet1"::: - + and the properties are set to the same color. Setting the property affects only even-numbered rows, while setting the affects only odd-numbered rows. + + + +## Examples + The following code example sets the to a value. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.AlternatingBackColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -432,20 +432,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the button on a child table is clicked. - event. - + event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackButtonClick/mydatagrid_backgroundcolorchanged.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet1"::: + ]]> @@ -472,22 +472,22 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of even-numbered rows of the grid. A that represents the color of rows in the grid. The default is the system color for windows (). - property determines the color of rows in the grid, the determines the color of the nonrow area, which is only visible when the grid is scrolled to the bottom, or if only a few rows are contained in the grid. - - By default, both the and the properties are set to the same color. Setting the property affects only even-numbered rows, while setting the affects only odd-numbered rows. - - - -## Examples - The following code example sets both the and properties to different values. - + property determines the color of rows in the grid, the determines the color of the nonrow area, which is only visible when the grid is scrolled to the bottom, or if only a few rows are contained in the grid. + + By default, both the and the properties are set to the same color. Setting the property affects only even-numbered rows, while setting the affects only odd-numbered rows. + + + +## Examples + The following code example sets both the and properties to different values. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -515,20 +515,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the color of the non-row area of the grid. A that represents the color of the grid's background. The default is the color. - determines the color of the nonrow area of the grid, which is only visible when no table is displayed by the , or if the grid is scrolled to the bottom, or if only a few rows are contained in the grid. - - - -## Examples - The following code example sets the , and properties. - + determines the color of the nonrow area of the grid, which is only visible when no table is displayed by the , or if the grid is scrolled to the bottom, or if only a few rows are contained in the grid. + + + +## Examples + The following code example sets the , and properties. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackgroundColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BackgroundColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -555,15 +555,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the has changed. - property value from yellow to red and raises the event. - + property value from yellow to red and raises the event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/CPP/mydatagrid_backgroundcolorchanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BackButtonClick/mydatagrid_backgroundcolorchanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_BackgroundColorChanged/VB/mydatagrid_backgroundcolorchanged.vb" id="Snippet2"::: + ]]> @@ -633,11 +633,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -705,11 +705,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -746,20 +746,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the method is successful; otherwise, . - method will return `false`. - - - -## Examples - The following code example uses the method to test if editing is possible before changing a specified column and row. - + method will return `false`. + + + +## Examples + The following code example uses the method to test if editing is possible before changing a specified column and row. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/BeginEdit/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -790,11 +790,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Begins the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - method ends the initialization. Using the and methods prevents the control from being used before it is fully initialized. - + method ends the initialization. Using the and methods prevents the control from being used before it is fully initialized. + ]]> @@ -836,13 +836,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the grid's border style. One of the enumeration values. The default is . - @@ -868,21 +868,21 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the has changed. - 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 type named `DataGrid1`. Then 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 type named `DataGrid1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet194"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet194"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet194"::: + ]]> @@ -933,13 +933,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of the caption area. A that represents the caption's background color. The default is color. - property of the control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionBackColor Example/VB/source.vb" id="Snippet1"::: - + property of the control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionBackColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -978,18 +978,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the font of the grid's caption. A that represents the caption's font. - encapsulates a Windows font and provides the methods for manipulating that font. - - - -## Examples - The following code example sets the caption's font using a object. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionFont Example/VB/source.vb" id="Snippet1"::: - + encapsulates a Windows font and provides the methods for manipulating that font. + + + +## Examples + The following code example sets the caption's font using a object. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionFont Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1018,13 +1018,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the foreground color of the caption area. A that represents the foreground color of the caption area. The default is . - property of the control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionForeColor Example/VB/source.vb" id="Snippet1"::: - + property of the control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionForeColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1063,15 +1063,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the text of the grid's window caption. A string to be displayed as the window caption of the grid. The default is an empty string (""). - . - + . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionText/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionText Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1109,18 +1109,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the caption is visible; otherwise, . The default is . - is `false`, the **Back** button, **ParentRow** button, and caption will not be seen. Because navigation is limited, links to child tables will also not be visible and will be set to `None`. - - - -## Examples - The following code example toggles the property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionVisible Example/VB/source.vb" id="Snippet1"::: - + is `false`, the **Back** button, **ParentRow** button, and caption will not be seen. Because navigation is limited, links to child tables will also not be visible and will be set to `None`. + + + +## Examples + The following code example toggles the property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CaptionVisible Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1146,15 +1146,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property has changed. - @@ -1190,18 +1190,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the The number of the row to collapse. If set to -1, all rows are collapsed. Collapses child relations, if any exist for all rows, or for a specified row. - method to determine if a row is expanded. - - - -## Examples - The following code example collapses all rows in the control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Collapse Example/VB/source.vb" id="Snippet1"::: - + method to determine if a row is expanded. + + + +## Examples + The following code example collapses all rows in the control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Collapse Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1236,13 +1236,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the column headers are visible; otherwise, . The default is . - property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ColumnHeadersVisible Example/VB/source.vb" id="Snippet1"::: - + property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ColumnHeadersVisible Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1286,11 +1286,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the The that defines the location of the edited column. Informs the control when the user begins to edit the column at the specified location. - method enables the control to show a pencil in the row header. - + method enables the control to show a pencil in the row header. + ]]> @@ -1320,11 +1320,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the The used to edit the column. Informs the control when the user begins to edit a column using the specified control. - method enables the control to show a pencil in the row header. - + method enables the control to show a pencil in the row header. + ]]> @@ -1351,21 +1351,21 @@ This class is not available in .NET Core 3.1 and later versions. Use the Constructs a new instance of the accessibility object for this control. The for this control. - method. - - Only the following properties of the should be set: - -- - -- - -- - - All other properties are handled by the itself. - + method. + + Only the following properties of the should be set: + +- + +- + +- + + All other properties are handled by the itself. + ]]> @@ -1473,20 +1473,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets which cell has the focus. Not available at design time. The with the focus. - property will cause the grid to scroll and show the cell if it is not already visible. - - - -## Examples - The following code example shows how to set and get the current cell. - + property will cause the grid to scroll and show the cell if it is not already visible. + + + +## Examples + The following code example shows how to set and get the current cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CurrentCell/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentCell Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1514,20 +1514,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property has changed. - property. - - - -## Examples - The following code example demonstrates the use of this member. - + property. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/CPP/mydatagrid_captionvisiblechanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CaptionVisibleChanged/mydatagrid_captionvisiblechanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_CaptionVisibleChanged/VB/mydatagrid_captionvisiblechanged.vb" id="Snippet2"::: + ]]> @@ -1564,24 +1564,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets index of the row that currently has focus. The zero-based index of the current row. - property to a value other than its current value scrolls the control so that the specified row is in view. - - The property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the will cause the to display the next set of records in the child table that are linked to the parent table. - - If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row. - - - -## Examples - The following code example returns the . - + property to a value other than its current value scrolls the control so that the specified row is in view. + + The property enables you to iterate through a parent table's rows even if you are viewing the child table rows. For example, if you are viewing a child table, incrementing the will cause the to display the next set of records in the child table that are linked to the parent table. + + If the user is viewing a parent table, or a table with no child relations, then the property returns the zero-based index of the current row. + + + +## Examples + The following code example returns the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/CurrentRowIndex/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.CurrentRowIndex Example/VB/source.vb" id="Snippet1"::: + ]]> There is no . @@ -1653,11 +1653,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -1706,27 +1706,27 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the specific list in a for which the control displays a grid. A list in a . The default is an empty string (""). - contains multiple sources of data, you should set the to one of the sources. For example, if the is a or that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify one of the tables to bind to. If the or contains only one , you should set the to the of that . - - If the is set to a that contains objects, parent tables will appear with a plus sign (+) in each row header. Clicking the plus sign causes a node to appear that contains links to child tables. For example, if a contains two objects named `Customers` and `Orders`, setting the to the `Customers` table causes the to display a parent table with a plus sign visible on each row header. If the is set to `Orders`, however, the row headers will be blank. - - If the is a , , collection, or array, setting the property throws an exception. - + contains multiple sources of data, you should set the to one of the sources. For example, if the is a or that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify one of the tables to bind to. If the or contains only one , you should set the to the of that . + + If the is set to a that contains objects, parent tables will appear with a plus sign (+) in each row header. Clicking the plus sign causes a node to appear that contains links to child tables. For example, if a contains two objects named `Customers` and `Orders`, setting the to the `Customers` table causes the to display a parent table with a plus sign visible on each row header. If the is set to `Orders`, however, the row headers will be blank. + + If the is a , , collection, or array, setting the property throws an exception. + > [!NOTE] -> At run time, you must use the method to reset the property. However, the property alone can be reset at any time to a valid table name. - - - -## Examples - The following code example sets the and properties of a control. - +> At run time, you must use the method to reset the property. However, the property alone can be reset at any time to a valid table name. + + + +## Examples + The following code example sets the and properties of a control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataMember/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataMember Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1779,46 +1779,46 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the data source that the grid is displaying data for. An object that functions as a data source. - method to set the and properties. - - The following data sources are valid: - -- A - -- A - -- A - -- A - -- Any component that implements the interface - -- Any component that implements the interface - - See the class overview for more information on data sources. - - If the reference contains more than one table, you must set the property a string that specifies the table to bind to. For example, if the is a or that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify the table to bind to. - - Setting the to an object that does not implement the interface or an will cause the grid to throw an exception. - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. - - To bind the to a strongly typed array of objects, the object type must contain public properties. To create a that displays the array, set the property to `typename` where `typename` is replaced by the name of the object type. Also note that the property is case-sensitive; the type name must be matched exactly. See the property for an example. - - You can also bind the to an . A feature of the is that it can contain objects of multiple types, but the can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a , the second item could be a (which inherits from ). If, on the other hand, the first item is a , the second object cannot be a . Further, the must have items in it when it is bound. An empty will result in an empty grid. In addition, the objects in the must contain public properties. When binding to an , set the of the to "ArrayList" (the type name). - - - -## Examples - The following code example shows how to set the , and when needed, the , to bind a to both a and a . The example also shows how to return data sources from the . - + method to set the and properties. + + The following data sources are valid: + +- A + +- A + +- A + +- A + +- Any component that implements the interface + +- Any component that implements the interface + + See the class overview for more information on data sources. + + If the reference contains more than one table, you must set the property a string that specifies the table to bind to. For example, if the is a or that contains three tables named `Customers`, `Orders`, and `OrderDetails`, you must specify the table to bind to. + + Setting the to an object that does not implement the interface or an will cause the grid to throw an exception. + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. + + To bind the to a strongly typed array of objects, the object type must contain public properties. To create a that displays the array, set the property to `typename` where `typename` is replaced by the name of the object type. Also note that the property is case-sensitive; the type name must be matched exactly. See the property for an example. + + You can also bind the to an . A feature of the is that it can contain objects of multiple types, but the can only bind to such a list when all items in the list are of the same type as the first item. This means that all objects must either be of the same type, or they must inherit from the same class as the first item in the list. For example, if the first item in a list is a , the second item could be a (which inherits from ). If, on the other hand, the first item is a , the second object cannot be a . Further, the must have items in it when it is bound. An empty will result in an empty grid. In addition, the objects in the must contain public properties. When binding to an , set the of the to "ArrayList" (the type name). + + + +## Examples + The following code example shows how to set the , and when needed, the , to bind a to both a and a . The example also shows how to return data sources from the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataSource/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSource Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1848,20 +1848,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property value has changed. - event occurs when the value changes, or when the of the changes. - - - -## Examples - The following code example demonstrates the use of this member. - + event occurs when the value changes, or when the of the changes. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/DataSourceChanged/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.DataSourceChanged Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1917,18 +1917,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the to release both managed and unmanaged resources; to release only unmanaged resources. Disposes of the resources (other than memory) used by the . - when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. - - - -## Examples - The following code example uses the method to free resources. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Dispose Example/VB/source.vb" id="Snippet1"::: - + when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. + + + +## Examples + The following code example uses the method to free resources. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.Dispose Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1967,20 +1967,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the editing operation ceases; otherwise, . - method returns `false` if the user is not editing (typing into) a cell. - - - -## Examples - The following code example uses the and methods to edit a value in a grid displayed by the control. - + method returns `false` if the user is not editing (typing into) a cell. + + + +## Examples + The following code example uses the and methods to edit a value in a grid displayed by the control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/EndEdit/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.EndEdit Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2011,11 +2011,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Ends the initialization of a that is used on a form or used by another component. The initialization occurs at run time. - method starts the initialization. Using the and methods prevents the control from being used before it is fully initialized. - + method starts the initialization. Using the and methods prevents the control from being used before it is fully initialized. + ]]> @@ -2052,13 +2052,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the The number of the row to expand. If set to -1, all rows are expanded. Displays child relations, if any exist, for all rows or a specific row. - @@ -2096,20 +2096,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the index of the first visible column in a grid. The index of a . - property to the cell that should be visible. - - - -## Examples - The following code example scrolls the grid if the first visible column is greater than five. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.FirstVisibleColumn Example/VB/source.vb" id="Snippet1"::: - + property to the cell that should be visible. + + + +## Examples + The following code example scrolls the grid if the first visible column is greater than five. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.FirstVisibleColumn Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2144,15 +2144,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the grid is displayed flat; otherwise, . The default is . - property and notifies the user of its status. - + property and notifies the user of its status. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/CPP/mydatagridclass_flatmode_readonly.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/FlatMode/mydatagridclass_flatmode_readonly.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_FlatMode_ReadOnly/VB/mydatagridclass_flatmode_readonly.vb" id="Snippet1"::: + ]]> @@ -2178,15 +2178,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the has changed. - @@ -2213,15 +2213,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the foreground color (typically the color of the text) property of the control. A that represents the foreground color. The default is color. - @@ -2261,15 +2261,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the of the cell specified by . A that defines the current cell's corners. - method to return a of a specified cell. - + method to return a of a specified cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCellBounds/source1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds1 Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2303,20 +2303,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the of the cell specified by row and column number. A that defines the current cell's corners. - . - - - -## Examples - The following code example uses the method to return a of a specified cell. - + . + + + +## Examples + The following code example uses the method to return a of a specified cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCellBounds/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCellBounds Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2346,20 +2346,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets a that specifies the four corners of the selected cell. A that defines the current cell's corners. - . - - - -## Examples - The following code example gets the of the selected cell. - + . + + + +## Examples + The following code example gets the of the selected cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GetCurrentCellBounds/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GetCurrentCellBounds Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2441,20 +2441,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the color of the grid lines. A that represents the color of the grid lines. The default is the system color for controls (). - property is set to `DataGridLineStyle.None`. - - - -## Examples - The following code example sets the color of the grid's lines using a value passed to the method. - + property is set to `DataGridLineStyle.None`. + + + +## Examples + The following code example sets the color of the grid's lines using a value passed to the method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/GridLineColor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineColor Example/VB/source.vb" id="Snippet1"::: + ]]> The value is not set. @@ -2493,13 +2493,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the line style of the grid. One of the values. The default is . - property to show no lines. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineStyle Example/VB/source.vb" id="Snippet1"::: - + property to show no lines. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.GridLineStyle Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2556,13 +2556,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of all row and column headers. A that represents the background color of row and column headers. The default is the system color for controls, . - While trying to set the property, a was passed. @@ -2592,11 +2592,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the font used for column headers. The that represents the header text. - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -2623,13 +2623,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the foreground color of headers. A that represents the foreground color of the grid's column headers, including the column header text and the plus/minus glyphs. The default is color. - @@ -2671,20 +2671,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets information, such as row and column number of a clicked point on the grid, about the grid using a specific . A that contains specific information about the grid. - , in conjunction with the method of the control, is used to determine which part of a control the user has clicked. The contains the row, column, and part of the grid that was clicked. Additionally, the property returns a enumeration. - - The method takes an x and y argument supplied by the control's , , , , , and events. - - - -## Examples - The following code example uses the method in occurs when a user clicks on a grid. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest1 Example/VB/source.vb" id="Snippet1"::: - + , in conjunction with the method of the control, is used to determine which part of a control the user has clicked. The contains the row, column, and part of the grid that was clicked. Additionally, the property returns a enumeration. + + The method takes an x and y argument supplied by the control's , , , , , and events. + + + +## Examples + The following code example uses the method in occurs when a user clicks on a grid. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest1 Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2718,20 +2718,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets information, such as row and column number of a clicked point on the grid, using the x and y coordinate passed to the method. A that contains information about the clicked part of the grid. - , in conjunction with the method of the control, is used to determine which part of a control the user has clicked. The contains the row, column, and part of the grid that was clicked. Additionally, the property returns a enumeration. - - The method takes an x and y argument supplied by the control's , , , , , and events. - - - -## Examples - The following code example uses the method in an event that occurs when the user clicks in the grid. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest Example/VB/source.vb" id="Snippet1"::: - + , in conjunction with the method of the control, is used to determine which part of a control the user has clicked. The contains the row, column, and part of the grid that was clicked. Additionally, the property returns a enumeration. + + The method takes an x and y argument supplied by the control's , , , , , and events. + + + +## Examples + The following code example uses the method in an event that occurs when the user clicks in the grid. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.HitTest Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2795,15 +2795,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the node is expanded; otherwise, . - @@ -2836,20 +2836,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the row is selected; otherwise, . - , , and methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + , , and methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet5"::: + ]]> @@ -2889,20 +2889,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the value of a specified . The value, typed as , of the cell. - to the specified row. - - - -## Examples - The following code example sets and gets the value of a cell by declaring a variable, setting its and values, then first changing, then returning, the value of the given cell. - + to the specified row. + + + +## Examples + The following code example sets and gets the value of a cell by declaring a variable, setting its and values, then first changing, then returning, the value of the given cell. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Item/source1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this1 Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2937,24 +2937,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the value of the cell at the specified the row and column. The value, typed as , of the cell. - to the specified row. - - - -## Examples - The following code example prints the value contained by the cell at the specified row and index. - + to the specified row. + + + +## Examples + The following code example prints the value contained by the cell at the specified row and index. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.this Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/Item/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.this Example/VB/source.vb" id="Snippet1"::: + ]]> - While getting or setting, the is out of range. - + While getting or setting, the is out of range. + While getting or setting, the is out of range. @@ -2980,11 +2980,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the color of the text that you can click to navigate to a child table. A that represents the color of text that is clicked to navigate to a child table. The default is . - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -3087,20 +3087,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the user navigates to a new table. - event to reset individual column properties, such as width, as appropriate to the table. - - - -## Examples - The following code example demonstrates the use of this member. - + event to reset individual column properties, such as width, as appropriate to the table. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/CPP/mydatagrid_allownavigationchanged.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/AllowNavigation/mydatagrid_allownavigationchanged.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_AllowNavigationChanged/VB/mydatagrid_allownavigationchanged.vb" id="Snippet2"::: + ]]> @@ -3127,18 +3127,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Navigates back to the table previously displayed in the grid. - @@ -3170,14 +3170,14 @@ This class is not available in .NET Core 3.1 and later versions. Use the The name of the child relation to navigate to. Navigates to the table specified by row and relation name. - @@ -3263,13 +3263,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3328,13 +3328,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3448,13 +3448,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3539,13 +3539,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3577,13 +3577,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3615,13 +3615,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3653,13 +3653,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the An containing 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. + ]]> @@ -3691,13 +3691,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that provides data about the event. 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. + ]]> @@ -3729,13 +3729,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains data about the event. 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. + ]]> @@ -3767,13 +3767,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains the event data. Raises the event, which repositions controls and updates scroll bars. - 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. + ]]> @@ -3805,13 +3805,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -3843,20 +3843,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains data about the event. Raises the event. - @@ -3888,11 +3888,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the An that contains data about the event. Creates the event. - @@ -3924,11 +3924,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains data about the event. Raises the event. - @@ -3960,11 +3960,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains data about the event. Raises the event. - @@ -3996,11 +3996,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains data about the event. Raises the event. - @@ -4059,11 +4059,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the A which contains data about the event. Raises the event. - @@ -4095,11 +4095,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the A that contains information about the control to paint. Overrides to prevent painting the background of the control. - is a complex control, this override is implemented to have no action. Therefore, calling this method will have no effect. - + is a complex control, this override is implemented to have no action. Therefore, calling this method will have no effect. + ]]> @@ -4129,13 +4129,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -4195,13 +4195,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the 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. + ]]> @@ -4233,11 +4233,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the An that contains the event data. Raises the event. - @@ -4350,13 +4350,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of parent rows. A that represents the color of parent rows. The default is the color. - property to a new color. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsBackColor Example/VB/source.vb" id="Snippet1"::: - + property to a new color. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsBackColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -4383,13 +4383,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the foreground color of parent rows. A that represents the foreground color of parent rows. The default is the color. - property to a new color. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsForeColor Example/VB/source.vb" id="Snippet1"::: - + property to a new color. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsForeColor Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -4430,13 +4430,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the way parent row labels are displayed. One of the values. The default is . - property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsLabelStyle Example/VB/source.vb" id="Snippet1"::: - + property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsLabelStyle Example/VB/source.vb" id="Snippet1"::: + ]]> The enumerator was not valid. @@ -4467,15 +4467,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the label style of the parent row is changed. - @@ -4509,13 +4509,13 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the parent rows are visible; otherwise, . The default is . - property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsVisible Example/VB/source.vb" id="Snippet1"::: - + property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ParentRowsVisible Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -4541,15 +4541,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property value changes. - @@ -4590,20 +4590,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the default width of the grid columns in pixels. The default width (in pixels) of columns in the grid. - and properties (either separately, or through the method), or the property will have no effect. - - The property cannot be set to a value less than 0. - - - -## Examples - The following code example sets the default column widths to a value passed to the method. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredColumnWidth Example/VB/source.vb" id="Snippet1"::: - + and properties (either separately, or through the method), or the property will have no effect. + + The property cannot be set to a value less than 0. + + + +## Examples + The following code example sets the default column widths to a value passed to the method. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredColumnWidth Example/VB/source.vb" id="Snippet1"::: + ]]> The property value is less than 0. @@ -4639,20 +4639,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the preferred row height for the control. The height of a row. - and properties (either separately, or through the method), or the property will have no effect. - - - -## Examples - The following code example first sets a new font, and sets the to the same height as the new font. - + and properties (either separately, or through the method), or the property will have no effect. + + + +## Examples + The following code example first sets a new font, and sets the to the same height as the new font. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/PreferredRowHeight/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.PreferredRowHeight Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -4685,11 +4685,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the , the key should be processed; otherwise, . - method to implement keyboard navigation of the grid. - + method to implement keyboard navigation of the grid. + ]]> @@ -4749,11 +4749,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the , if the key was consumed; otherwise, . - @@ -4816,22 +4816,22 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the grid is in read-only mode; otherwise, . The default is . - also has a property that can be set to true to prevent data from being edited, on a column-by-column basis. - - The can be set to true if you want to prohibit the user from editing the data directly in the . For example, you might want to let users to see all columns in a table, but allow them to edit specific fields only through controls on a different form. - - - -## Examples - The following code example toggles the property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ReadOnly Example/VB/source.vb" id="Snippet1"::: - + also has a property that can be set to true to prevent data from being edited, on a column-by-column basis. + + The can be set to true if you want to prohibit the user from editing the data directly in the . For example, you might want to let users to see all columns in a table, but allow them to edit specific fields only through controls on a different form. + + + +## Examples + The following code example toggles the property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.ReadOnly Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -4858,15 +4858,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the property value changes. - @@ -4894,20 +4894,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default color. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -4934,20 +4934,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -4973,20 +4973,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5019,20 +5019,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5059,20 +5059,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet1"::: + ]]> @@ -5099,20 +5099,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet3"::: + ]]> @@ -5139,20 +5139,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet2"::: + ]]> @@ -5179,20 +5179,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5219,11 +5219,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + ]]> @@ -5250,11 +5250,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Turns off selection for all rows that are selected. - , , and methods to manipulate the selection state of a particular row. - + , , and methods to manipulate the selection state of a particular row. + ]]> @@ -5281,20 +5281,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5321,20 +5321,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Resets the property to its default value. - or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . You can use the method to determine whether the property value has changed from its default. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5429,15 +5429,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the width of row headers. The width of row headers in the . The default is 35. - @@ -5463,15 +5463,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the user scrolls the control. - @@ -5501,20 +5501,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the The index of the row to select. Selects a specified row. - , , and methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + , , and methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/CPP/mydatagridclass_resetheaderbackcolor.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/IsSelected/mydatagridclass_resetheaderbackcolor.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MyDataGridClass_ResetHeaderBackColor/VB/mydatagridclass_resetheaderbackcolor.vb" id="Snippet4"::: + ]]> @@ -5541,20 +5541,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or sets the background color of selected rows. A that represents the background color of selected rows. The default is the color. - or creating your own control incorporating the . - - - -## Examples - The following code example demonstrates the use of this member. - + or creating your own control incorporating the . + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_ColorMembers/CPP/datagrid_10.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/ForeColor/datagrid_10.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_ColorMembers/VB/datagrid_10.vb" id="Snippet2"::: + ]]> @@ -5581,15 +5581,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets or set the foreground color of selected rows. A representing the foreground color of selected rows. The default is the color. - @@ -5621,24 +5621,24 @@ This class is not available in .NET Core 3.1 and later versions. Use the The string that specifies the table to bind to within the object returned by the property. Sets the and properties at run time. - method at run time to reset the property. - - See the property for more details about setting a valid data source. - - You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. When the is a or , set the to an empty string (""). - - - -## Examples - The following code example sets the and to a , and a in the , respectively. - + method at run time to reset the property. + + See the property for more details about setting a valid data source. + + You can create a grid that enables users to edit data but prevents them from adding new rows by using a as the data source and setting the property to `false`. When the is a or , set the to an empty string (""). + + + +## Examples + The following code example sets the and to a , and a in the , respectively. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/SetDataBinding/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.SetDataBinding Example/VB/source.vb" id="Snippet1"::: + ]]> One or more of the arguments are invalid. @@ -5673,11 +5673,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5706,11 +5706,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5739,11 +5739,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has been changed from its default; otherwise, . - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -5772,11 +5772,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has been changed from its default; otherwise, . - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -5805,11 +5805,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5838,11 +5838,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5871,11 +5871,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5904,11 +5904,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5937,11 +5937,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -5971,11 +5971,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has been changed from its default; otherwise, . - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -6004,11 +6004,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has been changed from its default; otherwise, . - , or creating your own control incorporating the . - + , or creating your own control incorporating the . + ]]> @@ -6037,11 +6037,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -6070,11 +6070,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -6103,11 +6103,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the if the property value has changed from its default; otherwise, . - or creating your own control incorporating the . - + or creating your own control incorporating the . + ]]> @@ -6133,15 +6133,15 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the button is clicked. - @@ -6234,35 +6234,35 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the collection of objects for the grid. A that represents the collection of objects. - retrieved through the property to create customized views of each table displayed by the control. - - By default, the collection returned by property does not contain any objects. To create a set of customized views: - -1. Create a . - -2. Set the of the grid table object to the of the . - -3. Add objects, one for each grid column you want to show, to the returned by the property. - -4. Set the of each to the of a . - -5. Add the object to the collection returned by property. - + retrieved through the property to create customized views of each table displayed by the control. + + By default, the collection returned by property does not contain any objects. To create a set of customized views: + +1. Create a . + +2. Set the of the grid table object to the of the . + +3. Add objects, one for each grid column you want to show, to the returned by the property. + +4. Set the of each to the of a . + +5. Add the object to the collection returned by property. + > [!CAUTION] -> Always create objects and add them to the before adding objects to the . When you add an empty with a valid value to the collection, objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new objects with duplicate values to the . - - - -## Examples - The following code example creates one for each found in a , and sets the of the to the of the . The is then added to the returned by the property. The example also prints the of each in the returned by the property of each in the . - +> Always create objects and add them to the before adding objects to the . When you add an empty with a valid value to the collection, objects are automatically generated for you. Consequently, an exception will be thrown if you try to add new objects with duplicate values to the . + + + +## Examples + The following code example creates one for each found in a , and sets the of the to the of the . The is then added to the returned by the property. The example also prints the of each in the returned by the property of each in the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/TableStyles/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.TableStyles Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -6344,11 +6344,11 @@ This class is not available in .NET Core 3.1 and later versions. Use the Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -6378,20 +6378,20 @@ This class is not available in .NET Core 3.1 and later versions. Use the The index of the row to deselect. Unselects a specified row. - , , and methods to manipulate the selection state of a particular row. - - - -## Examples - The following code example demonstrates the use of this member. - + , , and methods to manipulate the selection state of a particular row. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DataGrid_UnSelect/CPP/datagrid_unselect.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGrid/UnSelect/datagrid_unselect.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_UnSelect/VB/datagrid_unselect.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DataGrid_UnSelect/VB/datagrid_unselect.vb" id="Snippet1"::: + ]]> @@ -6463,18 +6463,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the number of visible columns. The number of columns visible in the viewport. The viewport is the rectangular area through which the grid is visible. The size of the viewport depends on the size of the control; if you allow users to resize the control, the viewport will also be affected. - @@ -6513,18 +6513,18 @@ This class is not available in .NET Core 3.1 and later versions. Use the Gets the number of rows visible. The number of rows visible in the viewport. The viewport is the rectangular area through which the grid is visible. The size of the viewport depends on the size of the control; if you allow users to resize the control, the viewport will also be affected. - control. - - - -## Examples - The following code example returns the number of rows visible in a control. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleRowCount Example/VB/source.vb" id="Snippet1"::: - + control. + + + +## Examples + The following code example returns the number of rows visible in a control. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DataGrid.VisibleRowCount Example/VB/source.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridView.xml b/xml/System.Windows.Forms/DataGridView.xml index 6081c52b00b..558c67049a6 100644 --- a/xml/System.Windows.Forms/DataGridView.xml +++ b/xml/System.Windows.Forms/DataGridView.xml @@ -72,37 +72,37 @@ control provides a customizable table for displaying data. The class allows customization of cells, rows, columns, and borders through the use of properties such as , , , and . For more information, see [Basic Formatting and Styling in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/basic-formatting-and-styling-in-the-windows-forms-datagridview-control). + The control provides a customizable table for displaying data. The class allows customization of cells, rows, columns, and borders through the use of properties such as , , , and . For more information, see [Basic Formatting and Styling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/basic-formatting-and-styling-in-the-windows-forms-datagridview-control). You can use a control to display data with or without an underlying data source. Without specifying a data source, you can create columns and rows that contain data and add them directly to the using the and properties. You can also use the collection to access objects and the property to read or write cell values directly. The indexer also provides direct access to cells. - As an alternative to populating the control manually, you can set the and properties to bind the to a data source and automatically populate it with data. For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). + As an alternative to populating the control manually, you can set the and properties to bind the to a data source and automatically populate it with data. For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). - When working with very large amounts of data, you can set the property to `true` to display a subset of the available data. Virtual mode requires the implementation of a data cache from which the control is populated. For more information, see [Data Display Modes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control). + When working with very large amounts of data, you can set the property to `true` to display a subset of the available data. Virtual mode requires the implementation of a data cache from which the control is populated. For more information, see [Data Display Modes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/data-display-modes-in-the-windows-forms-datagridview-control). - For additional information about the features available in the control, see [DataGridView Control](/dotnet/framework/winforms/controls/datagridview-control-windows-forms). The following table provides direct links to common tasks. + For additional information about the features available in the control, see [DataGridView Control](/dotnet/desktop/winforms/controls/datagridview-control-windows-forms). The following table provides direct links to common tasks. -- [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control) +- [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control) -- [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control) +- [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control) -- [How to: Set Font and Color Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-font-and-color-styles-in-the-windows-forms-datagridview-control) +- [How to: Set Font and Color Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-font-and-color-styles-in-the-windows-forms-datagridview-control) -- [How to: Change the Type of a Windows Forms DataGridView Column Using the Designer](/dotnet/framework/winforms/controls/change-the-type-of-a-wf-datagridview-column-using-the-designer) +- [How to: Change the Type of a Windows Forms DataGridView Column Using the Designer](/dotnet/desktop/winforms/controls/change-the-type-of-a-wf-datagridview-column-using-the-designer) -- [How to: Bind Data to the Windows Forms DataGridView Control Using the Designer](/dotnet/framework/winforms/controls/bind-data-to-the-datagrid-using-the-designer) +- [How to: Bind Data to the Windows Forms DataGridView Control Using the Designer](/dotnet/desktop/winforms/controls/bind-data-to-the-datagrid-using-the-designer) -- [How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer](/dotnet/framework/winforms/controls/default-cell-styles-datagridview) +- [How to: Set Default Cell Styles and Data Formats for the Windows Forms DataGridView Control Using the Designer](/dotnet/desktop/winforms/controls/default-cell-styles-datagridview) -- [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control) +- [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control) -- [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control) +- [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control) -- [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control) +- [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control) -- [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) +- [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) -The control replaces and extends the control. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid controls](/dotnet/framework/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). +The control replaces and extends the control. For more information, see [Differences Between the Windows Forms DataGridView and DataGrid controls](/dotnet/desktop/winforms/controls/differences-between-the-windows-forms-datagridview-and-datagrid-controls). > [!NOTE] > The control inherits both the and properties from , but supports only the property. Using the property with the control has no effect. @@ -115,12 +115,12 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - DataGridView Control Overview (Windows Forms) - Basic Formatting and Styling in the Windows Forms DataGridView Control - Displaying Data in the Windows Forms DataGridView Control - Data Display Modes in the Windows Forms DataGridView Control - Differences Between the Windows Forms DataGridView and DataGrid Controls + DataGridView Control (Windows Forms) + DataGridView Control Overview (Windows Forms) + Basic Formatting and Styling in the Windows Forms DataGridView Control + Displaying Data in the Windows Forms DataGridView Control + Data Display Modes in the Windows Forms DataGridView Control + Differences Between the Windows Forms DataGridView and DataGrid Controls @@ -172,7 +172,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -220,7 +220,7 @@ The control replaces and extends the Override this method when customizing the control and modifying how and when the current cell changes. For example, if you create a custom row type that merges multiple cells into single cells and you modify the navigation accordingly, you can override this method to provide accessibility support for your changes. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -283,7 +283,7 @@ The control replaces and extends the Override this method if you want to customize the appearance of the border on column header cells. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -346,7 +346,7 @@ The control replaces and extends the Override this property if you want to customize the appearance of the border on the upper-left header cell. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -396,7 +396,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -446,7 +446,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -496,7 +496,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -545,7 +545,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -595,7 +595,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -644,7 +644,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -694,7 +694,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -746,7 +746,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -796,7 +796,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -837,7 +837,7 @@ The control replaces and extends the [!NOTE] > The control does not support double buffering. If is set to `true` in a derived control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -850,7 +850,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -900,7 +900,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -943,7 +943,7 @@ The control replaces and extends the property value of . - For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about user resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The control does not support double buffering. If is set to `true` in a derived control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -956,7 +956,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1006,7 +1006,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1040,7 +1040,7 @@ The control replaces and extends the control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . For cells in rows with odd index numbers, the styles specified through the property override the styles specified through the , , and , and are overridden by the styles specified through the and properties. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -1053,8 +1053,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -1107,8 +1107,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -1158,8 +1158,8 @@ The control replaces and extends the - Best Practices for Scaling the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Best Practices for Scaling the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -1216,7 +1216,7 @@ The control replaces and extends the Setting the in the Windows Forms Designer automatically sets the property to `false` and generates code to add and bind a column for each property in the data source. The code that is generated at design-time is equivalent to the manually added code shown in the following example. It is not the same as the auto-generation of columns at run-time that occurs when the property is set to `true`. ## Examples - The following code example demonstrates how to add columns manually and bind them to a data source when you set to `false`. In this example, a control is bound to a list of `Task` business objects. Then, columns are added and are bound to `Task` properties through the property. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + The following code example demonstrates how to add columns manually and bind them to a data source when you set to `false`. In this example, a control is bound to a list of `Task` business objects. Then, columns are added and are bound to `Task` properties through the property. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: @@ -1227,7 +1227,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1285,7 +1285,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1337,10 +1337,10 @@ The control replaces and extends the method. To set the column to automatically resize whenever its contents change, use the property or the column property. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses this method to make the column width large enough to accommodate a new cell value. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: @@ -1350,7 +1350,7 @@ The control replaces and extends the is not in the valid range of 0 to the number of columns minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1397,10 +1397,10 @@ The control replaces and extends the control replaces and extends the is not in the valid range of 0 to the number of columns minus 1. is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1462,7 +1462,7 @@ The control replaces and extends the class. If `fixedHeight` is `false`, the column width will be calculated with the expectation that you will call the or method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -1474,7 +1474,7 @@ The control replaces and extends the is not in the valid range of 0 to the number of columns minus 1. is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1525,7 +1525,7 @@ The control replaces and extends the property value of . - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples The following code example demonstrates how to resize column headers and rows as a result of a button click. @@ -1536,7 +1536,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1581,13 +1581,13 @@ The control replaces and extends the property value of . - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> is not in the valid range of 0 to the number of columns minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1632,11 +1632,11 @@ The control replaces and extends the class. If the `fixedColumnsWidth` or `fixedRowHeadersWidth` parameters are `false`, the height of the column headers will be calculated with the expectation that you will call the methods such as and next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1683,13 +1683,13 @@ The control replaces and extends the class. If the `fixedColumnWidth` or `fixedRowHeadersWidth` parameters are `false`, the height of the column headers will be calculated with the expectation that you will call the methods such as and next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> is not in the valid range of 0 to the number of columns minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1738,10 +1738,10 @@ The control replaces and extends the method. To set the columns to automatically resize whenever their contents change, use the property or the column property. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes all columns to fit the contents of the columns and the column headers. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet3"::: @@ -1749,7 +1749,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1794,10 +1794,10 @@ The control replaces and extends the control replaces and extends the has the value or . is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1855,7 +1855,7 @@ The control replaces and extends the class. If `fixedHeight` is `false`, the column widths will be calculated with the expectation that you will call the or method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -1865,7 +1865,7 @@ The control replaces and extends the has the value or . is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1919,10 +1919,10 @@ The control replaces and extends the property value of . - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example resizes the third row in a to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes the third row in a to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: @@ -1932,7 +1932,7 @@ The control replaces and extends the is not in the valid range of 0 to the number of rows minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -1981,10 +1981,10 @@ The control replaces and extends the to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example resizes the third row in a to fit the column contents. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: @@ -1998,7 +1998,7 @@ The control replaces and extends the is not a valid value. is not in the valid range of 0 to the number of rows minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2046,7 +2046,7 @@ The control replaces and extends the class. If `fixedWidth` is `false`, the row height will be calculated with the expectation that you will call the or method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -2056,7 +2056,7 @@ The control replaces and extends the is not a valid value. is not in the valid range of 0 to the number of rows minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2110,7 +2110,7 @@ The control replaces and extends the @@ -2118,7 +2118,7 @@ The control replaces and extends the has the value or . is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2165,10 +2165,10 @@ The control replaces and extends the control replaces and extends the has the value or is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2229,7 +2229,7 @@ The control replaces and extends the class. If the `fixedColumnHeadersHeight` or `fixedRowsHeight` parameters are `false`, the width of the row headers will be calculated with the expectation that you will call methods such as and next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -2237,7 +2237,7 @@ The control replaces and extends the has the value or . is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2286,7 +2286,7 @@ The control replaces and extends the class. If the `fixedColumnHeadersHeight` or `fixedRowHeight` parameters are `false`, the width of the row headers will be calculated with the expectation that you will call methods such as and next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -2296,7 +2296,7 @@ The control replaces and extends the has the value or . is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2347,10 +2347,10 @@ The control replaces and extends the property value of . - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + The following code example demonstrates how to resize all rows based on non-header cell content. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet7"::: @@ -2358,7 +2358,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2405,10 +2405,10 @@ The control replaces and extends the control replaces and extends the is not a valid value. has the value . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2468,7 +2468,7 @@ The control replaces and extends the class. If the `fixedWidth` parameter is `false`, the row heights will be calculated with the expectation that you will call the or method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -2478,7 +2478,7 @@ The control replaces and extends the is not a valid value. has the value . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2528,7 +2528,7 @@ The control replaces and extends the class. If the `fixedWidth` parameter is `false`, the row heights will be calculated with the expectation that you will call the or method next. - For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about programmatic resizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ]]> @@ -2544,7 +2544,7 @@ The control replaces and extends the is less than 0. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2615,7 +2615,7 @@ The control replaces and extends the control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2673,16 +2673,16 @@ The control replaces and extends the property. The default value of this property is , indicating that the column inherits its behavior and its property value from the control. - Columns in fill mode divide the available control width in proportions indicated by their property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + Columns in fill mode divide the available control width in proportions indicated by their property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). Only columns with a property value of `true` are resized automatically, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. To adjust column widths programmatically, use the or methods or set the column property. - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates how to use this property in a master/detail scenario where two controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is , and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic column sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/create-a-master-detail-form-using-two-datagridviews). + The following code example illustrates how to use this property in a master/detail scenario where two controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is , and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic column sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/create-a-master-detail-form-using-two-datagridviews). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeColumnsMode/masterdetails.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: @@ -2697,7 +2697,7 @@ The control replaces and extends the and at least one visible column with an property value of is frozen. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2750,7 +2750,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2802,10 +2802,10 @@ The control replaces and extends the property value of . - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example demonstrates how to set the row to automatically resize based on the contents of the row headers and all of the columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + The following code example demonstrates how to set the row to automatically resize based on the contents of the row headers and all of the columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet9"::: @@ -2816,8 +2816,8 @@ The control replaces and extends the The specified value when setting this property is not a valid value. The specified value when setting this property is or and row headers are hidden. - DataGridView Control (Windows Forms) - How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control @@ -2858,7 +2858,7 @@ The control replaces and extends the control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2921,7 +2921,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -2973,7 +2973,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3021,7 +3021,7 @@ The control replaces and extends the property value that is less that 255. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3071,7 +3071,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3122,7 +3122,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3172,7 +3172,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3218,7 +3218,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3270,7 +3270,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3341,7 +3341,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3395,7 +3395,7 @@ The control replaces and extends the The specified value when setting this property is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3445,7 +3445,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3485,14 +3485,14 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3535,7 +3535,7 @@ The control replaces and extends the control in virtual mode. When the control is in edit mode, the `rowInEdit` variable holds the index of the row being edited, and the `customerInEdit` variable holds a reference to a Customer object corresponding to that row. When the user cancels out of edit mode, this object can be discarded. If the row the user was editing is the row for new records, however, the old Customer object is discarded and replaced with a new one so that the user can begin making edits again. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/implementing-virtual-mode-wf-datagridview-control). + The following code example illustrates how to handle this event for a control in virtual mode. When the control is in edit mode, the `rowInEdit` variable holds the index of the row being edited, and the `customerInEdit` variable holds a reference to a Customer object corresponding to that row. When the user cancels out of edit mode, this object can be discarded. If the row the user was editing is the row for new records, however, the old Customer object is discarded and replaced with a new one so that the user can begin making edits again. This example is part of a larger example available in [Walkthrough: Implementing Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/implementing-virtual-mode-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet170"::: @@ -3543,7 +3543,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3573,7 +3573,7 @@ The control replaces and extends the if there is an editable cell selected; otherwise, . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3621,7 +3621,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3678,7 +3678,7 @@ The control replaces and extends the The specified value when setting this property is not a valid value. The specified value when setting this property is . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3728,7 +3728,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3779,7 +3779,7 @@ The control replaces and extends the event handler in a Tic-Tac-Toe game implementation that uses image columns in a control. Unless the game is over or the cell has already been clicked, the event handler sets the cell value to one of two objects represented by the variables `x` and `o`. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet10"::: @@ -3787,7 +3787,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3842,7 +3842,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3892,7 +3892,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -3946,7 +3946,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4019,7 +4019,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4069,7 +4069,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4110,14 +4110,14 @@ The control replaces and extends the property in case it was previously set by a event handler. The event handler can clear the error text when the new cell value meets the validation criteria, but when the user reverts to the old cell value by pressing ESC, the event does not occur. This example is part of a larger example available in [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control). + The following code example illustrates how to handle this event to clear the row property in case it was previously set by a event handler. The event handler can clear the error text when the new cell value meets the validation criteria, but when the user reverts to the old cell value by pressing ESC, the event does not occur. This example is part of a larger example available in [Walkthrough: Validating Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/walkthrough-validating-data-in-the-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellEndEdit/datavalidation.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewDataValidation/VB/datavalidation.vb" id="Snippet20"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4167,7 +4167,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4217,7 +4217,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4288,8 +4288,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - Best Practices for Scaling the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Best Practices for Scaling the Windows Forms DataGridView Control @@ -4339,7 +4339,7 @@ The control replaces and extends the property, the display properties of the object returned by the property are used to render the cell. - For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). + For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. @@ -4374,9 +4374,9 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - How to: Customize Data Formatting in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + How to: Customize Data Formatting in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -4424,7 +4424,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4490,7 +4490,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4542,7 +4542,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4594,7 +4594,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4637,7 +4637,7 @@ The control replaces and extends the event handler in a Tic-Tac-Toe game implementation that uses image columns in a control. The event handler uses the cell value to determine the cursor and ToolTip to display. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: @@ -4645,7 +4645,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4688,7 +4688,7 @@ The control replaces and extends the event handler in a Tic-Tac-Toe game implementation that uses image columns in a control. The event handler resets the cursor and ToolTip, which are set in a event handler. - This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: @@ -4696,7 +4696,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4746,7 +4746,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4798,7 +4798,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -4836,7 +4836,7 @@ The control replaces and extends the or methods to paint other parts. You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. + You can handle this event to customize the appearance of cells in the control. You can paint entire cells yourself, or paint specific parts of cells and use the or methods to paint other parts. You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. When handling this event, you should access the cell through the parameters of the event handler, rather than access the cell directly. @@ -4845,7 +4845,7 @@ The control replaces and extends the control replaces and extends the - How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -4937,8 +4937,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -4990,7 +4990,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5043,8 +5043,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -5120,8 +5120,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -5171,7 +5171,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5241,7 +5241,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5292,7 +5292,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5350,7 +5350,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5404,7 +5404,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5446,7 +5446,7 @@ The control replaces and extends the event. @@ -5466,9 +5466,9 @@ The control replaces and extends the - Best Practices for Scaling the Windows Forms DataGridView Control - Virtual Mode in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Best Practices for Scaling the Windows Forms DataGridView Control + Virtual Mode in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -5512,7 +5512,7 @@ The control replaces and extends the event to retrieve values from the data store for display in the control. - For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). + For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -5530,8 +5530,8 @@ The control replaces and extends the - Virtual Mode in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Virtual Mode in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -5582,7 +5582,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5649,7 +5649,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5708,7 +5708,7 @@ The control replaces and extends the class. ## Examples - The following code example demonstrates how to enable copying in the control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + The following code example demonstrates how to enable copying in the control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: @@ -5722,7 +5722,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5772,7 +5772,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5822,7 +5822,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5895,7 +5895,7 @@ The control replaces and extends the The specified value when setting this property is less than 0. When setting this property, the property has been set. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5942,7 +5942,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -5995,8 +5995,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -6046,7 +6046,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6100,7 +6100,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6150,7 +6150,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6200,7 +6200,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6248,7 +6248,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6298,7 +6298,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6362,7 +6362,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6412,7 +6412,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6464,7 +6464,7 @@ The control replaces and extends the property. To force column headers to inherit the values, you must set the values in the object to the default values indicated for the class. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). If visual styles are enabled and is set to `true`, all header cells except the are painted using the current theme and the values are ignored. @@ -6478,8 +6478,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -6530,8 +6530,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -6620,7 +6620,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6678,7 +6678,7 @@ The control replaces and extends the property value of . - For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The control does not support double buffering. If is set to `true` in a derived control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -6692,7 +6692,7 @@ The control replaces and extends the The specified value when setting this property is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6742,7 +6742,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6793,7 +6793,7 @@ The control replaces and extends the The specified value when setting this property is and one or more columns have an property value of . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6843,7 +6843,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6893,7 +6893,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -6943,7 +6943,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7010,7 +7010,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7060,7 +7060,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7128,7 +7128,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7178,7 +7178,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7219,14 +7219,14 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7266,7 +7266,7 @@ The control replaces and extends the event, which you can handle to customize the type conversion. Otherwise, default type converters are used. Conversion errors may result in an exception if the event is not handled to prevent it. If the value is successfully converted, it is committed to the data store, raising the event for non-data-bound cells when the property value is `true`. If the value is successfully committed, the event occurs. ## Examples - The following code example calls the method within a event handler to raise the event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example calls the method within a event handler to raise the event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: @@ -7281,7 +7281,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7311,7 +7311,7 @@ The control replaces and extends the Creates a new accessible object for the . A new for the . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7347,7 +7347,7 @@ The control replaces and extends the Creates and returns a new . An empty . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7384,7 +7384,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7420,7 +7420,7 @@ The control replaces and extends the Creates and returns a new . An empty . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7501,8 +7501,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - How to: Get and Set the Current Cell in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + How to: Get and Set the Current Cell in the Windows Forms DataGridView Control @@ -7549,14 +7549,14 @@ The control replaces and extends the property in a row-painting scenario. In the example, this property is used to store the row index of the current cell. When the user changes the current cell to a different row, the row is forced to repaint itself. - This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet19"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7597,14 +7597,14 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7653,14 +7653,14 @@ The control replaces and extends the event. In this example, the event handler calls the method to raise the event and determine the current value of a . This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example demonstrates how to handle the event. In this example, the event handler calls the method to raise the event and determine the current value of a . This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7708,7 +7708,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7748,7 +7748,7 @@ The control replaces and extends the , , or property changes. - Handling this event is useful, for example, to programmatically resize rows and columns based on content updates. For more information, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + Handling this event is useful, for example, to programmatically resize rows and columns based on content updates. For more information, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). @@ -7767,7 +7767,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7823,7 +7823,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7882,7 +7882,7 @@ The control replaces and extends the An error occurred in the data source and either there is no handler for the event or the handler has set the property to . The exception object can typically be cast to type . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -7932,7 +7932,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8005,9 +8005,9 @@ The control replaces and extends the property of the object returned by the property to `null` rather than using the default value of , which is appropriate for database data. - For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). The following table provides direct links to common tasks related to the property. + For more information, see [Displaying Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/displaying-data-in-the-windows-forms-datagridview-control). The following table provides direct links to common tasks related to the property. - See [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) and [How to: Bind Objects to Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/how-to-bind-objects-to-windows-forms-datagridview-controls). + See [Walkthrough: Creating a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/creating-a-master-detail-form-using-two-datagridviews) and [How to: Bind Objects to Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/how-to-bind-objects-to-windows-forms-datagridview-controls). ## Examples The following code example demonstrates how to initialize a simple data-bound . It also demonstrates how to set the property. @@ -8031,8 +8031,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - Displaying Data in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Displaying Data in the Windows Forms DataGridView Control @@ -8082,7 +8082,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8132,7 +8132,7 @@ The control replaces and extends the - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -8145,8 +8145,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -8199,8 +8199,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -8288,7 +8288,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8322,7 +8322,7 @@ The control replaces and extends the Returns the number of columns displayed to the user. The number of columns displayed to the user. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8394,7 +8394,7 @@ The control replaces and extends the When overriding the property in a derived class, use the base class's property to extend the base implementation. Alternatively, you must provide all the implementation. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8428,7 +8428,7 @@ The control replaces and extends the Releases the unmanaged resources used by the and its child controls and optionally releases the managed resources. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8484,14 +8484,14 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8551,7 +8551,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8603,7 +8603,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8658,7 +8658,7 @@ The control replaces and extends the The specified value when setting this property is not a valid value. The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the event or the handler has set the property to . The exception object can typically be cast to type . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8708,7 +8708,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8759,7 +8759,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8819,7 +8819,7 @@ The control replaces and extends the The cell value could not be committed and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8864,7 +8864,7 @@ The control replaces and extends the The cell value could not be committed and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8934,7 +8934,7 @@ The control replaces and extends the property value of . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -8985,7 +8985,7 @@ The control replaces and extends the Gets the width of the portion of the column that is currently scrolled out of view. The width of the portion of the column that is scrolled out of view. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9034,7 +9034,7 @@ The control replaces and extends the property value of . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9091,7 +9091,7 @@ The control replaces and extends the property value of . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9137,10 +9137,10 @@ The control replaces and extends the is immutable (meaning that you cannot adjust any of its properties), you can only assign the property a new object. However, you can base the new font on the existing font. - The control uses the value of the property as the default value of the properties of objects returned by the , , and properties. Changing the value automatically updates the , , and properties, changing the font for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + The control uses the value of the property as the default value of the properties of objects returned by the , , and properties. Changing the value automatically updates the , , and properties, changing the font for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Create an Unbound Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control). + The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Create an Unbound Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-create-an-unbound-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/Overview/simpleunbound.cs" id="Snippet30"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSimpleUnbound/VB/simpleunbound.vb" id="Snippet30"::: @@ -9153,8 +9153,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -9213,7 +9213,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9267,7 +9267,7 @@ The control replaces and extends the is immutable (meaning that you cannot adjust any of its properties), you can only assign the property a new object. However, you can base the new font on the existing font. - The control uses the value of the property as the default value of the property of returned by the property. Changing the value automatically updates the property, changing the foreground text color for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + The control uses the value of the property as the default value of the property of returned by the property. Changing the value automatically updates the property, changing the foreground text color for any cell that inherits the value. Header cells override the value by default, and you can override the value for specific rows, columns, and cells. For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -9275,8 +9275,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -9334,7 +9334,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9408,7 +9408,7 @@ The control replaces and extends the control. In this example, if any cells are selected, their values are retrieved through the method and displayed in a control. - This code is part of a larger example illustrating the use of the Clipboard features of the control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + This code is part of a larger example illustrating the use of the Clipboard features of the control. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet16"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet16"::: @@ -9417,7 +9417,7 @@ The control replaces and extends the includes the value . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9469,7 +9469,7 @@ The control replaces and extends the is less than -1 or greater than the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9508,7 +9508,7 @@ The control replaces and extends the class. ## Examples - The following code example demonstrates how to programmatically add selected content to the Clipboard. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + The following code example demonstrates how to programmatically add selected content to the Clipboard. This example is part of a larger example available in [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: @@ -9523,7 +9523,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9561,7 +9561,7 @@ The control replaces and extends the To be added. is not in the valid range of 0 to the number of columns minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9599,7 +9599,7 @@ The control replaces and extends the To be added. is not in the valid range of 0 to the number of rows minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9647,7 +9647,7 @@ The control replaces and extends the property value that is less that 255. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9697,7 +9697,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9747,7 +9747,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9831,7 +9831,7 @@ The control replaces and extends the control replaces and extends the The specified value when setting this property is less than 0. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9850,7 +9850,7 @@ The control replaces and extends the Invalidates a cell in the , forcing it to be repainted. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9892,7 +9892,7 @@ The control replaces and extends the that is painted with a custom border when the mouse pointer rests on it. In the example, the cell is invalidated when the mouse pointer enters or leaves it. - This code is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + This code is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -9904,7 +9904,7 @@ The control replaces and extends the is . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -9946,7 +9946,7 @@ The control replaces and extends the . ## Examples - The following code example illustrates how to use this method in a custom cell type that changes a cell's appearance when the user rests the mouse pointer over it. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates how to use this method in a custom cell type that changes a cell's appearance when the user rests the mouse pointer over it. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -9960,7 +9960,7 @@ The control replaces and extends the is less than -1 or greater than the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10002,7 +10002,7 @@ The control replaces and extends the is not in the valid range of 0 to the number of columns minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10044,7 +10044,7 @@ The control replaces and extends the method in a row-painting scenario. In the example, the row is invalidated when the current cell changes, forcing the row to repaint itself. - This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet19"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet19"::: @@ -10054,7 +10054,7 @@ The control replaces and extends the is not in the valid range of 0 to the number of rows minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10100,14 +10100,14 @@ The control replaces and extends the is `true` and the current cell hosts an editing control, you can retrieve it through the property. ## Examples - The following code example uses the property to determine whether to commit a cell value and raise the event from a handler for the event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example uses the property to determine whether to commit a cell value and raise the event from a handler for the event. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet5"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet5"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10159,7 +10159,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10204,7 +10204,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10245,7 +10245,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10280,7 +10280,7 @@ The control replaces and extends the if the specified key is a regular input key; otherwise, . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10361,7 +10361,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10427,7 +10427,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10481,7 +10481,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10531,7 +10531,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10585,7 +10585,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10636,7 +10636,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10677,14 +10677,14 @@ The control replaces and extends the implementation derived from the class overrides the method and uses the method to indicate a change to the control. - This example is part of a larger example shown in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + This example is part of a larger example shown in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet310"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet310"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10729,7 +10729,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10774,7 +10774,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10819,7 +10819,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10863,7 +10863,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10907,7 +10907,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -10952,8 +10952,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -10997,7 +10997,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11042,7 +11042,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11088,7 +11088,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11132,7 +11132,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11176,7 +11176,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11220,7 +11220,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11264,7 +11264,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11308,7 +11308,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11357,7 +11357,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11401,7 +11401,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11450,7 +11450,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11499,7 +11499,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11548,7 +11548,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11597,7 +11597,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11647,7 +11647,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11696,7 +11696,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11745,7 +11745,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11794,7 +11794,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11843,7 +11843,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11892,7 +11892,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11941,7 +11941,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -11990,7 +11990,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12039,7 +12039,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12090,7 +12090,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12140,7 +12140,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12189,7 +12189,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12238,7 +12238,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12287,7 +12287,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12336,7 +12336,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12385,7 +12385,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12434,7 +12434,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12478,7 +12478,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12528,8 +12528,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -12575,8 +12575,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -12625,7 +12625,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12674,7 +12674,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12723,7 +12723,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12773,7 +12773,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12822,7 +12822,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12872,7 +12872,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12922,7 +12922,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -12967,7 +12967,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13012,7 +13012,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13057,7 +13057,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13103,8 +13103,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -13149,7 +13149,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13193,7 +13193,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13238,7 +13238,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13283,7 +13283,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13328,7 +13328,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13372,7 +13372,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13416,7 +13416,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13461,8 +13461,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -13506,7 +13506,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13550,7 +13550,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13595,7 +13595,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13640,7 +13640,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13684,7 +13684,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13729,7 +13729,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13775,7 +13775,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13820,7 +13820,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13865,7 +13865,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13909,7 +13909,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -13953,7 +13953,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14002,7 +14002,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14042,7 +14042,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14089,7 +14089,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14133,7 +14133,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14177,7 +14177,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14222,8 +14222,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -14267,7 +14267,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14311,7 +14311,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14355,7 +14355,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14402,7 +14402,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14484,7 +14484,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14530,7 +14530,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14576,7 +14576,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14652,7 +14652,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14696,7 +14696,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14729,7 +14729,7 @@ The control replaces and extends the Raises the event. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14780,7 +14780,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14830,7 +14830,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14880,7 +14880,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14924,7 +14924,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -14972,7 +14972,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15055,7 +15055,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15088,7 +15088,7 @@ The control replaces and extends the Raises the event. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15133,7 +15133,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15205,7 +15205,7 @@ The control replaces and extends 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. ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -15215,7 +15215,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15259,7 +15259,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15303,7 +15303,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15379,7 +15379,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15424,7 +15424,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15483,7 +15483,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15528,7 +15528,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15572,7 +15572,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15649,7 +15649,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15693,7 +15693,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15739,8 +15739,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -15784,7 +15784,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15828,7 +15828,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15873,7 +15873,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15917,7 +15917,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -15962,7 +15962,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16007,7 +16007,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16052,7 +16052,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16084,7 +16084,7 @@ The control replaces and extends the A that contains information about the mouse and the header cell that was clicked. Raises the event. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16116,7 +16116,7 @@ The control replaces and extends the A that contains information about the mouse and the header cell that was double-clicked. Raises the event. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16160,7 +16160,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16205,8 +16205,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -16250,7 +16250,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16294,7 +16294,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16339,7 +16339,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16383,7 +16383,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16427,7 +16427,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16471,7 +16471,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16516,7 +16516,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16560,7 +16560,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16604,7 +16604,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16648,7 +16648,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16693,8 +16693,8 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -16738,7 +16738,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16785,7 +16785,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16830,7 +16830,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16874,7 +16874,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16918,7 +16918,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -16962,7 +16962,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17006,7 +17006,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17051,7 +17051,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17095,7 +17095,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class' method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17140,7 +17140,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17184,7 +17184,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17228,7 +17228,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17275,7 +17275,7 @@ The control replaces and extends the When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17361,7 +17361,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17422,7 +17422,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17466,7 +17466,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17507,7 +17507,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17595,7 +17595,7 @@ The control replaces and extends the When overriding this method, a control should return to indicate that it has processed the key. For keys that are not processed by the control, return the result of the base version of this method. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17637,7 +17637,7 @@ The control replaces and extends the The DELETE key would delete one or more rows, but an error in the data source prevents the deletion and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17691,7 +17691,7 @@ The control replaces and extends the When overriding this method, a control should return to indicate that it has processed the key. For keys that are not processed by the control, return the result of the base version of this method. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17727,7 +17727,7 @@ The control replaces and extends the To be added. The DOWN ARROW key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17763,7 +17763,7 @@ The control replaces and extends the To be added. The END key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17799,7 +17799,7 @@ The control replaces and extends the To be added. The ENTER key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17833,7 +17833,7 @@ The control replaces and extends the if the key was processed; otherwise, . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17869,7 +17869,7 @@ The control replaces and extends the To be added. The F2 key would cause the control to enter edit mode, but the property of the current cell does not indicate a class that derives from and implements . The F2 key would cause the control to enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17937,7 +17937,7 @@ The control replaces and extends the To be added. The HOME key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -17971,7 +17971,7 @@ The control replaces and extends the if the key was processed; otherwise, . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18017,7 +18017,7 @@ The control replaces and extends the When overriding this method, a control should return to indicate that it has processed the message. For messages that are not processed by the control, return the result of the base version of this method. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18063,7 +18063,7 @@ The control replaces and extends the When overriding this method, a control should return to indicate that it has processed the message. For messages that are not processed by the control, return the result of the base version of this method. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18099,7 +18099,7 @@ The control replaces and extends the To be added. The LEFT ARROW key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18135,7 +18135,7 @@ The control replaces and extends the To be added. The PAGE DOWN key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18171,7 +18171,7 @@ The control replaces and extends the To be added. The PAGE UP key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18217,7 +18217,7 @@ The control replaces and extends the The RIGHT ARROW key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18251,7 +18251,7 @@ The control replaces and extends the if the key was processed; otherwise, . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18287,7 +18287,7 @@ The control replaces and extends the To be added. The TAB key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18323,7 +18323,7 @@ The control replaces and extends the To be added. The UP ARROW key would cause the control to enter edit mode, but the property of the new current cell does not indicate a class that derives from and implements . This action would commit a cell value or enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18359,7 +18359,7 @@ The control replaces and extends the To be added. The 0 key would cause the control to enter edit mode, but the property of the current cell does not indicate a class that derives from and implements . This action would cause the control to enter edit mode, but an error in the data source prevents the action and either there is no handler for the event or the handler has set the property to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18414,7 +18414,7 @@ The control replaces and extends the The specified value when setting this property is , the current cell is in edit mode, and the current cell contains changes that cannot be committed. The specified value when setting this property would cause the control to enter edit mode, but initialization of the editing cell value failed and either there is no handler for the event or the handler has set the property to . The exception object can typically be cast to type . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18464,7 +18464,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18502,7 +18502,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18594,7 +18594,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18664,7 +18664,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18741,7 +18741,7 @@ The control replaces and extends the is set to . When setting this property, the property is set. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18794,8 +18794,8 @@ The control replaces and extends the - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) @@ -18842,7 +18842,7 @@ The control replaces and extends the control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18904,7 +18904,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -18956,7 +18956,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19008,7 +19008,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19058,7 +19058,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19130,7 +19130,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19180,7 +19180,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19228,7 +19228,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19278,7 +19278,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19341,7 +19341,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19391,7 +19391,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19443,7 +19443,7 @@ The control replaces and extends the property. To force row headers to inherit the values, you must set the values in the object to the default values indicated for the class. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ## Examples The following code example illustrates how to use this property in a with custom colors. Note how the property is set to so that the value is inherited from the object. @@ -19456,8 +19456,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -19510,8 +19510,8 @@ The control replaces and extends the - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -19562,7 +19562,7 @@ The control replaces and extends the The specified value when setting this property is and the property is set to or . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19609,7 +19609,7 @@ The control replaces and extends the property in a row-painting scenario. In the example, the value of this property is used to calculate the bounds within which a custom background is drawn. - This code is part of a larger example available in[How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + This code is part of a larger example available in[How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: @@ -19618,7 +19618,7 @@ The control replaces and extends the The specified value when setting this property is less than the minimum width of 4 pixels or is greater than the maximum width of 32768 pixels. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19668,7 +19668,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19724,7 +19724,7 @@ The control replaces and extends the property. - For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about header sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). > [!NOTE] > The control does not support double buffering. If is set to `true` in a derived control, users will not receive visual feedback when resizing rows, columns, or headers or when reordering columns. @@ -19738,7 +19738,7 @@ The control replaces and extends the The specified value when setting this property is not a valid value. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19788,7 +19788,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19829,14 +19829,14 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19893,7 +19893,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19950,7 +19950,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -19998,7 +19998,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20048,7 +20048,7 @@ The control replaces and extends the - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20098,19 +20098,19 @@ The control replaces and extends the - You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. + You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use a handler for the event to paint textual content that spans the entire row below the normal cell values. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example demonstrates how to use a handler for the event to paint textual content that spans the entire row below the normal cell values. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20160,19 +20160,19 @@ The control replaces and extends the - You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. + You can also use the class to paint standard controls using the current theme. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). If you are using Visual Studio 2005, you also have access to a large library of standard images that you can use with the control. For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use a handler for the event to paint a gradient row background if the row is selected. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example demonstrates how to use a handler for the event to paint a gradient row background if the row is selected. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20225,7 +20225,7 @@ this.dataGridView1.Rows.Add("five", "six", "seven", "eight");this.dataGridView1. Rows include style information in addition to cell values. For this reason, you might want to add or insert rows based on existing rows that you have already styled. You can do this using the , , , and methods. - You can also use the collection to modify the values in the control or to remove rows. You can modify values or remove rows regardless of whether the control is bound to an external data source. If there is a data source, the changes are made directly to the data source. You may still need to push the data source updates to a remote database, however. For more information, see [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control). + You can also use the collection to modify the values in the control or to remove rows. You can modify values or remove rows regardless of whether the control is bound to an external data source. If there is a data source, the changes are made directly to the data source. You may still need to push the data source updates to a remote database, however. For more information, see [How to: Bind Data to the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-bind-data-to-the-windows-forms-datagridview-control). The following example shows you how to modify cell values programmatically. @@ -20279,7 +20279,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20339,7 +20339,7 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20373,7 +20373,7 @@ if (rowToDelete > -1) ## Remarks The control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . For cells in all rows, excluding header cells, the styles specified through the property override the styles specified through the and properties, and are overridden by the styles specified through the , , and properties. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -20386,8 +20386,8 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -20440,8 +20440,8 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) - Cell Styles in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control @@ -20494,7 +20494,7 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20544,7 +20544,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20608,7 +20608,7 @@ if (rowToDelete > -1) ]]> The specified row when setting this property has its property set. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20664,7 +20664,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20714,7 +20714,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20764,7 +20764,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20814,7 +20814,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20866,7 +20866,7 @@ if (rowToDelete > -1) The specified value when setting this property is not a valid value. The value of this property cannot be set because the is unable to scroll due to a cell change that cannot be committed or canceled. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20910,7 +20910,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -20960,7 +20960,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21010,7 +21010,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21063,7 +21063,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21118,7 +21118,7 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21177,7 +21177,7 @@ if (rowToDelete > -1) The specified value when setting this property is not a valid value. The specified value when setting this property is or and the property of one or more columns is set to . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21218,7 +21218,7 @@ if (rowToDelete > -1) This member overrides . To be added. One or both of the width or height values exceeds the maximum value of 8,388,607. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21284,7 +21284,7 @@ if (rowToDelete > -1) This method was called for a reason other than the underlying data source being reset, and another thread is currently executing this method. The new current cell tried to enter edit mode, but its property does not indicate a class that derives from and implements . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21334,7 +21334,7 @@ if (rowToDelete > -1) -or- is less than 0 or greater than the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21378,7 +21378,7 @@ if (rowToDelete > -1) is less than 0 or greater than the number of columns in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21422,7 +21422,7 @@ if (rowToDelete > -1) is less than 0 or greater than the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21458,7 +21458,7 @@ if (rowToDelete > -1) if a red glyph will appear in a cell that fails validation; otherwise, . The default is . To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21512,7 +21512,7 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21559,7 +21559,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21616,7 +21616,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21682,7 +21682,7 @@ if (rowToDelete > -1) -or- is not . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21727,7 +21727,7 @@ if (rowToDelete > -1) When the property has been set, this method works for data-bound columns only. Data-bound columns have had their property set. This causes the property to return `true`. - If your control contains both bound and unbound columns, you must implement virtual mode to maintain the values of the unbound columns when the control is sorted by a bound column. You can do this by setting the property to `true` and handling the event. If the column is editable, you should also handle the event. For more information about virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). Sorting by unbound columns when the control is data-bound is not supported. + If your control contains both bound and unbound columns, you must implement virtual mode to maintain the values of the unbound columns when the control is sorted by a bound column. You can do this by setting the property to `true` and handling the event. If the column is editable, you should also handle the event. For more information about virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). Sorting by unbound columns when the control is data-bound is not supported. ## Examples The following code example demonstrates how to use the in a programmatic sort. @@ -21753,7 +21753,7 @@ if (rowToDelete > -1) -or- The object specified by the property has a property value of . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21804,7 +21804,7 @@ if (rowToDelete > -1) For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). ## Examples - The following code example demonstrates how to use the in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + The following code example demonstrates how to use the in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: @@ -21816,8 +21816,8 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) - How to: Customize Sorting in the Windows Forms DataGridView Control + DataGridView Control (Windows Forms) + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -21869,7 +21869,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21933,7 +21933,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -21988,7 +21988,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22041,7 +22041,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22093,7 +22093,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22134,7 +22134,7 @@ if (rowToDelete > -1) This method has already been called for this control. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22174,7 +22174,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22224,7 +22224,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22274,7 +22274,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22333,7 +22333,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22382,7 +22382,7 @@ if (rowToDelete > -1) -or- is less than -1 or greater than the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22431,7 +22431,7 @@ if (rowToDelete > -1) -or- is less than zero or greater than the number of rows in the control minus one. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22481,7 +22481,7 @@ if (rowToDelete > -1) is not in the valid range of 0 to the number of rows in the control minus 1. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22532,7 +22532,7 @@ if (rowToDelete > -1) -or- is less than . - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22592,7 +22592,7 @@ if (rowToDelete > -1) is greater than the highest row index in the collection. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22640,7 +22640,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22690,7 +22690,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22740,7 +22740,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22793,7 +22793,7 @@ if (rowToDelete > -1) - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22828,7 +22828,7 @@ if (rowToDelete > -1) Gets the vertical scroll bar of the control. A representing the vertical scroll bar. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22875,7 +22875,7 @@ if (rowToDelete > -1) Gets the number of pixels by which the control is scrolled vertically. The number of pixels by which the control is scrolled vertically. To be added. - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22918,7 +22918,7 @@ if (rowToDelete > -1) property is `true`, you create a with a set number of rows and columns and then handle the event to populate the cells. Virtual mode requires implementation of an underlying data cache to handle the population, editing, and deletion of cells based on actions of the user. For more information about implementing virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). + Virtual mode is designed for use with very large stores of data. When the property is `true`, you create a with a set number of rows and columns and then handle the event to populate the cells. Virtual mode requires implementation of an underlying data cache to handle the population, editing, and deletion of cells based on actions of the user. For more information about implementing virtual mode, see [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). You must use virtual mode to maintain the values of unbound columns when the control is in bound mode. Sorting by unbound columns in bound mode is not supported. @@ -22930,7 +22930,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) @@ -22969,7 +22969,7 @@ if (rowToDelete > -1) ]]> - DataGridView Control (Windows Forms) + DataGridView Control (Windows Forms) diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml index 1c93c13ef7f..58e5815addb 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnMode.xml @@ -22,27 +22,27 @@ Defines values for specifying how the width of a column is adjusted. - control can resize its columns to make them fill the available horizontal width of the control or to make them display the full contents of all cells or of specified cells. - - With Fill mode, the preferred width of a column is determined by resizing all columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. With other modes, the preferred column width is the minimum width required to display the largest cell value from all cells or a subset of cells in that column, such as the subset of cells that are in currently displayed rows. Using a subset of cells to determine the new width is useful to avoid a performance penalty when working with many rows of data. - - Content-based automatic resizing prevents users from adjusting column widths with the mouse. User resizing is enabled in fill mode, however. - - This enumeration is used by the and properties of columns and the method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration to configure a fixed-width column. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). - + control can resize its columns to make them fill the available horizontal width of the control or to make them display the full contents of all cells or of specified cells. + + With Fill mode, the preferred width of a column is determined by resizing all columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. With other modes, the preferred column width is the minimum width required to display the largest cell value from all cells or a subset of cells in that column, such as the subset of cells that are in currently displayed rows. Using a subset of cells to determine the new width is useful to avoid a performance penalty when working with many rows of data. + + Content-based automatic resizing prevents users from adjusting column widths with the mouse. User resizing is enabled in fill mode, however. + + This enumeration is used by the and properties of columns and the method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration to configure a fixed-width column. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet10"::: + ]]> @@ -51,9 +51,9 @@ - Sizing Options in the Windows Forms DataGridView Control - Column Fill Mode in the Windows Forms DataGridView Control - How to: Set the Sizing Modes of the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + Column Fill Mode in the Windows Forms DataGridView Control + How to: Set the Sizing Modes of the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml index a0dd3b18de9..aadd346fdef 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventArgs.xml @@ -29,22 +29,22 @@ Provides data for the event. - event is raised when the value of the property of a column in a control changes. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - + event is raised when the value of the property of a column in a control changes. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet180"::: + ]]> @@ -54,7 +54,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -97,7 +97,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -133,15 +133,15 @@ Gets the column with the property that changed. The with the property that changed. - @@ -149,7 +149,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -184,23 +184,23 @@ Gets the previous value of the property of the column. An value representing the previous value of the property 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 type named `DataGridView1`. Then 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet280"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet280"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet280"::: + ]]> - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml index 7a7a6cf94b0..d1851600107 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnModeEventHandler.xml @@ -39,13 +39,13 @@ A that contains the event data. Represents the method that will handle the event of a control. - event is raised when the value of the property of a column in a control changes. - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - + event is raised when the value of the property of a column in a control changes. + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + ]]> @@ -54,6 +54,6 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml index 886770349f7..774999d58b6 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsMode.xml @@ -22,27 +22,27 @@ Defines values for specifying how the widths of columns are adjusted. - control can resize its columns to make them fill the available horizontal width of the control or to make them display the full contents of all cells or of specified cells. - - With mode, the preferred width of a column is determined by resizing all columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. With other modes, the preferred column width is the minimum width required to display the largest cell value from all cells or a subset of cells in that column, such as the subset of cells that are in currently displayed rows. Using a subset of cells to determine the new width is useful to avoid a performance penalty when working with many rows of data. - - Content-based automatic resizing prevents users from adjusting column widths with the mouse. User resizing is enabled in fill mode, however. - - This enumeration is used by the control property and method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration in a master/details scenario where two controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is None and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/framework/winforms/controls/create-a-master-detail-form-using-two-datagridviews). - + control can resize its columns to make them fill the available horizontal width of the control or to make them display the full contents of all cells or of specified cells. + + With mode, the preferred width of a column is determined by resizing all columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. With other modes, the preferred column width is the minimum width required to display the largest cell value from all cells or a subset of cells in that column, such as the subset of cells that are in currently displayed rows. Using a subset of cells to determine the new width is useful to avoid a performance penalty when working with many rows of data. + + Content-based automatic resizing prevents users from adjusting column widths with the mouse. User resizing is enabled in fill mode, however. + + This enumeration is used by the control property and method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). For more information about column fill mode in particular, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration in a master/details scenario where two controls display data from two tables in a parent/child relationship. In this example, the column sizing mode for the master control is None and the column widths are programmatically initialized to fit the loaded values. The details control is set to an automatic sizing mode so that columns will adjust automatically whenever the values change (for example, when the user changes the current row in the parent table). This example is part of a larger example available in [How to: Create a Master/Detail Form Using Two Windows Forms DataGridView Controls](/dotnet/desktop/winforms/controls/create-a-master-detail-form-using-two-datagridviews). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeColumnsMode/masterdetails.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMasterDetails/VB/masterdetails.vb" id="Snippet10"::: + ]]> @@ -51,8 +51,8 @@ - Sizing Options in the Windows Forms DataGridView Control - Column Fill Mode in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + Column Fill Mode in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml index f1fadd15871..603d7859ff3 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventArgs.xml @@ -29,23 +29,23 @@ Provides data for the event. - event is raised when the value of the property of the control changes. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates the use of this type. 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + event is raised when the value of the property of the control changes. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates the use of this type. 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet257"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: + ]]> @@ -55,7 +55,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -97,7 +97,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -133,16 +133,16 @@ Gets an array of the previous values of the column properties. An array of values representing the previous values of the column properties. - 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 type named `DataGridView1`. Then 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet257"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet257"::: + ]]> @@ -150,7 +150,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml index 88b51b8dc5e..05af8a404cf 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeColumnsModeEventHandler.xml @@ -39,13 +39,13 @@ A that contains the event data. Represents the method that will handle the event of a control. - event is raised when the value of the property of the control changes. - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - + event is raised when the value of the property of the control changes. + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + ]]> @@ -54,6 +54,6 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml index 8161cb7a369..2942f553ca9 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventArgs.xml @@ -23,22 +23,22 @@ Provides data for the and events. - event is raised when the value of the property of the control changes. The event is raised when the value of the property changes. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to process the event. This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). - + event is raised when the value of the property of the control changes. The event is raised when the value of the property changes. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to process the event. This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]> @@ -49,7 +49,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -85,11 +85,11 @@ if the property was previously set to any value other than or the property was previously set to any value other than or ; otherwise, . Initializes a new instance of the class. - and events, pass in `true` for `previousModeAutoSized` if the already had an automatic resizing mode and the new mode is different. Otherwise, pass in `false` for `previousModeAutoSized`. - + and events, pass in `true` for `previousModeAutoSized` if the already had an automatic resizing mode and the new mode is different. Otherwise, pass in `false` for `previousModeAutoSized`. + ]]> @@ -99,7 +99,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -135,20 +135,20 @@ if the property was previously set to any value other than or the property was previously set to any value other than or ; otherwise, . - class is used with the and events, so this property relates specifically to the previous state of either the or property - - - -## Examples - The following code example uses the property to check the previous value for a . This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). - + class is used with the and events, so this property relates specifically to the previous state of either the or property + + + +## Examples + The following code example uses the property to check the previous value for a . This code example is part of a larger example provided at [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]> @@ -158,7 +158,7 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml index abcbc726052..ab83fc0350d 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeModeEventHandler.xml @@ -39,22 +39,22 @@ A that contains the event data. Represents the method that will handle the or events of a . - event is raised when the value of the property of the control changes. The event is raised when the value of the property changes. - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code demonstrates how to handle the event. - + event is raised when the value of the property of the control changes. The event is raised when the value of the property changes. + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code demonstrates how to handle the event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet10"::: + ]]> @@ -65,6 +65,6 @@ - Resizing Columns and Rows in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml index 6426fa2a3ef..d21e82a57ae 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeRowMode.xml @@ -22,32 +22,32 @@ Defines values for specifying how the height of a row is adjusted. - control can resize its rows based on the preferred height of each row. The preferred row height is the minimum height required to display the largest cell value in that row. Different size modes let you indicate which cells are used to calculate the new heights (either header cells or non-header cells) and whether to resize all rows or only the rows that are currently displayed. Resizing a subset of rows is useful to avoid a performance penalty when working with many rows of data. - - Content-based automatic resizing prevents users from adjusting row heights with the mouse. - - This enumeration is used by the control method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example resizes the third row in the control to fit the contents of its nonheader cells. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). - + control can resize its rows based on the preferred height of each row. The preferred row height is the minimum height required to display the largest cell value in that row. Different size modes let you indicate which cells are used to calculate the new heights (either header cells or non-header cells) and whether to resize all rows or only the rows that are currently displayed. Resizing a subset of rows is useful to avoid a performance penalty when working with many rows of data. + + Content-based automatic resizing prevents users from adjusting row heights with the mouse. + + This enumeration is used by the control method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example resizes the third row in the control to fit the contents of its nonheader cells. This code example is part of a larger example provided in [How to: Programmatically Resize Cells to Fit Content in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/programmatically-resize-cells-to-fit-content-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/CPP/programmaticsizing.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumns/programmaticsizing.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/VB/programmaticsizing.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ProgrammaticResizing/VB/programmaticsizing.vb" id="Snippet4"::: + ]]> - Sizing Options in the Windows Forms DataGridView Control - How to: Programmatically Resize Cells To Fit Content in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + How to: Programmatically Resize Cells To Fit Content in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml b/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml index 0b24424b25f..30e4bcd155f 100644 --- a/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml +++ b/xml/System.Windows.Forms/DataGridViewAutoSizeRowsMode.xml @@ -22,33 +22,33 @@ Defines values for specifying how the heights of rows are adjusted. - control can resize its rows based on the preferred height of each row. The preferred row height is the minimum height required to display the largest cell value in that row. Different size modes let you indicate which cells are used to calculate the new heights (either header cells or nonheader cells) and whether to resize all rows or only the rows that are currently displayed. Resizing a subset of rows is useful to avoid a performance penalty when working with many rows of data. - - Content-based automatic resizing prevents users from adjusting row heights with the mouse. - - This enumeration is used by the control property and method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example sets rows to automatically resize their height whenever cell contents change. The new row height is determined from the contents of all rows and columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). - + control can resize its rows based on the preferred height of each row. The preferred row height is the minimum height required to display the largest cell value in that row. Different size modes let you indicate which cells are used to calculate the new heights (either header cells or nonheader cells) and whether to resize all rows or only the rows that are currently displayed. Resizing a subset of rows is useful to avoid a performance penalty when working with many rows of data. + + Content-based automatic resizing prevents users from adjusting row heights with the mouse. + + This enumeration is used by the control property and method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example sets rows to automatically resize their height whenever cell contents change. The new row height is determined from the contents of all rows and columns. This code example is part of a larger example provided in [How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/automatically-resize-cells-when-content-changes-in-the-datagrid). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/CPP/autosizing.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoSizeRowsMode/autosizing.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.AutoSizing/VB/autosizing.vb" id="Snippet9"::: + ]]> - Sizing Options in the Windows Forms DataGridView Control - How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + How to: Automatically Resize Cells When Content Changes in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewBand.xml b/xml/System.Windows.Forms/DataGridViewBand.xml index 38f0733ca3f..67a837deaa1 100644 --- a/xml/System.Windows.Forms/DataGridViewBand.xml +++ b/xml/System.Windows.Forms/DataGridViewBand.xml @@ -227,7 +227,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -571,7 +571,7 @@ ## Remarks Getting the value of the property automatically instantiates a new if the property has not previously been accessed. You must, therefore, use the property to determine whether the property is currently set to a instance. This is useful to determine which properties of the object returned by the property represent styles set specifically for the band. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -737,7 +737,7 @@ ## Remarks The implementation of this property in the class always returns `null` because this base class cannot contain elements. - For more information about style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -745,7 +745,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewButtonCell.xml b/xml/System.Windows.Forms/DataGridViewButtonCell.xml index e9fded1fa7f..2f9fd878f8a 100644 --- a/xml/System.Windows.Forms/DataGridViewButtonCell.xml +++ b/xml/System.Windows.Forms/DataGridViewButtonCell.xml @@ -50,7 +50,7 @@ ## Examples - The following code example demonstrates how to use a to perform actions on particular rows. You can use similar code when working with individual objects. In this example, a event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + The following code example demonstrates how to use a to perform actions on particular rows. You can use similar code when working with individual objects. In this example, a event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: @@ -469,7 +469,7 @@ ]]> - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -517,7 +517,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -565,7 +565,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -611,7 +611,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -656,7 +656,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -702,7 +702,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -748,7 +748,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -801,7 +801,7 @@ - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control @@ -856,7 +856,7 @@ - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewButtonColumn.xml b/xml/System.Windows.Forms/DataGridViewButtonColumn.xml index aace3ec98f6..c3c65dda4b1 100644 --- a/xml/System.Windows.Forms/DataGridViewButtonColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewButtonColumn.xml @@ -41,28 +41,28 @@ Hosts a collection of objects. - class is a specialized type of the class used to logically host cells that respond to simple user input. A has an associated in every that intersects it. Each cell supplies a user interface (UI) that is similar to a control. - - To display the same button text for every cell, set the property to `true` and set the property to the desired button text. - - The default sort mode for this column type is . - - To respond to user button clicks, handle the or event. In the event handler, you can use the property to determine whether the click occurred in the button column. You can use the property to determine whether the click occurred in a button cell and not on the column header. - + class is a specialized type of the class used to logically host cells that respond to simple user input. A has an associated in every that intersects it. Each cell supplies a user interface (UI) that is similar to a control. + + To display the same button text for every cell, set the property to `true` and set the property to the desired button text. + + The default sort mode for this column type is . + + To respond to user button clicks, handle the or event. In the event handler, you can use the property to determine whether the click occurred in the button column. You can use the property to determine whether the click occurred in a button cell and not on the column header. + > [!NOTE] -> When visual styles are enabled, the buttons in a button column are painted using a , and cell styles specified through properties such as have no effect. - - - -## Examples - The following code example demonstrates how to use a to perform actions on particular rows. In this example, a event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/framework/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). - +> When visual styles are enabled, the buttons in a button column are painted using a , and cell styles specified through properties such as have no effect. + + + +## Examples + The following code example demonstrates how to use a to perform actions on particular rows. In this example, a event handler first determines whether a click is on a button cell, then retrieves a business object associated with the row. This example is part of a larger example available in [How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List](/dotnet/desktop/winforms/controls/access-objects-in-a-wf-datagridviewcomboboxcell-drop-down-list). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoGenerateColumns/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewComboBoxObjectBinding/vb/form1.vb" id="Snippet100"::: + ]]> @@ -75,7 +75,7 @@ - How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control + How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control @@ -100,16 +100,16 @@ Initializes a new instance of the class to the default state. - |A new .| -|The property of the object returned by the property.|| - + |A new .| +|The property of the object returned by the property.|| + ]]> @@ -161,23 +161,23 @@ Gets or sets the template used to create new cells. A that all other cells in the column are modeled after. - class initializes this property to a newly created . - + class initializes this property to a newly created . + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). - - - -## Examples - The following code example demonstrates how to use a to view the sales an employee has made. A cell template is used to apply the same color to all buttons. This example is part of a larger example available in the class overview topic. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). + + + +## Examples + The following code example demonstrates how to use a to view the sales an employee has made. A cell template is used to apply the same color to all buttons. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]> The specified value when setting this property could not be cast to a . @@ -215,11 +215,11 @@ Creates an exact copy of this column. An that represents the cloned . - The value of the property is . @@ -266,28 +266,28 @@ Gets or sets the column's default cell style. The to be applied as the default style. - returned by this property has an initial property value of . This value overrides the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - + returned by this property has an initial property value of . This value overrides the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + > [!NOTE] -> When visual styles are enabled, the buttons in a button column are painted using a and cell styles specified through properties such as have no effect. - - - -## Examples - The following code example demonstrates the use of this property. - +> When visual styles are enabled, the buttons in a button column are painted using a and cell styles specified through properties such as have no effect. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -334,22 +334,22 @@ Gets or sets the flat-style appearance of the button cells in the column. A value indicating the appearance of the buttons in the column. The default is . - property specifies the appearance of the cells in the column. For more information, see the enumeration. - - Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to use a to view the sales an employee has made. This example is part of a larger example available in the class overview topic. - + property specifies the appearance of the cells in the column. For more information, see the enumeration. + + Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to use a to view the sales an employee has made. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]> The value of the property is . @@ -397,22 +397,22 @@ Gets or sets the default text displayed on the button cell. A that contains the text. The default is . - contained in the column that has as a property value of `true` displays the property value on the cell's button. - - If there is an associated control, changing this property refreshes the column display. - - - -## Examples - The following code example demonstrates how to use a to view the sales an employee has made. The property is used to set the column header. This example is part of a larger example available in the class overview topic. - + contained in the column that has as a property value of `true` displays the property value on the cell's button. + + If there is an associated control, changing this property refreshes the column display. + + + +## Examples + The following code example demonstrates how to use a to view the sales an employee has made. The property is used to set the column header. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet10"::: + ]]> When setting this property, the value of the property is . @@ -498,21 +498,21 @@ if the property value is displayed on buttons in the column; if the property value of each cell is displayed on its button. The default is . - of a button cell is displayed as the text on the button. The property allows you to either set the button text for each cell, or to use the property value for all of the button cells. - - Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates the use of this property. - + of a button cell is displayed as the text on the button. The property allows you to either set the button text for each cell, or to use the property value for all of the button cells. + + Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet010"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet010"::: + ]]> The value of the property is . @@ -522,7 +522,7 @@ - How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control + How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCell.xml b/xml/System.Windows.Forms/DataGridViewCell.xml index 6e6efc8c5ec..e18307c6910 100644 --- a/xml/System.Windows.Forms/DataGridViewCell.xml +++ b/xml/System.Windows.Forms/DataGridViewCell.xml @@ -54,7 +54,7 @@ ## Examples - The following code example illustrates the use of this type. For more information about this example, see [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). + The following code example illustrates the use of this type. For more information about this example, see [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: @@ -265,7 +265,7 @@ ## Examples - The following code example demonstrates how to use the method of the class to determine the available drawing area in a cell. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example demonstrates how to use the method of the class to determine the available drawing area in a cell. This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet20"::: @@ -319,7 +319,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -509,7 +509,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -554,7 +554,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -714,7 +714,7 @@ ## Examples - The following code example demonstrates how to override the property in a `CalendarCell` class that derives from . This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the property in a `CalendarCell` class that derives from . This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -966,7 +966,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1091,7 +1091,7 @@ ## Examples - The following code example demonstrates how to override the property in a `CalendarCell` class that derives from . This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the property in a `CalendarCell` class that derives from . This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -1152,7 +1152,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2048,7 +2048,7 @@ that inherits its settings from the objects of the cell's parent row, column, and . For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + This method returns a that inherits its settings from the objects of the cell's parent row, column, and . For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -2235,7 +2235,7 @@ ## Remarks Getting the value of the property automatically instantiates a new if the property has not previously been accessed. Therefore, you must use the property to determine whether the property is currently set to a instance. This is useful to determine which properties of the object returned by the property represent styles set specifically for the cell. - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -2323,7 +2323,7 @@ ## Remarks The control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . The styles specified through the property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -2404,7 +2404,7 @@ ## Examples - The following code example demonstrates how to override the method in a simple class that derives from the class. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + The following code example demonstrates how to override the method in a simple class that derives from the class. This example is part of a larger code example provided in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet200"::: @@ -2510,7 +2510,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2601,7 +2601,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2652,7 +2652,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2701,7 +2701,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3113,7 +3113,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3157,7 +3157,7 @@ ]]> - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3210,7 +3210,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3261,7 +3261,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3312,7 +3312,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3363,7 +3363,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -3414,7 +3414,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -4026,7 +4026,7 @@ ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -4082,7 +4082,7 @@ ## Examples - The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/framework/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). + The following code example illustrates the use of this method. This example is part of a larger example available in [How to: Customize Cells and Columns in the Windows Forms DataGridView Control by Extending Their Behavior and Appearance](/dotnet/desktop/winforms/controls/customize-cells-and-columns-in-the-datagrid-by-extending-behavior). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/InvalidateCell/rollovercell.cs" id="Snippet220"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRolloverCell/VB/rollovercell.vb" id="Snippet220"::: @@ -4373,7 +4373,7 @@ method of a . This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). + The following code example demonstrates how to override the method of a . This code example is part of a larger example provided in [How to: Disable Buttons in a Button Column in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/disable-buttons-in-a-button-column-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CommitEdit/form1.cs" id="Snippet20"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DisabledButtons/VB/form1.vb" id="Snippet20"::: @@ -4430,7 +4430,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -5114,7 +5114,7 @@ ## Remarks The control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . The styles specified through the property override the styles specified through all other cell-style properties, but do not necessarily indicate all the styles that contribute to the cell's appearance. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). @@ -5255,7 +5255,7 @@ ## Examples - The following code example shows how to set the property within an event handler for the event. This example is part of a larger code example provided in [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). + The following code example shows how to set the property within an event handler for the event. This example is part of a larger code example provided in [How to: Add ToolTips to Individual Cells in a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/add-tooltips-to-individual-cells-in-a-wf-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: @@ -5359,7 +5359,7 @@ ## Examples - The following code example shows how to update a cell's contents with the property. This example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example shows how to update a cell's contents with the property. This example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: diff --git a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml index c0cd5ad5193..501898f6559 100644 --- a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventArgs.xml @@ -68,7 +68,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml index 85c6a194a32..9a11f7cf5b3 100644 --- a/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellContextMenuStripNeededEventHandler.xml @@ -79,6 +79,6 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml index 51250c5c87c..6759c0784e9 100644 --- a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventArgs.xml @@ -63,7 +63,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml index 6af4fa9719a..3221bac817c 100644 --- a/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellErrorTextNeededEventHandler.xml @@ -74,6 +74,6 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml index 6e11398b978..f55b7767d31 100644 --- a/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellEventArgs.xml @@ -23,52 +23,52 @@ Provides data for events related to cell and row operations. - class provides data for the following events: - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - - -## Examples - The following code example demonstrates using and event handlers to determine whether a cell can be clicked. The example updates each property value to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + class provides data for the following events: + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + + +## Examples + The following code example demonstrates using and event handlers to determine whether a cell can be clicked. The example updates each property value to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: + ]]> @@ -104,10 +104,10 @@ Initializes a new instance of the class. To be added. - is less than -1. - - -or- - + is less than -1. + + -or- + is less than -1. @@ -144,14 +144,14 @@ Gets a value indicating the column index of the cell that the event occurs for. The index of the column containing the cell that the event occurs for. - @@ -189,14 +189,14 @@ Gets a value indicating the row index of the cell that the event occurs for. The index of the row containing the cell that the event occurs for. - diff --git a/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml index e0e565c7269..2764ad8e8d2 100644 --- a/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellEventHandler.xml @@ -39,54 +39,54 @@ A that contains the event data. Represents the method that will handle events related to cell and row operations. - handles the following events: - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - -- - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates using and event handlers to determine whether a cell can be clicked. The example updates each to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + handles the following events: + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + +- + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates using and event handlers to determine whether a cell can be clicked. The example updates each to advertise the current image layout. This code is part of a larger example shown in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet15"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml index 4dcea347b47..cbcdf411f75 100644 --- a/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellFormattingEventArgs.xml @@ -29,36 +29,36 @@ Provides data for the event of a . - event to customize the conversion of a cell value into a format suitable for display or to customize the appearance of a cell depending on its state or value. - - The event occurs every time each cell is painted, so you should avoid lengthy processing when handling this event. This event also occurs when the cell is retrieved or its method is called. - - When you handle the event, the property is initialized with the cell value. If you provide custom conversion from the cell value to the display value, set the property to the converted value, ensuring that the new value is of the type specified by the cell property. To indicate that no further value formatting is necessary, set the property to `true`. - - When the event handler completes, if the is `null` or is not of the correct type, or the property is `false`, the is formatted using the , , , and properties of the cell style returned by the property, which is initialized using the cell property. - - Regardless of the value of the property, the display properties of the object returned by the property are used to render the cell. - - For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). - - To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. - - To customize the conversion of a formatted, user-specified value into an actual cell value, handle the event. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to handle . - + event to customize the conversion of a cell value into a format suitable for display or to customize the appearance of a cell depending on its state or value. + + The event occurs every time each cell is painted, so you should avoid lengthy processing when handling this event. This event also occurs when the cell is retrieved or its method is called. + + When you handle the event, the property is initialized with the cell value. If you provide custom conversion from the cell value to the display value, set the property to the converted value, ensuring that the new value is of the type specified by the cell property. To indicate that no further value formatting is necessary, set the property to `true`. + + When the event handler completes, if the is `null` or is not of the correct type, or the property is `false`, the is formatted using the , , , and properties of the cell style returned by the property, which is initialized using the cell property. + + Regardless of the value of the property, the display properties of the object returned by the property are used to render the cell. + + For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). + + To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. + + To customize the conversion of a formatted, user-specified value into an actual cell value, handle the event. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to handle . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> @@ -80,8 +80,8 @@ - Cell Styles in the Windows Forms DataGridView Control - How to: Customize Data Formatting in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control + How to: Customize Data Formatting in the Windows Forms DataGridView Control @@ -127,29 +127,29 @@ The style of the cell that caused the event. Initializes a new instance of the class. - property. For example, if a cell is formatting picture names as bitmaps, `value` is the that contains the picture name, and `desiredType` is a representing the type. - - If the event handler does not set the property to a type that can be displayed by the cell, the cell contents will be formatted using the , , and properties. - - - -## Examples - The following code example demonstrates how to use a . - + property. For example, if a cell is formatting picture names as bitmaps, `value` is the that contains the picture name, and `desiredType` is a representing the type. + + If the event handler does not set the property to a type that can be displayed by the cell, the cell contents will be formatted using the , , and properties. + + + +## Examples + The following code example demonstrates how to use a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> - is less than -1 - - -or- - + is less than -1 + + -or- + is less than -1. @@ -161,7 +161,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -201,29 +201,29 @@ Gets or sets the style of the cell that is being formatted. A that represents the display style of the cell being formatted. The default is the value of the cell's property. - property will change how the cell and its contents are displayed. To avoid performance penalties, use this property to change the cell styles rather than accessing the cell directly. - - For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control) - - - -## Examples - The following code example demonstrates how to use the property to color the background of cells that contain the string "Pink" to . - + property will change how the cell and its contents are displayed. To avoid performance penalties, use this property to change the cell styles rather than accessing the cell directly. + + For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control) + + + +## Examples + The following code example demonstrates how to use the property to color the background of cells that contain the string "Pink" to . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -258,20 +258,20 @@ Gets the column index of the cell that is being formatted. The column index of the cell that is being formatted. - property to obtain an index into the property of a . - - - -## Examples - The following code example demonstrates how to use the property to retrieve column properties. - + property to obtain an index into the property of a . + + + +## Examples + The following code example demonstrates how to use the property to retrieve column properties. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> @@ -316,20 +316,20 @@ if the formatting for the cell value has been handled; otherwise, . The default value is . - event, set the property to `true` after setting the property if no further value formatting is required. If the property value is `false` when the event handler exits, the formatting will be applied to the value as indicated by the , , , and properties of the object returned by the property. - - - -## Examples - The following code example sets the property to `true` to signal that formatting for this cell is finished. - + event, set the property to `true` after setting the property if no further value formatting is required. If the property value is `false` when the event handler exits, the formatting will be applied to the value as indicated by the , , , and properties of the object returned by the property. + + + +## Examples + The following code example sets the property to `true` to signal that formatting for this cell is finished. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> @@ -374,20 +374,20 @@ Gets the row index of the cell that is being formatted. The row index of the cell that is being formatted. - property to obtain an index into the property of a . - - - -## Examples - The following code example demonstrates how to use the property to retrieve the cell being formatted. The cell reference is then used to set the cell's ToolTip text. - + property to obtain an index into the property of a . + + + +## Examples + The following code example demonstrates how to use the property to retrieve the cell being formatted. The cell reference is then used to set the cell's ToolTip text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/cpp/datagridviewcell.tooltiptext.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCell/Overview/datagridviewcell.tooltiptext.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/VB/datagridviewcell.tooltiptext.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCell.ToolTipText/VB/datagridviewcell.tooltiptext.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml index 34b1a2bbdc4..da3b780b628 100644 --- a/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellFormattingEventHandler.xml @@ -39,45 +39,45 @@ A that contains the event data. Represents the method that will handle the event of a . - event to customize the conversion of a cell value into a format suitable for display or to customize the appearance of a cell depending on its state or value. - - The event occurs every time each cell is painted, so you should avoid lengthy processing when handling this event. This event also occurs when the cell is retrieved or its method is called. - - When you handle the event, the property is initialized with the cell value. If you provide custom conversion from the cell value to the display value, set the property to the converted value, ensuring that the new value is of the type specified by the cell property. To indicate that no further value formatting is necessary, set the property to `true`. - - When the event handler completes, if the is `null` or is not of the correct type, or the property is `false`, the is formatted using the , , , and properties of the cell style returned by the property, which is initialized using the cell property. - - Regardless of the value of the property, the display properties of the object returned by the property are used to render the cell. - - For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). - - To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. - - To customize the conversion of a formatted, user-specified value into an actual cell value, handle the event. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to handle the event. - + event to customize the conversion of a cell value into a format suitable for display or to customize the appearance of a cell depending on its state or value. + + The event occurs every time each cell is painted, so you should avoid lengthy processing when handling this event. This event also occurs when the cell is retrieved or its method is called. + + When you handle the event, the property is initialized with the cell value. If you provide custom conversion from the cell value to the display value, set the property to the converted value, ensuring that the new value is of the type specified by the cell property. To indicate that no further value formatting is necessary, set the property to `true`. + + When the event handler completes, if the is `null` or is not of the correct type, or the property is `false`, the is formatted using the , , , and properties of the cell style returned by the property, which is initialized using the cell property. + + Regardless of the value of the property, the display properties of the object returned by the property are used to render the cell. + + For more information about custom formatting using the event, see [How to: Customize Data Formatting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-data-formatting-in-the-windows-forms-datagridview-control). + + To avoid performance penalties when handling this event, access the cell through the parameters of the event handler rather than accessing the cell directly. + + To customize the conversion of a formatted, user-specified value into an actual cell value, handle the event. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to handle the event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control - How to: Customize Data Formatting in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control + How to: Customize Data Formatting in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml index f2133cedabd..995adb7a22a 100644 --- a/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellPaintingEventArgs.xml @@ -29,19 +29,19 @@ Provides data for the event. - event is raised for each that is visible on a . To improve performance, set the properties in a to change the appearance of the cell instead of directly accessing a cell in the . If you manually paint the cell, set the property to `true`. If you do not set to `true`, the cell will paint over your customizations. - - - -## Examples - The following code example illustrates the use of this type. For more information, see [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). - + event is raised for each that is visible on a . To improve performance, set the properties in a to change the appearance of the cell instead of directly accessing a cell in the . If you manually paint the cell, set the property to `true`. If you do not set to `true`, the cell will paint over your customizations. + + + +## Examples + The following code example illustrates the use of this type. For more information, see [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> @@ -122,14 +122,14 @@ Initializes a new instance of the class. To be added. - is . - - -or- - - is . - - -or- - + is . + + -or- + + is . + + -or- + is . is not a valid bitwise combination of values. @@ -174,21 +174,21 @@ Gets the border style of the current . A that represents the border style of the . - by setting the properties of the property to one of the values. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + by setting the properties of the property to one of the values. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -229,14 +229,14 @@ Get the bounds of the current . A that represents the bounds of the current . - @@ -277,19 +277,19 @@ Gets the cell style of the current . A that contains the cell style of the current . - by setting the properties of the property. - - - -## Examples - The following code example demonstrates the use of this member. - + by setting the properties of the property. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> @@ -329,21 +329,21 @@ Gets the area of the that needs to be repainted. A that represents the area of the that needs to be repainted. - property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window, and then uncovers it, then represents the entire . If a user covers a small area of the , and then uncovers it, then represents the small area that was covered. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window, and then uncovers it, then represents the entire . If a user covers a small area of the , and then uncovers it, then represents the small area that was covered. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -382,19 +382,19 @@ Gets the column index of the current . The column index of the current . - property returns -1 when a row header cell is being painted. - - - -## Examples - The following code example demonstrates the use of this member. - + property returns -1 when a row header cell is being painted. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> @@ -434,21 +434,21 @@ Gets a string that represents an error message for the current . A string that represents an error message for the current . - is a row header cell, the property is the same as the property of the . When the current cell is a data cell, is the same as the property of the . - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + is a row header cell, the property is the same as the property of the . When the current cell is a data cell, is the same as the property of the . + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -491,21 +491,21 @@ Gets the formatted value of the current . The formatted value of the current . - property contains the value of the cell after the or property has been applied to it, and after the event has been handled. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property contains the value of the cell after the or property has been applied to it, and after the event has been handled. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -547,14 +547,14 @@ Gets the used to paint the current . The used to paint the current . - @@ -594,10 +594,10 @@ Paints the specified parts of the cell for the area in the specified bounds. To be added. - is less than -1 or greater than or equal to the number of rows in the control. - - -or- - + is less than -1 or greater than or equal to the number of rows in the control. + + -or- + is less than -1 or greater than or equal to the number of columns in the control. @@ -635,10 +635,10 @@ Paints the cell background for the area in the specified bounds. To be added. - is less than -1 or greater than or equal to the number of rows in the control. - - -or- - + is less than -1 or greater than or equal to the number of rows in the control. + + -or- + is less than -1 or greater than or equal to the number of columns in the control. @@ -673,10 +673,10 @@ Paints the cell content for the area in the specified bounds. To be added. - is less than -1 or greater than or equal to the number of rows in the control. - - -or- - + is less than -1 or greater than or equal to the number of rows in the control. + + -or- + is less than -1 or greater than or equal to the number of columns in the control. @@ -713,16 +713,16 @@ The cell parts that are to be painted. A bitwise combination of values specifying the parts to be painted. - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -760,19 +760,19 @@ Gets the row index of the current . The row index of the current . - property returns -1 when a column header is being painted. - - - -## Examples - The following code example demonstrates the use of this member. - + property returns -1 when a column header is being painted. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> @@ -811,16 +811,16 @@ Gets the state of the current . A bitwise combination of values that specifies the state of the cell. - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet302"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet302"::: + ]]> @@ -861,19 +861,19 @@ Gets the value of the current . The value of the current . - property contains the value of the cell before any formatting occurs. - - - -## Examples - The following code example demonstrates the use of this member. - + property contains the value of the cell before any formatting occurs. + + + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml index b72b0235884..8b847fa05ad 100644 --- a/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellPaintingEventHandler.xml @@ -39,27 +39,27 @@ A that contains the event data. Represents the method that will handle the event of a . - delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following example illustrates the use of this event to customize the appearance of all cells in a particular column. - - This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). - + delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following example illustrates the use of this event to customize the appearance of all cells in a particular column. + + This code is part of a larger example available in [How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-cells-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellPainting/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCellPainting/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control + How to: Customize the Appearance of Cells in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellStyle.xml b/xml/System.Windows.Forms/DataGridViewCellStyle.xml index 88943bfbb3a..53392c1b028 100644 --- a/xml/System.Windows.Forms/DataGridViewCellStyle.xml +++ b/xml/System.Windows.Forms/DataGridViewCellStyle.xml @@ -45,19 +45,19 @@ Represents the formatting and style information applied to individual cells within a control. - class lets you share style information across multiple cells, rows, columns, and row or column headers, avoiding the memory requirements of setting style properties on individual cells. For more information about classes that have a property of type and how they relate to each other, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example demonstrates the effect of setting properties on multiple objects. This example sets the background color of cells in the by setting the property on the property. The background color is overridden on alternating rows because the property is set on the property. The example also determines the format of dates in the column named `Last Prepared` by setting the property on the column's property. - + class lets you share style information across multiple cells, rows, columns, and row or column headers, avoiding the memory requirements of setting style properties on individual cells. For more information about classes that have a property of type and how they relate to each other, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example demonstrates the effect of setting properties on multiple objects. This example sets the background color of cells in the by setting the property on the property. The background color is overridden on alternating rows because the property is set on the property. The example also determines the format of dates in the column named `Last Prepared` by setting the property on the column's property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet10"::: + ]]> @@ -75,8 +75,8 @@ - Cell Styles in the Windows Forms DataGridView Control - DataGridView Control Overview (Windows Forms) + Cell Styles in the Windows Forms DataGridView Control + DataGridView Control Overview (Windows Forms) @@ -87,7 +87,7 @@ Initializes a new instance of the class. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -113,7 +113,7 @@ Initializes a new instance of the class using default property values. To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -145,7 +145,7 @@ is . - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -180,20 +180,20 @@ Gets or sets a value indicating the position of the cell content within a cell. One of the values. The default is . - The property value is not a valid value. - Data Formatting in the Windows Forms DataGridView Control - Cell Styles in the Windows Forms DataGridView Control + Data Formatting in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -225,17 +225,17 @@ The to apply to the current . Applies the specified to the current . - method applies the values of the properties that are set in the `dataGridViewCellStyle` parameter to the current . If a property is not set in `dataGridViewCellStyle`, the current retains its value of that property. - + method applies the values of the properties that are set in the `dataGridViewCellStyle` parameter to the current . If a property is not set in `dataGridViewCellStyle`, the current retains its value of that property. + ]]> is . - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -264,18 +264,18 @@ Gets or sets the background color of a cell. A that represents the background color of a cell. The default is . - by setting the property on the property. Note that the background color is overridden on alternating rows because the property is set on the property. This code example is part of a larger example provided for the class. - + by setting the property on the property. Note that the background color is overridden on alternating rows because the property is set on the property. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -306,7 +306,7 @@ A that represents an exact copy of this cell style. To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -358,22 +358,22 @@ Gets or sets the value saved to the data source when the user enters a null value into a cell. The value saved to the data source when the user specifies a null cell value. The default is . - property. When the user commits the change, the underlying cell value is set to the value of the property or to `null` if is and the cell is a reference type. This conversion does not occur when you set the property programmatically. - + property. When the user commits the change, the underlying cell value is set to the value of the property or to `null` if is and the cell is a reference type. This conversion does not occur when you set the property programmatically. + > [!NOTE] -> The control does not display the property value for cell values equal to the property value when is set to a value other than or `null`. In this case, you can handle the event to display the property value. For more information, see the code example in this topic. - - - -## Examples - The following code example illustrates the use of this property. In this example, a event handler displays the value of the property when the cell value equals . - +> The control does not display the property value for cell values equal to the property value when is set to a value other than or `null`. In this case, you can handle the event to display the property value. For more information, see the code example in this topic. + + + +## Examples + The following code example illustrates the use of this property. In this example, a event handler displays the value of the property when the cell value equals . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: + ]]> @@ -381,7 +381,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -417,7 +417,7 @@ if is a and has the same property values as this instance; otherwise, . To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -453,24 +453,24 @@ Gets or sets the font applied to the textual content of a cell. The applied to the cell text. The default is . - is immutable (its properties are read-only), you can modify this property only by assigning a new or existing to it; you cannot alter the properties of the returned object directly. - - - -## Examples - The following code example sets the font for column headers. To run this example, paste the code into a form that contains a named `GridView1`, and then call the `SetupUpDataGridView` and `PopulateDataGridView` methods from the form's constructor or method. Ensure all events are associated with their event-handling methods. - + is immutable (its properties are read-only), you can modify this property only by assigning a new or existing to it; you cannot alter the properties of the returned object directly. + + + +## Examples + The following code example sets the font for column headers. To run this example, paste the code into a form that contains a named `GridView1`, and then call the `SetupUpDataGridView` and `PopulateDataGridView` methods from the form's constructor or method. Ensure all events are associated with their event-handling methods. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BackgroundColor/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewUnbound/VB/form1.vb" id="Snippet5"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -499,23 +499,23 @@ Gets or sets the foreground color of a cell. A that represents the foreground color of a cell. The default is . - property typically should specify a color that contrasts with the property. - - - -## Examples - The following code example demonstrates how to set the and properties for cells in alternating rows. This code example is part of a larger example provided for the class. - + property typically should specify a color that contrasts with the property. + + + +## Examples + The following code example demonstrates how to set the and properties for cells in alternating rows. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -562,24 +562,24 @@ Gets or sets the format string applied to the textual content of a cell. A string that indicates the format of the cell value. The default is . - property specifies how cell values are formatted as strings. For more information, see [Formatting Types](/dotnet/standard/base-types/formatting-types). - - - -## Examples - The following code example sets the format of dates in the column named `Last Fixed` to "Month, year" by setting the property on the column's property. This code example is part of a larger example provided for the class. - + property specifies how cell values are formatted as strings. For more information, see [Formatting Types](/dotnet/standard/base-types/formatting-types). + + + +## Examples + The following code example sets the format of dates in the column named `Last Fixed` to "Month, year" by setting the property on the column's property. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Data Formatting in the Windows Forms DataGridView Control - Cell Styles in the Windows Forms DataGridView Control + Data Formatting in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -619,7 +619,7 @@ An used for cell formatting. The default is . To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -689,16 +689,16 @@ if the value of the property is the default value; otherwise, . - property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . - + property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -738,15 +738,15 @@ if the property is the default value; otherwise, . - property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . - + property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -786,15 +786,15 @@ if the value of the property is the default value; otherwise, . - property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . - + property has been explicitly set without having to store its default value for comparison. This is useful because the property has a non-empty default value, unlike most other properties, which have default values such as `null`, , or . + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -838,24 +838,24 @@ Gets or sets the cell display value corresponding to a cell value of or . The object used to indicate a null value in a cell. The default is . - cell with this cell style has a value of or `null` or the user edits the cell and presses CTRL+0, the control displays the property value. When a user edits a cell with this cell style and enters the value of this property or presses CTRL+0, the control sets the cell value to the value of the property or to `null` if is and the cell is a reference type. This conversion does not occur when you set the property programmatically. - + cell with this cell style has a value of or `null` or the user edits the cell and presses CTRL+0, the control displays the property value. When a user edits a cell with this cell style and enters the value of this property or presses CTRL+0, the control sets the cell value to the value of the property or to `null` if is and the cell is a reference type. This conversion does not occur when you set the property programmatically. + > [!NOTE] -> The control does not display the property value for cell values equal to the property value when is set to a value other than or `null`. In this case, you can handle the event to display the property value. For more information, see the code example in this topic. - - This property takes any object, which enables you to specify a value with a type appropriate to the display type of the cell. For example, you can set this property to string values for use by text box cells or images for use by image cells. - - - -## Examples - The following code example illustrates the use of this property. In this example, a event handler displays the value of the property when the cell value equals . - +> The control does not display the property value for cell values equal to the property value when is set to a value other than or `null`. In this case, you can handle the event to display the property value. For more information, see the code example in this topic. + + This property takes any object, which enables you to specify a value with a type appropriate to the display type of the cell. For example, you can set this property to string values for use by text box cells or images for use by image cells. + + + +## Examples + The following code example illustrates the use of this property. In this example, a event handler displays the value of the property when the cell value equals . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet50"::: + ]]> @@ -863,8 +863,8 @@ - How to: Format Data in the Windows Forms DataGridView Control - Cell Styles in the Windows Forms DataGridView Control + How to: Format Data in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -893,25 +893,25 @@ Gets or sets the space between the edge of a and its content. A that represents the space between the edge of a and its content. - property affects where the editing control of the is drawn. For example, if you set on a to a that has a value of 10 for its , , , and properties, the content of the cell is drawn in the middle of the cell with a space of 10 pixels between the edges of the text box and the edges of the cell. - - - -## Examples - The following code example illustrates the use of this property in a control that contains owner-drawn rows. Each row displays text that spans the entire width of the row underneath the regular cell content. The property is used to provide the extra space for this text. In the example, the extra height required is stored in a constant called `CUSTOM_CONTENT_HEIGHT`. - - This code example is part of a larger example. For the complete example, see [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property affects where the editing control of the is drawn. For example, if you set on a to a that has a value of 10 for its , , , and properties, the content of the cell is drawn in the middle of the cell with a space of 10 pixels between the edges of the text box and the edges of the cell. + + + +## Examples + The following code example illustrates the use of this property in a control that contains owner-drawn rows. Each row displays text that spans the entire width of the row underneath the regular cell content. The property is used to provide the extra space for this text. In the example, the extra height required is stored in a constant called `CUSTOM_CONTENT_HEIGHT`. + + This code example is part of a larger example. For the complete example, see [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet10"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -940,18 +940,18 @@ Gets or sets the background color used by a cell when it is selected. A that represents the background color of a selected cell. The default is . - control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the class overview. - + control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the class overview. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -980,23 +980,23 @@ Gets or sets the foreground color used by a cell when it is selected. A that represents the foreground color of a selected cell. The default is . - property typically should specify a color that contrasts with the property. - - - -## Examples - The following code example illustrates the use of this property in a control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the class overview. - + property typically should specify a color that contrasts with the property. + + + +## Examples + The following code example illustrates the use of this property in a control intended primarily for display. In this example, the visual appearance of the control is customized in several ways, and the control is configured for limited interactivity. This example is part of a larger example available in the class overview. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -1035,15 +1035,15 @@ Creates an exact copy of this . A that represents an exact copy of this cell style. - instance is cast to an interface. - + instance is cast to an interface. + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -1092,7 +1092,7 @@ An object that contains additional data. The default is . To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -1123,7 +1123,7 @@ A string indicating the current property settings of the . To be added. - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -1158,25 +1158,25 @@ Gets or sets a value indicating whether textual content in a cell is wrapped to subsequent lines or truncated when it is too long to fit on a single line. One of the values. The default is . - is for a cell that contains text, the cell displays the text on a single line, and displays any embedded newline characters as box characters. If is for a cell that contains text, the cell displays newline characters as line breaks, but also wraps any lines that exceed the width of the cell. - - - -## Examples - The following code example illustrates the use of this property. - + is for a cell that contains text, the cell displays the text on a single line, and displays any embedded newline characters as box characters. If is for a cell that contains text, the cell displays newline characters as line breaks, but also wraps any lines that exceed the width of the cell. + + + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet074"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet074"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet074"::: + ]]> The property value is not a valid value. - How to: Format Data in the Windows Forms DataGridView Control - Cell Styles in the Windows Forms DataGridView Control + How to: Format Data in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml index d256fc7b424..ad02b2a8b5c 100644 --- a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventArgs.xml @@ -63,7 +63,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml index 8cfa2607920..3e2622066e9 100644 --- a/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellToolTipTextNeededEventHandler.xml @@ -75,6 +75,6 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml index 5d901c3bef7..ff1a0110eec 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValidatingEventArgs.xml @@ -29,22 +29,22 @@ Provides data for the event of a control. - event lets you cancel changes to the current cell when the new value is not valid. Use the property to determine the current value. To determine the state of the current cell, use the and properties to access the cell through the collection. To cancel the change, set the property to `true`. - - When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. When this event is canceled in virtual mode, the event will not be raised. - - - -## Examples - The following code example handles the event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the reference topic. - + event lets you cancel changes to the current cell when the new value is not valid. Use the property to determine the current value. To determine the state of the current cell, use the and properties to access the cell through the collection. To cancel the change, set the property to `true`. + + When this event is canceled in data-bound mode, the new value is not pushed to the underlying data source. When this event is canceled in virtual mode, the event will not be raised. + + + +## Examples + The following code example handles the event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet40"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: + ]]> @@ -92,14 +92,14 @@ Gets the column index of the cell that needs to be validated. A zero-based integer that specifies the column index of the cell that needs to be validated. - @@ -141,20 +141,20 @@ Gets the formatted contents of the cell that needs to be validated. A reference to the formatted value. - property value. This is the value that you can validate before it is parsed into the cell property value. - - - -## Examples - The following code example handles the event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the reference topic. - + property value. This is the value that you can validate before it is parsed into the cell property value. + + + +## Examples + The following code example handles the event to ensure that only positive integers are entered by the user. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet40"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet40"::: + ]]> @@ -195,14 +195,14 @@ Gets the row index of the cell that needs to be validated. A zero-based integer that specifies the row index of the cell that needs to be validated. - diff --git a/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml b/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml index 8e8ffbf6b0d..a6185afea77 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValueEventArgs.xml @@ -29,22 +29,22 @@ Provides data for the and events of the control. - and events to implement virtual mode in the control. For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. - + and events to implement virtual mode in the control. For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]> @@ -52,7 +52,7 @@ - Virtual Mode in the Windows Forms DataGridView Control + Virtual Mode in the Windows Forms DataGridView Control @@ -84,10 +84,10 @@ Initializes a new instance of the class. To be added. - is less than 0. - - -or- - + is less than 0. + + -or- + is less than 0. @@ -126,20 +126,20 @@ Gets a value indicating the column index of the cell that the event occurs for. The index of the column containing the cell that the event occurs for. - property to reference the cell that the event occurs for. - - - -## Examples - The following code example demonstrates how to use the property to retrieve cell values from the data store. This example is part of a larger example provided in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). - + property to reference the cell that the event occurs for. + + + +## Examples + The following code example demonstrates how to use the property to retrieve cell values from the data store. This example is part of a larger example provided in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet120"::: + ]]> @@ -178,20 +178,20 @@ Gets a value indicating the row index of the cell that the event occurs for. The index of the row containing the cell that the event occurs for. - property to reference the cell that the event occurs for. - - - -## Examples - The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. - + property to reference the cell that the event occurs for. + + + +## Examples + The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]> @@ -235,20 +235,20 @@ Gets or sets the value of the cell that the event occurs for. An representing the cell's value. - event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. - + event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml b/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml index d114c86f94f..e038fddc6ee 100644 --- a/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewCellValueEventHandler.xml @@ -39,22 +39,22 @@ A that contains the event data. Represents the method that will handle the event or event of a . - control. For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). - - When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. - + control. For more information about virtual mode, see [Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/virtual-mode-in-the-windows-forms-datagridview-control). + + When you create a delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example handles the event to store updates and new entries in a data store object. This example is part of a larger example available in the reference topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/CPP/virtual.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidating/virtual.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._Virtual/VB/virtual.vb" id="Snippet10"::: + ]]> @@ -62,6 +62,6 @@ - Virtual Mode in the Windows Forms DataGridView Control + Virtual Mode in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml b/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml index 95af568148d..439ff7c6c0d 100644 --- a/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewCheckBoxCell.xml @@ -245,7 +245,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -296,7 +296,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -994,7 +994,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1041,7 +1041,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1087,7 +1087,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1132,7 +1132,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1178,7 +1178,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1224,7 +1224,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1347,7 +1347,7 @@ - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control @@ -1394,7 +1394,7 @@ - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml index aab49a832ee..7ffd86730c7 100644 --- a/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewCheckBoxColumn.xml @@ -37,24 +37,24 @@ Hosts a collection of objects. - class is a specialized type of the class used to logically host cells that indicate binary state. A has an associated in every that intersects it. Each cell supplies a user interface (UI) that is similar to a control. - - The default sort mode for this column type is . - - Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the event to respond to it. To commit the change when the cell is clicked, you must handle the event. In the handler, if the current cell is a check box cell, call the method and pass in the value. - - - -## Examples - The following code example demonstrates how to use a to mark which employees are out of the office. This example is part of a larger example available in the class overview topic. - + class is a specialized type of the class used to logically host cells that indicate binary state. A has an associated in every that intersects it. Each cell supplies a user interface (UI) that is similar to a control. + + The default sort mode for this column type is . + + Typically, check box cell values are intended either for storage, like any other data, or for performing bulk operations. If you want to respond immediately when users click a check box cell, you can handle the event, but this event occurs before the cell value is updated. If you need the new value at the time of the click, one option is to calculate what the expected value will be based on the current value. Another approach is to commit the change immediately, and handle the event to respond to it. To commit the change when the cell is clicked, you must handle the event. In the handler, if the current cell is a check box cell, call the method and pass in the value. + + + +## Examples + The following code example demonstrates how to use a to mark which employees are out of the office. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]> @@ -109,11 +109,11 @@ Initializes a new instance of the class to the default state. - constructor. - + constructor. + ]]> @@ -146,19 +146,19 @@ to display check boxes with three states; to display check boxes with two states. Initializes a new instance of the and configures it to display check boxes with two or three states. - |A new with its property initialized to the `threeState` parameter value.| -||The value of the `threeState` parameter.| -||| -|The property of the object returned by the property.|| -|The property of the object returned by the property.| if `threeState` is `true`; otherwise, `false`.| - + |A new with its property initialized to the `threeState` parameter value.| +||The value of the `threeState` parameter.| +||| +|The property of the object returned by the property.|| +|The property of the object returned by the property.| if `threeState` is `true`; otherwise, `false`.| + ]]> @@ -213,23 +213,23 @@ Gets or sets the template used to create new cells. A that all other cells in the column are modeled after. The default value is a new instance. - class initialize this property to a newly created . - + class initialize this property to a newly created . + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). - - - -## Examples - The following code example demonstrates how to use a to mark which employees are out of the office. The cell template is used to apply the same color to all cells in the check box column. This example is part of a larger example available in the class overview topic. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). + + + +## Examples + The following code example demonstrates how to use a to mark which employees are out of the office. The cell template is used to apply the same color to all cells in the check box column. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]> The property is set to a value that is not of type . @@ -276,34 +276,34 @@ Gets or sets the column's default cell style. The to be applied as the default style. - returned by this property has the following initial property values: - -|`DataGridViewCellStyle` property|Default value| -|--------------------------------------|-------------------| -||| -|| if the initial property value is `true`; otherwise, `false`.| - - These values override the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - - If the property of the object returned by the property has a value of `false`, changing the property value to `true` automatically sets to . If has a value of , changing the property value to `false` automatically sets to `false`. - - - -## Examples - The following code example demonstrates the use of this property. - + returned by this property has the following initial property values: + +|`DataGridViewCellStyle` property|Default value| +|--------------------------------------|-------------------| +||| +|| if the initial property value is `true`; otherwise, `false`.| + + These values override the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + + If the property of the object returned by the property has a value of `false`, changing the property value to `true` automatically sets to . If has a value of , changing the property value to `false` automatically sets to `false`. + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -355,22 +355,22 @@ Gets or sets the underlying value corresponding to a cell value of , which appears as an unchecked box. An representing a value that the cells in this column will treat as a value. The default is . - , , and properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. - + , , and properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]> The value of the property is . @@ -427,22 +427,22 @@ Gets or sets the flat style appearance of the check box cells. A value indicating the appearance of cells in the column. The default is . - and call the method before . - - Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to use a to mark which employees are out of the office. This example is part of a larger example available in the class overview topic. - + and call the method before . + + Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to use a to mark which employees are out of the office. This example is part of a larger example available in the class overview topic. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/CPP/employees.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellContentClick/employees.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewColumn_AllColumns_Bound_Employees/VB/employees.vb" id="Snippet20"::: + ]]> The value of the property is . @@ -503,22 +503,22 @@ Gets or sets the underlying value corresponding to an indeterminate or cell value, which appears as a disabled checkbox. An representing a value that the cells in this column will treat as an indeterminate value. The default is . - , , and properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. - + , , and properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]> The value of the property is . @@ -576,24 +576,24 @@ if the hosted objects are able to have a third, indeterminate, state; otherwise, . The default is . - property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - If the property of the object returned by the property has a value of `false`, changing the property value to `true` automatically sets to . If has a value of , changing the property value to `false` automatically sets to `false`. - - - -## Examples - The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. - + property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + If the property of the object returned by the property has a value of `false`, changing the property value to `true` automatically sets to . If has a value of , changing the property value to `false` automatically sets to `false`. + + + +## Examples + The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]> The value of the property is . @@ -685,22 +685,22 @@ Gets or sets the underlying value corresponding to a cell value of , which appears as a checked box. An representing a value that the cell will treat as a value. The default is . - , , and properties determine the associated values of these states as they occur in the underlying data source. - - Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. - + , , and properties determine the associated values of these states as they occur in the underlying data source. + + Getting or setting this property gets or sets the property of the cell object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example uses a to track the status of office lighting. The property associates "turnedOff" with `false`, the property associates "turnedOn" with `true`, and the property associates "unknown" to indeterminate. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/cpp/trivaluevirtualcheckbox.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewCheckBoxCell/FalseValue/trivaluevirtualcheckbox.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewTrinaryVirtualCheckBox/VB/trivaluevirtualcheckbox.vb" id="Snippet0"::: + ]]> The value of the property is . diff --git a/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml b/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml index 06c4d03f2df..65c9175307f 100644 --- a/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml +++ b/xml/System.Windows.Forms/DataGridViewClipboardCopyMode.xml @@ -22,19 +22,19 @@ Defines constants that indicate whether content is copied from a control to the Clipboard. - property to indicate whether users can copy the text values of selected cells to the Clipboard and whether row and column header text is included. - - - -## Examples - The following code example demonstrates how to enable copying in the control. For the complete example, see [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). - + property to indicate whether users can copy the text values of selected cells to the Clipboard and whether row and column header text is included. + + + +## Examples + The following code example demonstrates how to enable copying in the control. For the complete example, see [How to: Enable Users to Copy Multiple Cells to the Clipboard from the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/enable-users-to-copy-multiple-cells-to-the-clipboard-datagridview). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ClipboardCopyMode/datagridviewclipboarddemo.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewClipboardDemo/VB/datagridviewclipboarddemo.vb" id="Snippet10"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewColumn.xml b/xml/System.Windows.Forms/DataGridViewColumn.xml index 67809ff17fa..b0c1eabc5e3 100644 --- a/xml/System.Windows.Forms/DataGridViewColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewColumn.xml @@ -60,24 +60,24 @@ Represents a column in a control. - class represents a logical column in a control. You can retrieve columns through the collection of the control. - - Unlike a , which contains the actual collection of cells in a , is used mainly to adjust the appearance and behavior of the column user interface (UI), such as column width and cell style. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - - Types that derive from typically initialize the property to a new instance of a related type derived from the class. Any column properties that relate to the appearance or behavior of individual cells are wrappers for the corresponding properties of the template cell. Changing one of these properties on the column automatically changes the value on the cell template and on all cells in the column. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example creates a Windows Form with a and a set of buttons. Each button label describes an operation related to a property, such as swapping the first and last column (using the property) or changing the text of a column header (using the property). Clicking a button changes the associated property of the . - + class represents a logical column in a control. You can retrieve columns through the collection of the control. + + Unlike a , which contains the actual collection of cells in a , is used mainly to adjust the appearance and behavior of the column user interface (UI), such as column width and cell style. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + + Types that derive from typically initialize the property to a new instance of a related type derived from the class. Any column properties that relate to the appearance or behavior of individual cells are wrappers for the corresponding properties of the template cell. Changing one of these properties on the column automatically changes the value on the cell template and on all cells in the column. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example creates a Windows Form with a and a set of buttons. Each button label describes an operation related to a property, such as swapping the first and last column (using the property) or changing the text of a column header (using the property). Clicking a button changes the associated property of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet100"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet100"::: + ]]> @@ -157,11 +157,11 @@ An existing to use as a template. Initializes a new instance of the class using an existing as a template. - property to the value of the `cellTemplate` parameter. - + property to the value of the `cellTemplate` parameter. + ]]> @@ -213,44 +213,44 @@ Gets or sets the mode by which the column automatically adjusts its width. A value that determines whether the column will automatically adjust its width and how it will determine its preferred width. The default is . - property, which is the same as the value of the property for all values except , which indicates that the value is inherited from the property instead. - - When the property value is , the column is resized along with other columns in that mode. All fill-mode columns in the control divide the available space in proportions determined by their property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - When the property is set to any other value except , the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. - - Only columns with a property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. - - To adjust column widths programmatically, use the control's or methods or set the column property. - - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example forces a column to automatically resize its width to fit its contents. This code example is part of a larger example provided for the class. - + property, which is the same as the value of the property for all values except , which indicates that the value is inherited from the property instead. + + When the property value is , the column is resized along with other columns in that mode. All fill-mode columns in the control divide the available space in proportions determined by their property values. The width available for fill mode is determined by subtracting the widths of all other columns from the width of the client area of the control. If this width is smaller than the combined values of all fill-mode columns, the horizontal scroll bar is displayed, all fill-mode columns are shown with their minimum widths, and user column-resizing is disabled. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + When the property is set to any other value except , the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. + + Only columns with a property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. + + To adjust column widths programmatically, use the control's or methods or set the column property. + + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example forces a column to automatically resize its width to fit its contents. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet109"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet109"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet109"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet109"::: + ]]> The specified value when setting this property is a that is not valid. - The specified value when setting this property results in an value of for a visible column when column headers are hidden. - - -or- - + The specified value when setting this property results in an value of for a visible column when column headers are hidden. + + -or- + The specified value when setting this property results in an value of for a visible column that is frozen. - Sizing Options in the Windows Forms DataGridView Control - Resizing Columns and Rows in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -306,23 +306,23 @@ Gets or sets the template used to create new cells. A that all other cells in the column are modeled after. The default is . - class initialize this property. The parameterless constructor sets the property to `null`; the other constructor copies the cell template from its parameter. - + class initialize this property. The parameterless constructor sets the property to `null`; the other constructor copies the cell template from its parameter. + > [!NOTE] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). - - - -## Examples - The following code example demonstrates how to use a as a template for a . Style changes made to any cell in the column affect all of the column's cells. This code example is part of a larger example provided for the class. - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). + + + +## Examples + The following code example demonstrates how to use a as a template for a . Style changes made to any cell in the column affect all of the column's cells. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]> @@ -368,11 +368,11 @@ Gets the run-time type of the cell template. The of the used as a template for this column. The default is . - is . Use this property to determine the actual derived type. - + is . Use this property to determine the actual derived type. + ]]> @@ -444,20 +444,20 @@ Gets or sets the shortcut menu for the column. The associated with the current . The default is . - property to add functionality for changing a cell's background color. - + property to add functionality for changing a cell's background color. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet130"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet130"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet130"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet130"::: + ]]> @@ -527,22 +527,22 @@ Gets or sets the name of the data source property or database column to which the is bound. The case-insensitive name of the property or database column associated with the . - property is set to `true`, each column automatically sets its property to the name of a property or database column in the data source specified by the property. This binding can also be performed manually, which is useful when you want to display only a subset of the properties or database columns available in the data source. In such cases, set the property to `false`, and then manually add each , setting the value of each property to the properties or database columns in the data source that you want to display. - - - -## Examples - The following code example shows how to choose what property each column will represent. - + property is set to `true`, each column automatically sets its property to the name of a property or database column in the data source specified by the property. This binding can also be performed manually, which is useful when you want to display only a subset of the properties or database columns available in the data source. In such cases, set the property to `false`, and then manually add each , setting the value of each property to the properties or database columns in the data source that you want to display. + + + +## Examples + The following code example shows how to choose what property each column will represent. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet20"::: + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: + ]]> @@ -585,27 +585,27 @@ Gets or sets the column's default cell style. A that represents the default style of the cells in the column. - control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . For cells in this column, the styles specified through the property override the styles specified through the property, but are overridden by the styles specified through the , , , and properties. - - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example uses the property to set the content alignment of various columns. - + control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . For cells in this column, the styles specified through the property override the styles specified through the property, but are overridden by the styles specified through the , , , and properties. + + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example uses the property to set the content alignment of various columns. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control - Best Practices for Scaling the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -652,35 +652,35 @@ Gets or sets the display order of the column relative to the currently displayed columns. The zero-based position of the column as it is displayed in the associated , or -1 if the band is not contained within a control. - property, the property corresponds to the current position of the column as displayed by the user interface (UI). By default, each column's is set to numbers of increasing order, which reflects the order in which they were added. The property value does not affect the value. To determine the display position of a column based on its visibility or other state, use the , , or method of the class. - - Every column in the control has a unique value. The values start with 0 and proceed in numerical order without skipping any values. When you change the value for a column, the values for other columns are changed to reflect the new order. - - If the column has an associated control, setting this property will cause the control to redraw itself. - - - -## Examples - The following code example uses the property to swap the visual position of the first and last columns. Note that insertions occur before the . This code example is part of a larger example provided for the class. - + property, the property corresponds to the current position of the column as displayed by the user interface (UI). By default, each column's is set to numbers of increasing order, which reflects the order in which they were added. The property value does not affect the value. To determine the display position of a column based on its visibility or other state, use the , , or method of the class. + + Every column in the control has a unique value. The values start with 0 and proceed in numerical order without skipping any values. When you change the value for a column, the values for other columns are changed to reflect the new order. + + If the column has an associated control, setting this property will cause the control to redraw itself. + + + +## Examples + The following code example uses the property to swap the visual position of the first and last columns. Note that insertions occur before the . This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]> - is not and the specified value when setting this property is less than 0 or greater than or equal to the number of columns in the control. - - -or- - - is and the specified value when setting this property is less than -1. - - -or- - + is not and the specified value when setting this property is less than 0 or greater than or equal to the number of columns in the control. + + -or- + + is and the specified value when setting this property is less than -1. + + -or- + The specified value when setting this property is equal to Int32.MaxValue. @@ -762,21 +762,21 @@ Occurs when the is disposed. - 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 type named `DataGridViewColumn1`. Then 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 type named `DataGridViewColumn1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet370"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet370"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet370"::: + ]]> @@ -814,20 +814,20 @@ Gets or sets the width, in pixels, of the column divider. The thickness, in pixels, of the divider (the column's right margin). - . The extra edge does not extend the area in which users can double-click to automatically resize a column. To resize a column, the user must double-click on the boundary between the divider and the adjacent column. - - - -## Examples - The following code example adds a vertical edge after the third column. This code example is part of a larger example provided for the class. - + . The extra edge does not extend the area in which users can double-click to automatically resize a column. To resize a column, the user must double-click on the boundary between the divider and the adjacent column. + + + +## Examples + The following code example adds a vertical edge after the third column. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet110"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet110"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet110"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet110"::: + ]]> @@ -870,29 +870,29 @@ Gets or sets a value that represents the width of the column when it is in fill mode relative to the widths of other fill-mode columns in the control. A representing the width of the column when it is in fill mode relative to the widths of other fill-mode columns. The default is 100. - property value is , the column is resized along with other columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. All fill-mode columns in the control divide the available space in proportions determined by their property values. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - The maximum sum of values for all columns in a control is 65535. - - - -## Examples - The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). - + property value is , the column is resized along with other columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. All fill-mode columns in the control divide the available space in proportions determined by their property values. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + The maximum sum of values for all columns in a control is 65535. + + + +## Examples + The following code example illustrates the use of this property. This example is part of a larger example available in [How to: Set the Sizing Modes of the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-the-sizing-modes-of-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet30"::: + ]]> The specified value when setting this property is less than or equal to 0. - Column Fill Mode in the Windows Forms DataGridView Control - Resizing Columns and Rows in the Windows Forms DataGridView Control + Column Fill Mode in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -936,20 +936,20 @@ to freeze the column; otherwise, . - property to `true`, the user cannot drag a column from one group to the other. - - - -## Examples - The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class. - + property to `true`, the user cannot drag a column from one group to the other. + + + +## Examples + The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet7"::: + ]]> @@ -989,15 +989,15 @@ Calculates the ideal width of the column based on the specified criteria. The ideal width, in pixels, of the column. - control to determine the ideal width of a column. - - A `fixedHeight` parameter value of `false` calculates the column width based on calculated row heights that will achieve ideal cell height-to-width ratios. For cell contents to wrap onto multiple lines, the cell style in effect for the cell must have a property value of . - - For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - + control to determine the ideal width of a column. + + A `fixedHeight` parameter value of `false` calculates the column width based on calculated row heights that will achieve ideal cell height-to-width ratios. For cell contents to wrap onto multiple lines, the cell style in effect for the cell must have a property value of . + + For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + ]]> @@ -1054,20 +1054,20 @@ Gets or sets the that represents the column header. A that represents the header cell for the column. - and properties, users can also click the column header to sort or select the column. - - - -## Examples - The following code example uses the property to change column header style and contents. - + and properties, users can also click the column header to sort or select the column. + + + +## Examples + The following code example uses the property to change column header style and contents. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet150"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet150"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet150"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet150"::: + ]]> @@ -1109,23 +1109,23 @@ Gets or sets the caption text on the column's header cell. A with the desired text. The default is an empty string (""). - property. - + property. + > [!NOTE] -> There is no corresponding header text property for rows. To display labels in row headers, you must handle the event and paint your own labels when is -1. - - - -## Examples - The following code example uses the property to change the text in the column header. This code example is part of a larger example provided for the class. - +> There is no corresponding header text property for rows. To display labels in row headers, you must handle the event and paint your own labels when is -1. + + + +## Examples + The following code example uses the property to change the text in the column header. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet160"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet160"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet160"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet160"::: + ]]> @@ -1176,29 +1176,29 @@ Gets the sizing mode in effect for the column. The value in effect for the column. - property, which is the same as the value of the property for all values except , which indicates that the value is inherited from the property instead. - - When the property value is , the column is resized along with other columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. All fill-mode columns in the control divide the available space in proportions determined by their property values. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). - - When the property is set to any other value except , the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. - - Only columns with a property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. - - To adjust column widths programmatically, use the control's or methods or set the column property. - - For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - + property, which is the same as the value of the property for all values except , which indicates that the value is inherited from the property instead. + + When the property value is , the column is resized along with other columns in that mode so that all visible columns in the control exactly fill the horizontal width of the available display area. All fill-mode columns in the control divide the available space in proportions determined by their property values. For more information about column fill mode, see [Column Fill Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/column-fill-mode-in-the-windows-forms-datagridview-control). + + When the property is set to any other value except , the column will manage its width so that its cell values are fully displayed without clipping. In content-based sizing modes, size adjustments occur whenever cell contents change or, if is enabled, whenever row heights change. Some content-based sizing modes let you limit the size adjustment to the currently displayed rows in order to increase performance. + + Only columns with a property value of `true` are resized, and changing the visibility of a column does not cause resizing to occur. Additionally, when columns are set to automatically resize, the user cannot adjust the column widths with the mouse. + + To adjust column widths programmatically, use the control's or methods or set the column property. + + For more information about content-based automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + ]]> - Sizing Options in the Windows Forms DataGridView Control - Resizing Columns and Rows in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + Resizing Columns and Rows in the Windows Forms DataGridView Control @@ -1234,20 +1234,20 @@ Gets the cell style currently applied to the column. A that represents the cell style used to display the column. - property inherits its values from the and the property. - - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - + property inherits its values from the and the property. + + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -1295,11 +1295,11 @@ if the column is connected to a data source; otherwise, . - . A column can become part of a data-bound if the column is automatically created when the property is set to `true`, or if the column's property is set when the column is manually added to the . - + . A column can become part of a data-bound if the column is automatically created when the property is set to `true`, or if the column's property is set when the column is manually added to the . + ]]> @@ -1349,20 +1349,20 @@ Gets or sets the minimum width, in pixels, of the column. The number of pixels, from 2 to Int32.MaxValue, that specifies the minimum width of the column. The default is 5. - property sets a limit on how narrow the column can be resized in the user interface (UI). The property can override the property. - - - -## Examples - The following code example sets the minimum width of a column. This code example is part of a larger example provided for the class. - + property sets a limit on how narrow the column can be resized in the user interface (UI). The property can override the property. + + + +## Examples + The following code example sets the minimum width of a column. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet107"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet107"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet107"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet107"::: + ]]> The value is less than 2 or greater than Int32.MaxValue. @@ -1406,19 +1406,19 @@ Gets or sets the name of the column. A that contains the name of the column. The default is an empty string (""). - and methods of the class use the property. The name is case-insensitive. The will treat `column1` and `COLUMN1` as the same column. - - - -## Examples - The following code example shows how to set the column name. - + and methods of the class use the property. The name is case-insensitive. The will treat `column1` and `COLUMN1` as the same column. + + + +## Examples + The following code example shows how to set the column name. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewColumn/DataPropertyName/collectionbound.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView._CollectionBound/VB/collectionbound.vb" id="Snippet10"::: + ]]> @@ -1454,20 +1454,20 @@ if the user cannot edit the column's cells; otherwise, . - property affects the property of each cell in the column. - - - -## Examples - The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class overview. - + property affects the property of each cell in the column. + + + +## Examples + The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet11"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet11"::: + ]]> This property is set to for a column that is bound to a read-only data source. @@ -1501,24 +1501,24 @@ Gets or sets a value indicating whether the column is resizable. One of the values. The default is . - property is , the user will not be able to manually adjust the column width. - - By default, the property value is based on the property value. If you explicitly set to or , however, the control value is ignored. Set to to restore the value-inheritance behavior. - - Because restores the value inheritance, the property will never return a value unless the column has not been added to a control. If you need to determine whether the property value of a column is inherited, check its property. If the property value includes the flag, the property value is not inherited. - - - -## Examples - The following code example uses this property to fix the size of the third column so that the user cannot change the column width. - + property is , the user will not be able to manually adjust the column width. + + By default, the property value is based on the property value. If you explicitly set to or , however, the control value is ignored. Set to to restore the value-inheritance behavior. + + Because restores the value inheritance, the property will never return a value unless the column has not been added to a control. If you need to determine whether the property value of a column is inherited, check its property. If the property value includes the flag, the property value is not inherited. + + + +## Examples + The following code example uses this property to fix the size of the third column so that the user cannot change the column width. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/CPP/mousesizing.cpp" id="Snippet12"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewBand/Resizable/mousesizing.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/VB/mousesizing.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.MouseBasedResizing/VB/mousesizing.vb" id="Snippet12"::: + ]]> @@ -1611,35 +1611,35 @@ Gets or sets the sort mode for the column. A that specifies the criteria used to order the rows based on the cell values in a column. - control is sorted using a column with a property value of , a sorting glyph is automatically displayed in the column header. - - Starting in the .NET Framework 4.6, the sorting glyph is resized according to the system DPI settings when the app.config file contains the following entry: - -``` - - - -``` - - When the control is sorted using a column with a property value of , you must display the sorting glyph yourself through the property. - - The default sort mode of a is . The default sort mode for other column types is . - - The value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the method. - - A property value of will not prevent the event from occurring, but it will prevent the header from changing its appearance when it is clicked. - - - -## Examples - The following code example demonstrates how to use the property. - + control is sorted using a column with a property value of , a sorting glyph is automatically displayed in the column header. + + Starting in the .NET Framework 4.6, the sorting glyph is resized according to the system DPI settings when the app.config file contains the following entry: + +``` + + + +``` + + When the control is sorted using a column with a property value of , you must display the sorting glyph yourself through the property. + + The default sort mode of a is . The default sort mode for other column types is . + + The value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the method. + + A property value of will not prevent the event from occurring, but it will prevent the header from changing its appearance when it is clicked. + + + +## Examples + The following code example demonstrates how to use the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]> The value assigned to the property conflicts with . @@ -1689,20 +1689,20 @@ Gets or sets the text used for ToolTips. The text to display as a ToolTip for the column. - class. - + class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet145"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet145"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet145"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet145"::: + ]]> @@ -1735,11 +1735,11 @@ Gets a string that describes the column. A that describes the column. - method. The returned string contains the and properties of the . - + method. The returned string contains the and properties of the . + ]]> @@ -1792,19 +1792,19 @@ Gets or sets the data type of the values in the column's cells. A that describes the run-time class of the values stored in the column's cells. - property in the initialization of a that contains values. - + property in the initialization of a that contains values. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: + ]]> @@ -1848,22 +1848,22 @@ if the column is visible; otherwise, . - . To completely remove a column, use the method. - - To hide a column that is automatically generated when binding to a data source, set this property in a event handler. - - - -## Examples - The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class overview. - + . To completely remove a column, use the method. + + To hide a column that is automatically generated when binding to a data source, set this property in a event handler. + + + +## Examples + The following code example demonstrates how to use the property, which is nearly identical to the property of the class. This code example is part of a larger example provided for the class overview. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewBandDemo.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewBandDemo.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewbanddemo.vb" id="Snippet9"::: + ]]> @@ -1909,20 +1909,20 @@ Gets or sets the current width of the column. The width, in pixels, of the column. The default is 100. - property, the property value is used instead. - - - -## Examples - The following code example sets the width of a column. This code example is part of a larger example provided for the class. - + property, the property value is used instead. + + + +## Examples + The following code example sets the width of a column. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet108"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet108"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet108"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet108"::: + ]]> The specified value when setting this property is greater than 65536. diff --git a/xml/System.Windows.Forms/DataGridViewColumnCollection.xml b/xml/System.Windows.Forms/DataGridViewColumnCollection.xml index beea4a0298a..1f117b978d9 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnCollection.xml @@ -43,19 +43,19 @@ Represents a collection of objects in a control. - property of the control. The collection maintains a reference to the control through the property. - - - -## Examples - The following code example illustrates the use of this type. - + property of the control. The collection maintains a reference to the control through the property. + + + +## Examples + The following code example illustrates the use of this type. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/BeginEdit/misc2.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc2/vb/misc2.vb" id="Snippet20"::: + ]]> @@ -132,72 +132,72 @@ Adds the given column to the collection. The index of the column. - is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - already belongs to a control. - - -or- - - The property value is and the property value is or . Use the control and methods to temporarily set conflicting property values. - - -or- - - The property value is and the property value is . - - -or- - - has an property value of and a property value of . - - -or- - - has a property value that would cause the combined values of all columns in the control to exceed 65535. - - -or- - - has and property values that would display it among a set of adjacent columns with the opposite property value. - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + already belongs to a control. + + -or- + + The property value is and the property value is or . Use the control and methods to temporarily set conflicting property values. + + -or- + + The property value is and the property value is . + + -or- + + has an property value of and a property value of . + + -or- + + has a property value that would cause the combined values of all columns in the control to exceed 65535. + + -or- + + has and property values that would display it among a set of adjacent columns with the opposite property value. + + -or- + The control contains at least one row and has a property value of . @@ -246,47 +246,47 @@ Adds a with the given column name and column header text to the collection. The index of the column. - and properties, respectively. - + and properties, respectively. + ]]> - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - The property value is or , which conflicts with the default column property value of . - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + The property value is or , which conflicts with the default column property value of . + + -or- + The default column property value of 100 would cause the combined values of all columns in the control to exceed 65535. @@ -328,80 +328,80 @@ An array of objects to add. Adds a range of columns to the collection. - is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - At least one of the values in is . - - -or- - - At least one of the columns in already belongs to a control. - - -or- - - At least one of the columns in has a property value of and the control contains at least one row. - - -or- - - At least one of the columns in has a property value of and the property value is or . Use the control and methods to temporarily set conflicting property values. - - -or- - - At least one of the columns in has an property value of and the property value is . - - -or- - - At least one of the columns in has an property value of and a property value of . - - -or- - - The columns in have property values that would cause the combined values of all columns in the control to exceed 65535. - - -or- - - At least two of the values in are references to the same . - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + At least one of the values in is . + + -or- + + At least one of the columns in already belongs to a control. + + -or- + + At least one of the columns in has a property value of and the control contains at least one row. + + -or- + + At least one of the columns in has a property value of and the property value is or . Use the control and methods to temporarily set conflicting property values. + + -or- + + At least one of the columns in has an property value of and the property value is . + + -or- + + At least one of the columns in has an property value of and a property value of . + + -or- + + The columns in have property values that would cause the combined values of all columns in the control to exceed 65535. + + -or- + + At least two of the values in are references to the same . + + -or- + At least one of the columns in has and property values that would display it among a set of adjacent columns with the opposite property value. @@ -433,42 +433,42 @@ Clears the collection. - - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -506,23 +506,23 @@ Occurs when the collection 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 type named `DataGridViewColumnCollection1`. Then 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 type named `DataGridViewColumnCollection1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet372"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet372"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet372"::: + ]]> @@ -569,11 +569,11 @@ if the column is contained in the collection; otherwise, . - property. - + property. + ]]> @@ -719,14 +719,14 @@ Returns the number of columns that meet the given filter requirements. The number of columns that meet the filter requirements. - @@ -766,14 +766,14 @@ Returns the width, in pixels, required to display all of the columns that meet the given filter requirements. The width, in pixels, that is necessary to display all of the columns that meet the filter requirements. - @@ -823,22 +823,22 @@ Returns the first column in display order that meets the given inclusion-filter requirements. The first column in display order that meets the given filter requirements, or if no column is found. - value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column that fits the given criteria without having to compare index values directly. - - - -## Examples - The following code example uses the method to swap the first displayed column and the last displayed column. - + value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column that fits the given criteria without having to compare index values directly. + + + +## Examples + The following code example uses the method to swap the first displayed column and the last displayed column. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]> @@ -882,13 +882,13 @@ Returns the first column in display order that meets the given inclusion-filter and exclusion-filter requirements. The first column in display order that meets the given filter requirements, or if no column is found. - value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column that fits the given criteria without having to compare index values directly. - + value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column that fits the given criteria without having to compare index values directly. + ]]> At least one of the filter values is not a valid bitwise combination of values. @@ -931,22 +931,22 @@ Returns the last column in display order that meets the given filter requirements. The last displayed column in display order that meets the given filter requirements, or if no column is found. - value, regardless of whether the column is actually visible on the screen. - - This method lets you determine the last column that fits the given criteria without having to compare index values directly. - - - -## Examples - The following code example uses the method to swap the last displayed column and the first displayed column. - + value, regardless of whether the column is actually visible on the screen. + + This method lets you determine the last column that fits the given criteria without having to compare index values directly. + + + +## Examples + The following code example uses the method to swap the last displayed column and the first displayed column. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet170"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet170"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet170"::: + ]]> At least one of the filter values is not a valid bitwise combination of values. @@ -991,13 +991,13 @@ Gets the first column after the given column in display order that meets the given filter requirements. The next column that meets the given filter requirements, or if no column is found. - value higher than the value of the specified column, regardless of whether the column is actually visible on the screen. - - This method lets you determine the next column after the current column that fits the given criteria without having to compare index values directly. - + value higher than the value of the specified column, regardless of whether the column is actually visible on the screen. + + This method lets you determine the next column after the current column that fits the given criteria without having to compare index values directly. + ]]> @@ -1044,13 +1044,13 @@ Gets the last column prior to the given column in display order that meets the given filter requirements. The previous column that meets the given filter requirements, or if no column is found. - value lower than the value of the specified column, regardless of whether the column is actually visible on the screen. - - This method lets you determine the first column before the current column that fits the given criteria without having to compare index values directly. - + value lower than the value of the specified column, regardless of whether the column is actually visible on the screen. + + This method lets you determine the first column before the current column that fits the given criteria without having to compare index values directly. + ]]> @@ -1127,68 +1127,68 @@ The to insert. Inserts a column at the given index in the collection. - is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - already belongs to a control. - - -or- - - The property value is and the property value is or . Use the control and methods to temporarily set conflicting property values. - - -or- - - The property value is and the property value is . - - -or- - - has an property value of and a property value of . - - -or- - - has and property values that would display it among a set of adjacent columns with the opposite property value. - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + already belongs to a control. + + -or- + + The property value is and the property value is or . Use the control and methods to temporarily set conflicting property values. + + -or- + + The property value is and the property value is . + + -or- + + has an property value of and a property value of . + + -or- + + has and property values that would display it among a set of adjacent columns with the opposite property value. + + -or- + The control contains at least one row and has a property value of . @@ -1346,13 +1346,13 @@ 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. + ]]> @@ -1401,53 +1401,53 @@ The name of the column to delete. Removes the column with the specified name from the collection. - property. - - To remove a column that is automatically generated when binding to a data source, call this method in a event handler. - - - -## Examples - The following code example illustrates the use of this method. For more information, see [How to: Remove Autogenerated Columns from a Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/remove-autogenerated-columns-from-a-wf-datagridview-control). - + property. + + To remove a column that is automatically generated when binding to a data source, call this method in a event handler. + + + +## Examples + The following code example illustrates the use of this method. For more information, see [How to: Remove Autogenerated Columns from a Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/remove-autogenerated-columns-from-a-wf-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet110"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet110"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet110"::: + ]]> does not match the name of any column in the collection. is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -1484,43 +1484,43 @@ The column to delete. Removes the specified column from the collection. - event handler. - + event handler. + ]]> is not in the collection. is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -1556,41 +1556,41 @@ The index of the column to delete. Removes the column at the given index in the collection. - event handler. - + event handler. + ]]> is less than zero or greater than the number of columns in the control minus one. - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -1631,11 +1631,11 @@ The zero-based index in at which copying begins. Copies the entire contents of the collection to a compatible one-dimensional , starting at the specified index of the target array. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1643,10 +1643,10 @@ is less than 0. - is multidimensional. - - -or- - + is multidimensional. + + -or- + The number of elements in the source collection is greater than the available space from to the end of . The type of the source element cannot be cast automatically to the type of . @@ -1684,11 +1684,11 @@ Gets the number of elements in the collection. The number of elements in the . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1726,11 +1726,11 @@ in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1767,11 +1767,11 @@ Gets an object that can be used to synchronize access to the collection. An that can be used to synchronize access to the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1809,11 +1809,11 @@ Returns an enumerator that iterates through the collection. An that can be used to iterate through the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -1856,71 +1856,71 @@ Adds an object to the end of the collection. The index at which has been added. - instance is cast to an interface. - + instance is cast to an interface. + ]]> is not a . is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - The column indicated by already belongs to a control. - - -or- - - The property value of the column indicated by is and the property value is or . Use the control and methods to temporarily set conflicting property values. - - -or- - - The property value of the column indicated by is and the property value is . - - -or- - - The column indicated by has an property value of and a property value of . - - -or- - - The column indicated by has a property value that would cause the combined values of all columns in the control to exceed 65535. - - -or- - - The column indicated by has and property values that would display it among a set of adjacent columns with the opposite property value. - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + The column indicated by already belongs to a control. + + -or- + + The property value of the column indicated by is and the property value is or . Use the control and methods to temporarily set conflicting property values. + + -or- + + The property value of the column indicated by is and the property value is . + + -or- + + The column indicated by has an property value of and a property value of . + + -or- + + The column indicated by has a property value that would cause the combined values of all columns in the control to exceed 65535. + + -or- + + The column indicated by has and property values that would display it among a set of adjacent columns with the opposite property value. + + -or- + The control contains at least one row and the column indicated by has a property value of . @@ -1962,39 +1962,39 @@ Removes all elements from the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -2036,11 +2036,11 @@ if is found in the ; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2084,11 +2084,11 @@ Determines the index of a specific item in the collection. The zero-based index of the first occurrence of within the collection, if found; otherwise, -1. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2131,71 +2131,71 @@ The to insert. The value can be . Inserts an element into the collection at the specified index. - instance is cast to an interface. - + instance is cast to an interface. + ]]> is not a . is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - -- - - -or- - - The column indicated by already belongs to a control. - - -or- - - The property value of the column indicated by is and the property value is or . Use the control and methods to temporarily set conflicting property values. - - -or- - - The property value of the column indicated by is and the property value is . - - -or- - - The column indicated by has an property value of and a property value of . - - -or- - - The column indicated by has a property value that would cause the combined values of all columns in the control to exceed 65535. - - -or- - - The column indicated by has and property values that would display it among a set of adjacent columns with the opposite property value. - - -or- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + +- + + -or- + + The column indicated by already belongs to a control. + + -or- + + The property value of the column indicated by is and the property value is or . Use the control and methods to temporarily set conflicting property values. + + -or- + + The property value of the column indicated by is and the property value is . + + -or- + + The column indicated by has an property value of and a property value of . + + -or- + + The column indicated by has a property value that would cause the combined values of all columns in the control to exceed 65535. + + -or- + + The column indicated by has and property values that would display it among a set of adjacent columns with the opposite property value. + + -or- + The control contains at least one row and the column indicated by has a property value of . @@ -2232,11 +2232,11 @@ in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2274,11 +2274,11 @@ in all cases. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2330,13 +2330,13 @@ Gets or sets the element at the specified index. The at the specified index. - instance is cast to an interface. - - This implementation does not support setting this property. - + instance is cast to an interface. + + This implementation does not support setting this property. + ]]> This property is being set. @@ -2379,11 +2379,11 @@ The to remove from the collection. The value can be . Removes the first occurrence of the specified object from the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -2392,32 +2392,32 @@ is not in the collection. is . - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - @@ -2462,41 +2462,41 @@ The location of the element to delete. Removes the element with the specified index from the collection. - instance is cast to an interface. - + instance is cast to an interface. + ]]> is less than zero or greater than the number of columns in the control minus one. - The associated control is performing one of the following actions that temporarily prevents new columns from being added: - -- Selecting all cells in the control. - -- Clearing the selection. - -- Updating column property values. - - -or- - - This method is being called from a handler for one of the following events: - -- - -- - -- - -- - -- - -- - -- - + The associated control is performing one of the following actions that temporarily prevents new columns from being added: + +- Selecting all cells in the control. + +- Clearing the selection. + +- Updating column property values. + + -or- + + This method is being called from a handler for one of the following events: + +- + +- + +- + +- + +- + +- + +- + - diff --git a/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml b/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml index a564f1b1acd..f6d66469005 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnHeaderCell.xml @@ -57,11 +57,11 @@ Initializes a new instance of the class. - property to . - + property to . + ]]> @@ -125,14 +125,14 @@ Creates a new accessible object for the . A new for the . - 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 , you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set , you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -185,17 +185,17 @@ Retrieves the formatted value of the cell to copy to the . A that represents the value of the cell to copy to the . - property of the control, this method is called by the control's method to retrieve a clipboard-formatted value that represents the cell. - - The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the control. Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row. - - The supported clipboard formats include , , , and . - - For more information, see the class. - + property of the control, this method is called by the control's method to retrieve a clipboard-formatted value that represents the cell. + + The position-related parameters of this method indicate where this cell is located in the table of data representing the region defined by the selected cells in the control. Depending on the cell's position, formatting information may be returned by this method in addition to the cell value. For example, the HTML format for a cell in the first column of a row will include the tag that indicates the beginning of a row. + + The supported clipboard formats include , , , and . + + For more information, see the class. + ]]> @@ -240,11 +240,11 @@ Returns the bounding rectangle that encloses the cell's content area, which is calculated using the specified object and cell style. The that bounds the cell's contents. - property is read. - + property is read. + ]]> @@ -253,7 +253,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -337,11 +337,11 @@ Gets the style applied to the cell. A that includes the style settings of the cell inherited from the cell's parent row, column, and . - that inherits its settings from the objects returned by the and properties of the . For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - + that inherits its settings from the objects returned by the and properties of the . For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + ]]> @@ -352,7 +352,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -396,7 +396,7 @@ - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -590,26 +590,26 @@ Gets or sets a value indicating which sort glyph is displayed. A value representing the current glyph. The default is . - property set to . You must set this property yourself when sorting by columns with the property set to . - - - -## Examples - The following code demonstrates how to use the property in a programmatic sort. - + property set to . You must set this property yourself when sorting by columns with the property set to . + + + +## Examples + The following code demonstrates how to use the property in a programmatic sort. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SelectedColumns/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewProgrammaticSort/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewProgrammaticSort/VB/form1.vb" id="Snippet10"::: + ]]> The specified value when setting this property is not a valid value. - When setting this property, the value of either the property or the property of the cell is . - - -or- - + When setting this property, the value of either the property or the property of the cell is . + + -or- + When changing the value of this property, the specified value is not and the value of the property of the owning column is . diff --git a/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml b/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml index 5aec9f0a9a6..0001e389dea 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnHeadersHeightSizeMode.xml @@ -22,29 +22,29 @@ Defines values for specifying how the height of the column headers is adjusted. - control property and method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration in a display-only, non-interactive control. - + control property and method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration in a display-only, non-interactive control. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Sizing Options in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml b/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml index ef9fdd483e3..11bd9c6a38b 100644 --- a/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml +++ b/xml/System.Windows.Forms/DataGridViewColumnSortMode.xml @@ -22,19 +22,19 @@ Defines how a column can be sorted by the user. - property. - - - -## Examples - The following code example illustrates the use of this type. For more information, see [How to: Set the Sort Modes for Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/set-the-sort-modes-for-columns-wf-datagridview-control). - + property. + + + +## Examples + The following code example illustrates the use of this type. For more information, see [How to: Set the Sort Modes for Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/set-the-sort-modes-for-columns-wf-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml b/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml index f16328031fd..ea51265a745 100644 --- a/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewComboBoxCell.xml @@ -64,7 +64,7 @@ - How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List + How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List @@ -1006,7 +1006,7 @@ For additional information, see [What's New in Accessibility in the .NET Framewo - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1045,14 +1045,14 @@ For additional information, see [What's New in Accessibility in the .NET Framewo ## Remarks When the property of the control is set to or , the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode. - This method returns `true` if the e parameter indicates one of the following keys or key combinations: F4, ALT+UP ARROW, ALT+DOWN ARROW, or an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). + This method returns `true` if the e parameter indicates one of the following keys or key combinations: F4, ALT+UP ARROW, ALT+DOWN ARROW, or an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). ]]> - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml index 6dc09a921d6..0e10fff09df 100644 --- a/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewComboBoxColumn.xml @@ -94,7 +94,7 @@ - How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List + How to: Access Objects in a Windows Forms DataGridViewComboBoxCell Drop-Down List @@ -250,7 +250,7 @@ ## Examples - The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: diff --git a/xml/System.Windows.Forms/DataGridViewContentAlignment.xml b/xml/System.Windows.Forms/DataGridViewContentAlignment.xml index ca1f6d22315..63607cc721c 100644 --- a/xml/System.Windows.Forms/DataGridViewContentAlignment.xml +++ b/xml/System.Windows.Forms/DataGridViewContentAlignment.xml @@ -22,19 +22,19 @@ Defines constants that indicate the alignment of content within a cell. - property. - - - -## Examples - The following code example illustrates the use of this type. For more information, see [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control). - + property. + + + +## Examples + The following code example illustrates the use of this type. For more information, see [How to: Format Data in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-format-data-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet072"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet072"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml b/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml index 2a9ecdd6896..f3104aa31d9 100644 --- a/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml +++ b/xml/System.Windows.Forms/DataGridViewDataErrorContexts.xml @@ -28,19 +28,19 @@ Represents the state of a data-bound control when a data error occurred. - when a data error occurred. For example, if a user enters an invalid cell value (such as entering a name in a cell that expects a date) and then selects a different cell, the will try to commit the invalid cell value. When the commit fails, the will raise a event whose property will have a value of Commit and CurrentCellChange. - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Handle Errors That Occur During Data Entry in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/handle-errors-that-occur-during-data-entry-in-the-datagrid). - + when a data error occurred. For example, if a user enters an invalid cell value (such as entering a name in a cell that expects a date) and then selects a different cell, the will try to commit the invalid cell value. When the commit fails, the will raise a event whose property will have a value of Commit and CurrentCellChange. + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Handle Errors That Occur During Data Entry in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/handle-errors-that-occur-during-data-entry-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewDataErrorContexts/Overview/errorhandling.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DataError/VB/errorhandling.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.DataError/VB/errorhandling.vb" id="Snippet20"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewEditMode.xml b/xml/System.Windows.Forms/DataGridViewEditMode.xml index fb56ad750fb..d5bf49c8060 100644 --- a/xml/System.Windows.Forms/DataGridViewEditMode.xml +++ b/xml/System.Windows.Forms/DataGridViewEditMode.xml @@ -22,21 +22,21 @@ Specifies how a user starts cell editing in the control. - property of the control. - - All values except for EditProgrammatically allow a user to double-click a cell to begin editing it. - - - -## Examples - The following code example illustrates the use of this type. For more information, see [How to: Specify the Edit Mode for the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-specify-the-edit-mode-for-the-windows-forms-datagridview-control). - + property of the control. + + All values except for EditProgrammatically allow a user to double-click a cell to begin editing it. + + + +## Examples + The following code example illustrates the use of this type. For more information, see [How to: Specify the Edit Mode for the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-specify-the-edit-mode-for-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet067"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet067"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet067"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewElementStates.xml b/xml/System.Windows.Forms/DataGridViewElementStates.xml index 1a80df0a6b8..c23ca03a7da 100644 --- a/xml/System.Windows.Forms/DataGridViewElementStates.xml +++ b/xml/System.Windows.Forms/DataGridViewElementStates.xml @@ -32,19 +32,19 @@ Specifies the user interface (UI) state of a element within a control. - diff --git a/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml b/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml index cf8faae9e8b..86db7ee6631 100644 --- a/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml +++ b/xml/System.Windows.Forms/DataGridViewHeaderBorderStyle.xml @@ -22,14 +22,14 @@ Specifies the border style that can be applied to the and properties of a control. - diff --git a/xml/System.Windows.Forms/DataGridViewHeaderCell.xml b/xml/System.Windows.Forms/DataGridViewHeaderCell.xml index 0cf45e3477b..09ee88ac9c6 100644 --- a/xml/System.Windows.Forms/DataGridViewHeaderCell.xml +++ b/xml/System.Windows.Forms/DataGridViewHeaderCell.xml @@ -568,7 +568,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -622,7 +622,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -673,7 +673,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -724,7 +724,7 @@ For more information about row sharing, see [Best Practices for Scaling the Wind - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewImageCell.xml b/xml/System.Windows.Forms/DataGridViewImageCell.xml index f5a388a3587..b3aabcf3b78 100644 --- a/xml/System.Windows.Forms/DataGridViewImageCell.xml +++ b/xml/System.Windows.Forms/DataGridViewImageCell.xml @@ -29,24 +29,24 @@ Displays a graphic in a control. - class is a specialized type of used to display an or an , depending on the value of the property. Typically, the property of a is set to `true` to indicate that the user cannot edit the cell contents. - - The is the column type specialized to hold cells of this type. By default, the is initialized to a new . To pattern the cells within a column after an existing , set the column's property to the cell to use as a pattern. - - The cell-related properties of the column are wrappers for the similarly-named properties of the template cell. Changing the property values of the template cell will affect only cells based on the template that are added after the change. Changing the cell-related property values of the column, however, will update the template cell and all other cells in the column, and refresh the column display if necessary. - - - -## Examples - The following code example demonstrates how to change the image in an image cell using . This code example is part of a larger example provided for the topic [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + class is a specialized type of used to display an or an , depending on the value of the property. Typically, the property of a is set to `true` to indicate that the user cannot edit the cell contents. + + The is the column type specialized to hold cells of this type. By default, the is initialized to a new . To pattern the cells within a column after an existing , set the column's property to the cell to use as a pattern. + + The cell-related properties of the column are wrappers for the similarly-named properties of the template cell. Changing the property values of the template cell will affect only cells based on the template that are added after the change. Changing the cell-related property values of the column, however, will update the template cell and all other cells in the column, and refresh the column display if necessary. + + + +## Examples + The following code example demonstrates how to change the image in an image cell using . This code example is part of a larger example provided for the topic [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet10"::: + ]]> @@ -99,11 +99,11 @@ Initializes a new instance of the class, configuring it for use with cell values other than objects. - with a `valueIsIcon` parameter value of `false`. - + with a `valueIsIcon` parameter value of `false`. + ]]> @@ -135,15 +135,15 @@ The cell will display an value. Initializes a new instance of the class, optionally configuring it for use with cell values. - property is set to the value of the `valueIsIcon` parameter. - - To ensure that the alpha channel of values is painted correctly, use this constructor with a `valueIsIcon` parameter value of `true`. - - If the `valueIsIcon` parameter is `true`, the and properties return a object representing the type. - + property is set to the value of the `valueIsIcon` parameter. + + To ensure that the alpha channel of values is painted correctly, use this constructor with a `valueIsIcon` parameter value of `true`. + + If the `valueIsIcon` parameter is `true`, the and properties return a object representing the type. + ]]> @@ -181,11 +181,11 @@ Creates an exact copy of this cell. An that represents the cloned . - method whenever you derive from and add new properties to the derived class. - + method whenever you derive from and add new properties to the derived class. + ]]> @@ -221,14 +221,14 @@ Creates a new accessible object for the . A new for the . - 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 , you must add a reference to the `Accessibility` assembly installed with the .NET Framework. - +> To get or set , you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -269,13 +269,13 @@ Gets the default value that is used when creating a new row. An object containing a default image placeholder, or to display an empty cell. - or type , depending on the value of the property. - - Whenever a is displayed in which new rows can be added, the last row is an empty new row of cells loaded with default values. Override this property to provide a different default image for these cells or to return `null` to avoid displaying images. - + or type , depending on the value of the property. + + Whenever a is displayed in which new rows can be added, the last row is an empty new row of cells loaded with default values. Override this property to provide a different default image for these cells or to return `null` to avoid displaying images. + ]]> @@ -316,22 +316,22 @@ Gets or sets the text associated with the image. The text associated with the image displayed in the cell. - property of the owning column also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + property of the owning column also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]> @@ -375,11 +375,11 @@ Gets the type of the cell's hosted editing control. The of the underlying editing control. As implemented in this class, this property is always . - property is always `null` because there is no associated Windows Forms control for editing an image. - + property is always `null` because there is no associated Windows Forms control for editing an image. + ]]> @@ -411,19 +411,19 @@ Gets the type of the formatted value associated with the cell. A object representing display value type of the cell, which is the type if the property is set to or the type otherwise. - object representing either the type or the type because a can only handle graphic images. - - - -## Examples - The following code example demonstrates how to use the property to determine the type of the cell contents. In this example, the property is used to determine whether the cell contains a before attempting to convert the value. This example is part of a larger example available in the event. - + object representing either the type or the type because a can only handle graphic images. + + + +## Examples + The following code example demonstrates how to use the property to determine the type of the cell contents. In this example, the property is used to determine whether the cell contains a before attempting to convert the value. This example is part of a larger example available in the event. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellValidated/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSelectionSum/VB/form1.vb" id="Snippet10"::: + ]]> @@ -556,19 +556,19 @@ Returns a graphic as it would be displayed in the cell. An object that represents the formatted image. - control calls this method to convert a cell value into an equivalent display value of the type indicated by the property. The control passes the cell value to this method in the `value` parameter. - - If the `context` parameter value includes the value, this method returns the value of the property for copying to the Clipboard. Otherwise, the event occurs. - - A event handler can modify both `value` and `cellStyle`. If the handler does not set the property to `true`, however, this method formats `value` using the formatting properties of the `cellStyle` object. - - If formatting is unsuccessful, the event occurs. If there is no handler for this event or the handler sets the property to `true`, an exception is thrown. - - If formatting is successful and the type of the formatted value matches the value of the property, this method returns the formatted value. Otherwise, this method returns a standard error graphic in the type indicated by the property. - + control calls this method to convert a cell value into an equivalent display value of the type indicated by the property. The control passes the cell value to this method in the `value` parameter. + + If the `context` parameter value includes the value, this method returns the value of the property for copying to the Clipboard. Otherwise, the event occurs. + + A event handler can modify both `value` and `cellStyle`. If the handler does not set the property to `true`, however, this method formats `value` using the formatting properties of the `cellStyle` object. + + If formatting is unsuccessful, the event occurs. If there is no handler for this event or the handler sets the property to `true`, an exception is thrown. + + If formatting is successful and the type of the formatted value matches the value of the property, this method returns the formatted value. Otherwise, this method returns a standard error graphic in the type indicated by the property. + ]]> @@ -689,13 +689,13 @@ Gets or sets the graphics layout for the cell. A for this cell. The default is . - property of the owning column also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - + property of the owning column also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + ]]> The supplied value is invalid. @@ -841,17 +841,17 @@ if this cell displays an value; otherwise, . - values is painted correctly, set this property to `true`. When this property is `true`, the and properties return a object representing the type. - - Setting the property of the owning column also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - When the value of this property changes for a cell in the row for new records, the image displayed in the cell is updated to the current value of the property. - - Unlike the column property, the cell property does not automatically update the property of the associated cell style when you change its value. When you change the cell property value to `true`, be sure to set the property of the object returned by the property to a valid . When you change the property value to `false`, be sure to set the property to a valid . - + values is painted correctly, set this property to `true`. When this property is `true`, the and properties return a object representing the type. + + Setting the property of the owning column also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + When the value of this property changes for a cell in the row for new records, the image displayed in the cell is updated to the current value of the property. + + Unlike the column property, the cell property does not automatically update the property of the associated cell style when you change its value. When you change the cell property value to `true`, be sure to set the property of the object returned by the property to a valid . When you change the property value to `false`, be sure to set the property to a valid . + ]]> @@ -895,13 +895,13 @@ Gets or sets the data type of the values in the cell. The of the cell's value. - for the cell has not been set, then the for the owning column is used, if it exists. If no owning column exists, the default value type is used, which is the type if the property is set to `false` and the type otherwise. - - The is the actual data object contained in the cell, whereas the property is the formatted representation of this object. The and properties correspond to the data types of these values, respectively. - + for the cell has not been set, then the for the owning column is used, if it exists. If no owning column exists, the default value type is used, which is the type if the property is set to `false` and the type otherwise. + + The is the actual data object contained in the cell, whereas the property is the formatted representation of this object. The and properties correspond to the data types of these values, respectively. + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml b/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml index ac13d558095..8bd5dc05b00 100644 --- a/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml +++ b/xml/System.Windows.Forms/DataGridViewImageCellLayout.xml @@ -22,15 +22,15 @@ Specifies the layout for an image contained in a . - diff --git a/xml/System.Windows.Forms/DataGridViewImageColumn.xml b/xml/System.Windows.Forms/DataGridViewImageColumn.xml index 21587e20ba7..f6c7cb83c04 100644 --- a/xml/System.Windows.Forms/DataGridViewImageColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewImageColumn.xml @@ -41,24 +41,24 @@ Hosts a collection of objects. - class is a specialized type of the class used to logically host cells that display images. A has an associated in every that intersects it. Each cell is capable of containing an or an , depending on the value of the property. Displaying icons is useful to accommodate images with transparency. - - By default, empty cells display a default error graphic. To prevent this graphic from appearing for cell values equal to `null` or , set the property of the cell style object returned by the property to `null` before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control property value is `true`, you must also either explicitly set the cell value to `null` in a handler for the control event or set the column property to an instance of a -derived type with an overridden property that returns `null`. - - The default sort mode for this column type is . - - - -## Examples - The following code example demonstrates how to use images to create a TicTacToe game. - + class is a specialized type of the class used to logically host cells that display images. A has an associated in every that intersects it. Each cell is capable of containing an or an , depending on the value of the property. Displaying icons is useful to accommodate images with transparency. + + By default, empty cells display a default error graphic. To prevent this graphic from appearing for cell values equal to `null` or , set the property of the cell style object returned by the property to `null` before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control property value is `true`, you must also either explicitly set the cell value to `null` in a handler for the control event or set the column property to an instance of a -derived type with an overridden property that returns `null`. + + The default sort mode for this column type is . + + + +## Examples + The following code example demonstrates how to use images to create a TicTacToe game. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet0"::: + ]]> @@ -111,11 +111,11 @@ Initializes a new instance of the class, configuring it for use with cell values of type . - with a `valuesAreIcons` parameter value of `false`. - + with a `valuesAreIcons` parameter value of `false`. + ]]> @@ -150,20 +150,20 @@ to indicate that the property of cells in this column will be set to values of type ; to indicate that they will be set to values of type . Initializes a new instance of the class, optionally configuring it for use with cell values. - |A new with its property initialized to the `valuesAreIcons` parameter value.| -||The value of the `valuesAreIcons` parameter.| -|The property of the object returned by the property.|| -|The property of the object returned by the property.|A standard error graphic of type if `valuesAreIcons` is `true` and type if `valuesAreIcons` is `false`.| - - To ensure that the alpha channel of cell values is painted correctly, use this constructor with a `valuesAreIcons` parameter value of `true`. - + |A new with its property initialized to the `valuesAreIcons` parameter value.| +||The value of the `valuesAreIcons` parameter.| +|The property of the object returned by the property.|| +|The property of the object returned by the property.|A standard error graphic of type if `valuesAreIcons` is `true` and type if `valuesAreIcons` is `false`.| + + To ensure that the alpha channel of cell values is painted correctly, use this constructor with a `valuesAreIcons` parameter value of `true`. + ]]> @@ -222,23 +222,23 @@ Gets or sets the template used to create new cells. A that all other cells in the column are modeled after. - class initialize this property to a newly created . - + class initialize this property to a newly created . + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). - - - -## Examples - The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). + + + +## Examples + The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]> The set type is not compatible with type . @@ -276,11 +276,11 @@ Creates an exact copy of this column. An that represents the cloned . - @@ -321,36 +321,36 @@ Gets or sets the column's default cell style. The to be applied as the default style. - returned by this property has the following initial property values: - -|`DataGridViewCellStyle` property|Default value| -|--------------------------------------|-------------------| -||| -||A standard error graphic of type if the initial property value is `true`; otherwise, a standard error graphic of type .| - - These values override the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). - - To prevent the standard error graphic from appearing for `null` or cell values, set the property for this cell style object to `null` or your own error graphic before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control property value is `true`, you must also either explicitly set the cell value to `null` or your own error graphic in a handler for the control event or set the column property to an instance of a -derived type with an overridden property that returns `null` or your own error graphic. - - If the property of the object returned by the property has a value equal to the standard error graphic of type , changing the property value to `true` automatically sets to the standard error graphic of type . If has a value equal to the standard error graphic of type , changing the property value to `false` automatically sets to the standard error graphic of type . - - - -## Examples - The following code example demonstrates the use of this property. - + returned by this property has the following initial property values: + +|`DataGridViewCellStyle` property|Default value| +|--------------------------------------|-------------------| +||| +||A standard error graphic of type if the initial property value is `true`; otherwise, a standard error graphic of type .| + + These values override the value specified in the property of the control, but may be overridden by other cell style properties. For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + + To prevent the standard error graphic from appearing for `null` or cell values, set the property for this cell style object to `null` or your own error graphic before adding rows to the control. This does not affect the row for new records, however. To prevent the error graphic from appearing in the row for new records when the control property value is `true`, you must also either explicitly set the cell value to `null` or your own error graphic in a handler for the control event or set the column property to an instance of a -derived type with an overridden property that returns `null` or your own error graphic. + + If the property of the object returned by the property has a value equal to the standard error graphic of type , changing the property value to `true` automatically sets to the standard error graphic of type . If has a value equal to the standard error graphic of type , changing the property value to `false` automatically sets to the standard error graphic of type . + + + +## Examples + The following code example demonstrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewButtonColumn/DefaultCellStyle/changecolumnalignment.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GridViewContentAlignment/VB/changecolumnalignment.vb" id="Snippet1"::: + ]]> - Cell Styles in the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -405,22 +405,22 @@ Gets or sets a string that describes the column's image. The textual description of the column image. The default is . - property to describe the image provided by the or property. This description provides an accessible alternative to the image. Additionally, the description text is used when the cell value is copied onto the Clipboard. - - Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to use the property to reflect the image layout. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + property to describe the image provided by the or property. This description provides an accessible alternative to the image. Additionally, the description text is used when the cell value is copied onto the Clipboard. + + Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to use the property to reflect the image layout. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]> The value of the property is . @@ -477,13 +477,13 @@ Gets or sets the icon displayed in the cells of this column when the cell's property is not set and the cell's property is set to . The to display. The default is . - property specifies an icons that is displayed in cells with no values when the column is not data-bound and the cell's property is set to `true`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. - - Using the property rather than the property ensures that an alpha channel in an icon is painted correctly. If you want to display an instead of an , set the property instead and set the property to `false`. You can also set the property of individual cells to indicate whether the cell displays the or the property value. - + property specifies an icons that is displayed in cells with no values when the column is not data-bound and the cell's property is set to `true`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. + + Using the property rather than the property ensures that an alpha channel in an icon is painted correctly. If you want to display an instead of an , set the property instead and set the property to `false`. You can also set the property of individual cells to indicate whether the cell displays the or the property value. + ]]> @@ -532,22 +532,22 @@ Gets or sets the image displayed in the cells of this column when the cell's property is not set and the cell's property is set to . The to display. The default is . - property specifies an image that is displayed in cells with no values when the column is not data-bound and the cell's property is set to `false`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. - - If you want to display an instead of an , set the property instead and set the property to `true`. This ensures that the alpha channel of the is painted correctly. You can also set the property of individual cells to indicate whether the cell displays the or the property value when there is no cell value. - - - -## Examples - The following code example demonstrates how to set the default image. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + property specifies an image that is displayed in cells with no values when the column is not data-bound and the cell's property is set to `false`. For a data-bound column whose cells do not have an associated image, a standard error graphic is displayed. + + If you want to display an instead of an , set the property instead and set the property to `true`. This ensures that the alpha channel of the is painted correctly. You can also set the property of individual cells to indicate whether the cell displays the or the property value when there is no cell value. + + + +## Examples + The following code example demonstrates how to set the default image. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet5"::: + ]]> @@ -602,20 +602,20 @@ Gets or sets the image layout in the cells for this column. A that specifies the cell layout. The default is . - property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - - -## Examples - The following code example demonstrates how to stretch and zoom images to fit cells. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). - + property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + + +## Examples + The following code example demonstrates how to stretch and zoom images to fit cells. This example is part of a larger example available in [How to: Work with Image Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-work-with-image-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/CPP/tictactoe.cpp" id="Snippet20"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellClick/tictactoe.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ImageColumn_TicTacToe/VB/tictactoe.vb" id="Snippet20"::: + ]]> The value of the property is . @@ -709,15 +709,15 @@ if cells display values of type ; if cells display values of type . The default is . - values is painted correctly, set this property to `true`. - - Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. - - If the property of the object returned by the property has a value equal to the standard error graphic of type , changing the property value to `true` automatically sets to the standard error graphic of type . If has a value equal to the standard error graphic of type , changing the property value to `false` automatically sets to the standard error graphic of type . - + values is painted correctly, set this property to `true`. + + Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column and refreshes the column display. To override the specified value for individual cells, set the cell values after you set the column value. + + If the property of the object returned by the property has a value equal to the standard error graphic of type , changing the property value to `true` automatically sets to the standard error graphic of type . If has a value equal to the standard error graphic of type , changing the property value to `false` automatically sets to the standard error graphic of type . + ]]> The value of the property is . diff --git a/xml/System.Windows.Forms/DataGridViewLinkCell.xml b/xml/System.Windows.Forms/DataGridViewLinkCell.xml index 248795df445..a8bb9927145 100644 --- a/xml/System.Windows.Forms/DataGridViewLinkCell.xml +++ b/xml/System.Windows.Forms/DataGridViewLinkCell.xml @@ -505,7 +505,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -690,7 +690,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -735,7 +735,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -780,7 +780,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -825,7 +825,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewPaintParts.xml b/xml/System.Windows.Forms/DataGridViewPaintParts.xml index 9de54c8aa4f..37cffc1bb16 100644 --- a/xml/System.Windows.Forms/DataGridViewPaintParts.xml +++ b/xml/System.Windows.Forms/DataGridViewPaintParts.xml @@ -28,19 +28,19 @@ Defines values for specifying the parts of a that are to be painted. - method and by handlers for the , , and events of the control. - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + method and by handlers for the , , and events of the control. + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewRow.xml b/xml/System.Windows.Forms/DataGridViewRow.xml index 11700fcbd56..fc041e1deee 100644 --- a/xml/System.Windows.Forms/DataGridViewRow.xml +++ b/xml/System.Windows.Forms/DataGridViewRow.xml @@ -40,14 +40,14 @@ Unlike a , a physically contains a collection of all of the cells in that row. You can access this collection through the property. - The class is used to access the individual cell elements, as well as to adjust the appearance and behavior of the row user interface (UI), such as height and cell style. Typically, you will want all rows or most rows in the control to share the same characteristics. To set cell styles for all rows in the control, set the properties of the object returned by the property. To set styles for alternating rows, use the property. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). You can also use the property to define a row that will be used as a basis for all rows added to the control. + The class is used to access the individual cell elements, as well as to adjust the appearance and behavior of the row user interface (UI), such as height and cell style. Typically, you will want all rows or most rows in the control to share the same characteristics. To set cell styles for all rows in the control, set the properties of the object returned by the property. To set styles for alternating rows, use the property. For more information about cell styles, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). You can also use the property to define a row that will be used as a basis for all rows added to the control. The control will share objects across multiple data rows whenever possible to avoid performance penalties. Unless you are working with large amounts of data and experiencing performance issues, you can typically ignore row sharing. A shared row is indicated by an property value of -1. Some members of the class cannot be used with shared rows, but you can unshare a row by accessing it through the property. Rows can also become unshared in other ways. To access a row without unsharing it, use the method. When working with large amounts of data, you should be aware of how rows are shared and unshared to avoid performance penalties. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). ## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet209"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet209"::: @@ -61,8 +61,8 @@ - Best Practices for Scaling the Windows Forms DataGridView Control - Cell Styles in the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control @@ -271,7 +271,7 @@ ## Examples - The following code example uses the property to set the value of a cell in the row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the property to set the value of a cell in the row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet211"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet211"::: @@ -403,7 +403,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -660,7 +660,7 @@ ## Examples - The following code example demonstrates how to use the property to access a business object bound to a row. This code example is part of a larger example provided in [How to: Access Objects Bound to Windows Forms DataGridView Rows](/dotnet/framework/winforms/controls/how-to-access-objects-bound-to-windows-forms-datagridview-rows). + The following code example demonstrates how to use the property to access a business object bound to a row. This code example is part of a larger example provided in [How to: Access Objects Bound to Windows Forms DataGridView Rows](/dotnet/desktop/winforms/controls/how-to-access-objects-bound-to-windows-forms-datagridview-rows). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewRow/DataBoundItem/datagridviewobjectbinding.cs" id="Snippet10"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewObjectBinding/VB/datagridviewobjectbinding.vb" id="Snippet10"::: @@ -719,7 +719,7 @@ ## Remarks The control displays its cells using the styles indicated by the cell property, which inherits styles from other properties of type . For cells in this row, the styles specified through the property override the styles specified through the , , , and properties, but are overridden by the styles specified through the property. - For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). When getting this property, a with default values will be created if the property has not already been accessed. This can cause a performance impact when getting this property for many rows. Whenever possible, use a single to set this property for multiple rows. For more information, see [Best Practices for Scaling the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/best-practices-for-scaling-the-windows-forms-datagridview-control). @@ -736,8 +736,8 @@ When setting this property, the row is in a control and is a shared row. - Cell Styles in the Windows Forms DataGridView Control - Best Practices for Scaling the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -775,7 +775,7 @@ To be added. The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -832,7 +832,7 @@ When setting this property, the row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -971,7 +971,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1025,7 +1025,7 @@ The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1071,7 +1071,7 @@ is less than zero or greater than or equal to the number of rows in the control minus one. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1114,7 +1114,7 @@ The row belongs to a control and is a shared row. The row belongs to a control and is less than zero or greater than the number of rows in the control minus one. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1161,12 +1161,12 @@ For cell contents to wrap onto multiple lines, the cell style in effect for the cell must have a property value of . - For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + For more information about automatic sizing, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). ## Examples - The following code example uses the method to determine the new padding for a row that has been resized. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + The following code example uses the method to determine the new padding for a row that has been resized. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet40"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet40"::: @@ -1180,9 +1180,9 @@ - How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control - Sizing Options in the Windows Forms DataGridView Control - Best Practices for Scaling the Windows Forms DataGridView Control + How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1239,7 +1239,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1347,7 +1347,7 @@ ## Examples - The following code example uses the property to set the height of the first row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the property to set the height of the first row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet208"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet208"::: @@ -1358,7 +1358,7 @@ When setting this property, the row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1400,7 +1400,7 @@ - - For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). + For more information about cell style inheritance, see [Cell Styles in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/cell-styles-in-the-windows-forms-datagridview-control). ]]> @@ -1411,8 +1411,8 @@ - Cell Styles in the Windows Forms DataGridView Control - Best Practices for Scaling the Windows Forms DataGridView Control + Cell Styles in the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1475,7 +1475,7 @@ ]]> - Using the Row for New Records in the Windows Forms DataGridView Control + Using the Row for New Records in the Windows Forms DataGridView Control @@ -1526,7 +1526,7 @@ ## Examples - The following code example uses the property to set the minimum height of the second row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). + The following code example uses the property to set the minimum height of the second row. This code example is part of a larger code example provided in [How to: Manipulate Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-rows-in-the-windows-forms-datagridview-control). :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewRowDemo.cpp" id="Snippet207"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewRowDemo.cs" id="Snippet207"::: @@ -1538,7 +1538,7 @@ The specified value when setting this property is less than 2. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1604,7 +1604,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1803,7 +1803,7 @@ The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1863,7 +1863,7 @@ The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1910,7 +1910,7 @@ The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -1977,7 +1977,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2017,7 +2017,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2110,7 +2110,7 @@ The row is in a control and is a shared row. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml index 8c7dd8fa251..60a91cc2154 100644 --- a/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowCancelEventArgs.xml @@ -29,22 +29,22 @@ Provides data for the event of a . - event handler, set the property to `true`. - - For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). - + event handler, set the property to `true`. + + For more information about how to handle events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example illustrates the use of this type. This example is part of a larger example available in [How to: Implement Virtual Mode in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-implement-virtual-mode-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/CPP/virtualmode.cpp" id="Snippet180"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CancelRowEdit/virtualmode.cs" id="Snippet180"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.VirtualMode/VB/virtualmode.vb" id="Snippet180"::: + ]]> @@ -86,11 +86,11 @@ The row the user is deleting. Initializes a new instance of the class. - property. - + property. + ]]> @@ -135,15 +135,15 @@ Gets the row that the user is deleting. The row that the user deleted. - diff --git a/xml/System.Windows.Forms/DataGridViewRowCollection.xml b/xml/System.Windows.Forms/DataGridViewRowCollection.xml index f14fdd9f392..911321e0df6 100644 --- a/xml/System.Windows.Forms/DataGridViewRowCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewRowCollection.xml @@ -193,7 +193,7 @@ The row returned by the property has more cells than there are columns in the control. - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -491,7 +491,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2223,7 +2223,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -2452,7 +2452,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml index 05be5bedb51..14579288f06 100644 --- a/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowContextMenuStripNeededEventHandler.xml @@ -74,6 +74,6 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml index 537bcef1d74..e1869309e5c 100644 --- a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventArgs.xml @@ -65,7 +65,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml index 6f55edd6b6d..ce58f124a45 100644 --- a/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowErrorTextNeededEventHandler.xml @@ -66,6 +66,6 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml b/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml index c945869a54e..9a9a907add6 100644 --- a/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml +++ b/xml/System.Windows.Forms/DataGridViewRowHeadersWidthSizeMode.xml @@ -22,31 +22,31 @@ Defines values for specifying how the row header width is adjusted. - control can adjust the width of its row headers to fit all their contents, only the contents of the first header, or only the contents of currently displayed headers. Calculating the new width using a subset of headers is useful to avoid a performance penalty when working with many rows of data. - - This enumeration is used by the control property and method. - - For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). - - - -## Examples - The following code example illustrates the use of this enumeration in a display-only, non-interactive control. - + control can adjust the width of its row headers to fit all their contents, only the contents of the first header, or only the contents of currently displayed headers. Calculating the new width using a subset of headers is useful to avoid a performance penalty when working with many rows of data. + + This enumeration is used by the control property and method. + + For more information about sizing modes, see [Sizing Options in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/sizing-options-in-the-windows-forms-datagridview-control). + + + +## Examples + The following code example illustrates the use of this enumeration in a display-only, non-interactive control. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AllowUserToAddRows/form1.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewStyleDemo/VB/form1.vb" id="Snippet20"::: + ]]> - Sizing Options in the Windows Forms DataGridView Control + Sizing Options in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml index 3061a2b616c..b4425d60a76 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventArgs.xml @@ -29,23 +29,23 @@ Provides data for the event. - event occurs after a row is painted on a control. allows you to manually adjust the appearance of the row after the cells in the row are painted. This is useful if you want to customize the row. - - - -## Examples - The following code example demonstrates how to handle the event to make the content of a cell span the entire row. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + event occurs after a row is painted on a control. allows you to manually adjust the appearance of the row after the cells in the row are painted. This is useful if you want to customize the row. + + + +## Examples + The following code example demonstrates how to handle the event to make the content of a cell span the entire row. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]> - How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control + How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control @@ -103,14 +103,14 @@ Initializes a new instance of the class. To be added. - is . - - -or- - - is . - - -or- - + is . + + -or- + + is . + + -or- + is . @@ -156,21 +156,21 @@ Gets or sets the area of the that needs to be repainted. A that represents the area of the that needs to be repainted. - property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window and then uncovers it, then represents the entire . If a user covers a small area of the and then uncovers it, then represents the small area that was covered. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window and then uncovers it, then represents the entire . If a user covers a small area of the and then uncovers it, then represents the small area that was covered. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]> @@ -209,19 +209,19 @@ to use the property of the property to determine the color of the focus rectangle; to use the property of the property. Draws the focus rectangle around the specified bounds. - method when you draw the and its cells' contents yourself. - - - -## Examples - The following code example demonstrates how to use the method to draw a focus around the visible cells of the row. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + method when you draw the and its cells' contents yourself. + + + +## Examples + The following code example demonstrates how to use the method to draw a focus around the visible cells of the row. This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]> @@ -269,21 +269,21 @@ Gets a string that represents an error message for the current . A string that represents an error message for the current . - property is the same as the current row's property. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property is the same as the current row's property. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]> @@ -323,19 +323,19 @@ Gets the used to paint the current . The used to paint the current . - class provides properties and methods that are useful for custom drawing. - - - -## Examples - The following code example demonstrates how to use the property to paint a custom background. Although the code actually uses the property, this property is nearly identical to the property of . The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + class provides properties and methods that are useful for custom drawing. + + + +## Examples + The following code example demonstrates how to use the property to paint a custom background. Although the code actually uses the property, this property is nearly identical to the property of . The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]> @@ -375,21 +375,21 @@ Gets the cell style applied to the current . A that contains the cell style applied to the current . - property contains the same values as the current row's property. Directly accessing a in the can affect performance. Use in the event to avoid unsharing the row and maintain optimal performance. - - The property is read-only. Although you can set the properties of the retrieved through the property, the new settings will have no effect. - - - -## Examples - The following code example demonstrates how to use the to determine the color to use to draw the content. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property contains the same values as the current row's property. Directly accessing a in the can affect performance. Use in the event to avoid unsharing the row and maintain optimal performance. + + The property is read-only. Although you can set the properties of the retrieved through the property, the new settings will have no effect. + + + +## Examples + The following code example demonstrates how to use the to determine the color to use to draw the content. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet34"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: + ]]> @@ -397,7 +397,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -433,16 +433,16 @@ if the row being painted is currently the first row displayed in the ; otherwise, . - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]> @@ -481,16 +481,16 @@ if the current row is the last row in the that has the property set to ; otherwise, . - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet355"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet355"::: + ]]> @@ -718,19 +718,19 @@ Get the bounds of the current . A that represents the bounds of the current . - property is the same as the width of the . To get the width of the columns in the , use the method. - - - -## Examples - The following code example demonstrates how to use the property to determine the bounds of the visible cells in a row. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property is the same as the width of the . To get the width of the columns in the , use the method. + + + +## Examples + The following code example demonstrates how to use the property to determine the bounds of the visible cells in a row. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]> @@ -771,19 +771,19 @@ Gets the index of the current . The index of the current . - . - - - -## Examples - The following code example demonstrates how to use the property to access the current row. The code gets the value of the cell at the intersection of the selected row and the third column, and then paints this value over the entire row. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + . + + + +## Examples + The following code example demonstrates how to use the property to access the current row. The code gets the value of the cell at the intersection of the selected row and the third column, and then paints this value over the entire row. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet35"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: + ]]> @@ -822,19 +822,19 @@ Gets the state of the current . A bitwise combination of values that specifies the state of the row. - property to determine whether the current row is selected. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property to determine whether the current row is selected. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet34"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet34"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml index ccd14407b6e..69f1d8b19b4 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPostPaintEventHandler.xml @@ -39,23 +39,23 @@ A that contains the event data. Represents the method that will handle the event of a . - delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example presents a delegate that paints textual content that spans the entire row below the normal cell values. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example presents a delegate that paints textual content that spans the entire row below the normal cell values. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]> - How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control + How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml index 4afb1ab8383..e9d931e6e62 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventArgs.xml @@ -29,19 +29,19 @@ Provides data for the event. - event occurs before a row is painted on a control. enables you to manually adjust the appearance of the row before any of the cells in the row are painted. This is useful if you want to customize the row, such as to produce a row where the content of one column spans multiple columns. Use the properties in to get the settings of the row without directly accessing the row in the . - - - -## Examples - The following code example demonstrates how to handle the event to draw a custom background for selected cells. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + event occurs before a row is painted on a control. enables you to manually adjust the appearance of the row before any of the cells in the row are painted. This is useful if you want to customize the row, such as to produce a row where the content of one column spans multiple columns. Use the properties in to get the settings of the row without directly accessing the row in the . + + + +## Examples + The following code example demonstrates how to handle the event to draw a custom background for selected cells. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]> @@ -103,14 +103,14 @@ Initializes a new instance of the class. To be added. - is . - - -or- - - is . - - -or- - + is . + + -or- + + is . + + -or- + is . @@ -156,21 +156,21 @@ Gets or sets the area of the that needs to be repainted. A that represents the area of the that needs to be repainted. - property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window and then uncovers it, then represents the entire . If a user covers a small area of the and then uncovers it, then represents the small area that was covered. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property represents the area of the that needs to be repainted. For example, if a user covers the entire with another window and then uncovers it, then represents the entire . If a user covers a small area of the and then uncovers it, then represents the small area that was covered. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]> @@ -209,19 +209,19 @@ to use the property of the property to determine the color of the focus rectangle; to use the property of the . Draws the focus rectangle around the specified bounds. - method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. - - - -## Examples - The following code example demonstrates how to use the method to draw a focus around the visible cells of the row. The code actually uses the method, which is nearly identical to the method of . This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. + + + +## Examples + The following code example demonstrates how to use the method to draw a focus around the visible cells of the row. The code actually uses the method, which is nearly identical to the method of . This example is part of a larger example available in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet30"::: + ]]> @@ -270,21 +270,21 @@ Gets a string that represents an error message for the current . A string that represents an error message for the current . - property is the same as the current row's property. - - - -## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. - + property is the same as the current row's property. + + + +## 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 type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]> @@ -324,19 +324,19 @@ Gets the used to paint the current . The used to paint the current . - class provides properties and methods that are useful for custom drawing. - - - -## Examples - The following code example demonstrates how to use the property to paint the custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + class provides properties and methods that are useful for custom drawing. + + + +## Examples + The following code example demonstrates how to use the property to paint the custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]> @@ -376,21 +376,21 @@ Gets the cell style applied to the row. A that contains the cell style currently applied to the row. - property contains the same values as the row's property. Directly accessing a in the can affect performance. Use in the event to avoid unsharing the row and maintain optimal performance. - - The property is read-only. Although you can set the properties of the retrieved through the property, the new settings will have no effect. - - - -## Examples - The following code example demonstrates how to use the property to paint a custom background for the selected row. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property contains the same values as the row's property. Directly accessing a in the can affect performance. Use in the event to avoid unsharing the row and maintain optimal performance. + + The property is read-only. Although you can set the properties of the retrieved through the property, the new settings will have no effect. + + + +## Examples + The following code example demonstrates how to use the property to paint a custom background for the selected row. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]> @@ -398,7 +398,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control @@ -434,16 +434,16 @@ if the row being painted is currently the first row displayed in the ; otherwise, . - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]> @@ -482,16 +482,16 @@ if the row being painted is currently the last row in the that has the property set to ; otherwise, . - 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 type named `DataGridView1`. Then 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 run the example code, paste it into a project that contains an instance of type named `DataGridView1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet356"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet356"::: + ]]> @@ -565,11 +565,11 @@ to paint the background of the specified bounds with the color of the property of the ; to paint the background of the specified bounds with the color of the property of the . Paints the cell backgrounds for the area in the specified bounds. - method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. - + method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. + ]]> @@ -654,11 +654,11 @@ to paint the row header with the color of the property of the ; to paint the row header with the of the property. Paints the entire row header of the current . - method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. - + method when you draw the and its cells' contents yourself. If you manually paint the entire row and its cells' contents, set the property to `true`. When is `true`, the and events do not occur. + ]]> @@ -735,14 +735,14 @@ The cell parts that are to be painted. A bitwise combination of values specifying the parts to be painted. - The specified value when setting this property is not a valid bitwise combination of values. @@ -781,19 +781,19 @@ Get the bounds of the current . A that represents the bounds of the current . - property is the same as the width of the . To get the width of the columns in the , use the method. - - - -## Examples - The following code example demonstrates how to use the property to calculate the bounds of the row to paint a custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property is the same as the width of the . To get the width of the columns in the , use the method. + + + +## Examples + The following code example demonstrates how to use the property to calculate the bounds of the row to paint a custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]> @@ -834,19 +834,19 @@ Gets the index of the current . The index of the current . - . - - - -## Examples - The following code example demonstrates how to use the property to access the current row. Although the code actually uses the property, this property is nearly identical to the property of . The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + . + + + +## Examples + The following code example demonstrates how to use the property to access the current row. Although the code actually uses the property, this property is nearly identical to the property of . The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet35"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet35"::: + ]]> @@ -885,19 +885,19 @@ Gets the state of the current . A bitwise combination of the values that specifies the state of the row. - property to determine whether a row is selected. If the row is selected, the code paints a custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + property to determine whether a row is selected. If the row is selected, the code paints a custom background. The variable, `e`, is of type . This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet25"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet25"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml index 46b48c87ac7..528e9ce535e 100644 --- a/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewRowPrePaintEventHandler.xml @@ -39,23 +39,23 @@ A that contains the event data. Represents the method that will handle the event of a . - delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example presents a delegate that paints a gradient row background if the row is selected. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). - + delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example presents a delegate that paints a gradient row background if the row is selected. This code example is part of a larger example provided in [How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/customize-the-appearance-of-rows-in-the-datagrid). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/ColumnWidthChanged/datagridviewrowpainting.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewRowPainting/VB/datagridviewrowpainting.vb" id="Snippet20"::: + ]]> - How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control + How to: Customize the Appearance of Rows in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml b/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml index 46cb9420368..fe1e8e65b94 100644 --- a/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml +++ b/xml/System.Windows.Forms/DataGridViewSelectedColumnCollection.xml @@ -56,7 +56,7 @@ - Best Practices for Scaling the Windows Forms DataGridView Control + Best Practices for Scaling the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewSelectionMode.xml b/xml/System.Windows.Forms/DataGridViewSelectionMode.xml index a8d657ea52d..6652e662baa 100644 --- a/xml/System.Windows.Forms/DataGridViewSelectionMode.xml +++ b/xml/System.Windows.Forms/DataGridViewSelectionMode.xml @@ -22,19 +22,19 @@ Describes how cells of a DataGridView control can be selected. - property of a control. - - - -## Examples - The following code example illustrates the use of this type. For more information, see [How to: Set the Selection Mode of the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-set-the-selection-mode-of-the-windows-forms-datagridview-control). - + property of a control. + + + +## Examples + The following code example illustrates the use of this type. For more information, see [How to: Set the Selection Mode of the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-set-the-selection-mode-of-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet065"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet065"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet065"::: + ]]> diff --git a/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml b/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml index 257e26f0bd7..bf0ddd90d33 100644 --- a/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml +++ b/xml/System.Windows.Forms/DataGridViewSortCompareEventArgs.xml @@ -29,21 +29,21 @@ Provides data for the event. - event to provide custom sorting. This event occurs only when the property is not set and the property is set to `false`. This event occurs once for each pair of cells in the column being sorted. It occurs only when the user clicks the header of a column with a property value of , or when you call the overload. When this event occurs for a column with a property value of , you must display the sorting glyph yourself through the property. - - You can use this event to sort rows using the cell values in one column or in multiple columns. Use the and properties to compare cell values in the column specified in the property. Use the and properties to access values in other columns through the collection. - - - -## Examples - The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + event to provide custom sorting. This event occurs only when the property is not set and the property is set to `false`. This event occurs once for each pair of cells in the column being sorted. It occurs only when the user clicks the header of a column with a property value of , or when you call the overload. When this event occurs for a column with a property value of , you must display the sorting glyph yourself through the property. + + You can use this event to sort rows using the cell values in one column or in multiple columns. Use the and properties to compare cell values in the column specified in the property. Use the and properties to access values in other columns through the collection. + + + +## Examples + The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> @@ -58,7 +58,7 @@ - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -113,7 +113,7 @@ - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -149,19 +149,19 @@ Gets the value of the first cell to compare. The value of the first cell. - property. - - - -## Examples - The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + property. + + + +## Examples + The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> @@ -170,7 +170,7 @@ - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -206,19 +206,19 @@ Gets the value of the second cell to compare. The value of the second cell. - property. - - - -## Examples - The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + property. + + + +## Examples + The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> @@ -227,7 +227,7 @@ - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -266,25 +266,25 @@ Gets the column being sorted. The to sort. - in a multiple column sort. In this example the ID column is used to determine the final order if there are identical values in the sorted column, so no additional sorting will be done if there are duplicate values in the ID column. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + in a multiple column sort. In this example the ID column is used to determine the final order if there are identical values in the sorted column, so no additional sorting will be done if there are duplicate values in the ID column. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -319,26 +319,26 @@ Gets the index of the row containing the first cell to compare. The index of the row containing the second cell. - in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -373,26 +373,26 @@ Gets the index of the row containing the second cell to compare. The index of the row containing the second cell. - in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control @@ -431,25 +431,25 @@ Gets or sets a value indicating the order in which the compared cells will be sorted. Less than zero if the first cell will be sorted before the second cell; zero if the first cell and second cell have equivalent values; greater than zero if the second cell will be sorted before the first cell. - event. You will typically set this value to the return value of a comparison method such as . - - - -## Examples - The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + event. You will typically set this value to the return value of a comparison method such as . + + + +## Examples + The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml b/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml index ee902ce3b9b..2ffcdce151f 100644 --- a/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml +++ b/xml/System.Windows.Forms/DataGridViewSortCompareEventHandler.xml @@ -39,24 +39,24 @@ A that contains the event data. Represents the method that will handle the event of a control. - delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). - + delegate, you identify the method that will handle the event. To associate the event with your event handler, add an instance of the delegate to the event. The event handler is called whenever the event occurs, unless you remove the delegate. For more information about event-handler delegates, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates the use of in a multiple column sort. This example is part of a larger example provided in [How to: Customize Sorting in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-customize-sorting-in-the-windows-forms-datagridview-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/SortCompare/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.SortCompare/VB/form1.vb" id="Snippet10"::: + ]]> - How to: Customize Sorting in the Windows Forms DataGridView Control + How to: Customize Sorting in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml b/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml index 57293940b84..1c5301396b2 100644 --- a/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml +++ b/xml/System.Windows.Forms/DataGridViewTextBoxCell.xml @@ -481,14 +481,14 @@ For additional information, see [What's New in Accessibility in the .NET Framewo ## Remarks When the property of the control is set to or , the control uses this method to determine whether a key other than F2 that is pressed by the user while this cell has focus will cause the cell to enter edit mode. - This method returns `true` if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). + This method returns `true` if the e parameter indicates an ordinary data-entry key (such as a letter, number, punctuation mark, or the SPACE key) unmodified by ALT or CTRL, excluding SHIFT+SPACE, which is used by the control for selection purposes. For more information, see [Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/default-keyboard-and-mouse-handling-in-the-windows-forms-datagridview-control). ]]> - Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control + Default Keyboard and Mouse Handling in the Windows Forms DataGridView Control diff --git a/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml b/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml index 517c2d3dcc0..467944c11c8 100644 --- a/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml +++ b/xml/System.Windows.Forms/DataGridViewTextBoxColumn.xml @@ -37,21 +37,21 @@ Hosts a collection of cells. - class is a specialized type of class used to logically host cells that enable displaying and editing of text strings. A has an associated object in every that intersects it. When a becomes activated, it supplies a control to handle user input. - - The sort mode for this column type defaults to . - - - -## Examples - The following code example illustrates the use of this type. - + class is a specialized type of class used to logically host cells that enable displaying and editing of text strings. A has an associated object in every that intersects it. When a becomes activated, it supplies a control to handle user input. + + The sort mode for this column type defaults to . + + + +## Examples + The following code example illustrates the use of this type. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridViewAutoSizeColumnMode/Overview/sizingscenarios.cs" id="Snippet20"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet20"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewSizingScenarios/vb/sizingscenarios.vb" id="Snippet20"::: + ]]> @@ -87,16 +87,16 @@ Initializes a new instance of the class to the default state. - |A newly created .| -||| - + |A newly created .| +||| + ]]> @@ -146,23 +146,23 @@ Gets or sets the template used to model cell appearance. A that all other cells in the column are modeled after. - class initializes this property to a newly created . - + class initializes this property to a newly created . + > [!CAUTION] -> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). - - - -## Examples - The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/framework/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). - +> Changing the properties of the cell template will not immediately affect the user interface (UI) of the column's existing cells. These changes are only apparent after the column is regenerated (for example, by sorting the column or through a call to the method). + + + +## Examples + The following code example demonstrates the use of the property, which is similar to this property. This example is part of a larger example available in [How to: Manipulate Columns in the Windows Forms DataGridView Control](/dotnet/desktop/winforms/controls/how-to-manipulate-columns-in-the-windows-forms-datagridview-control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/CPP/DataGridViewColumnDemo.cpp" id="Snippet120"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/AutoResizeColumn/DataGridViewColumnDemo.cs" id="Snippet120"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridView.ButtonDemos/VB/datagridviewcolumndemo.vb" id="Snippet120"::: + ]]> The set type is not compatible with type . @@ -217,13 +217,13 @@ Gets or sets the maximum number of characters that can be entered into the text box. The maximum number of characters that can be entered into the text box; the default value is 32767. - property does not affect the length of text entered programmatically through the cell's value or through cell formatting. It affects only what the user can input and edit. - - Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. - + property does not affect the length of text entered programmatically through the cell's value or through cell formatting. It affects only what the user can input and edit. + + Getting or setting this property gets or sets the property of the object returned by the property. Setting this property also sets the property of every cell in the column. To override the specified value for individual cells, set the cell values after you set the column value. + ]]> The value of the property is . @@ -265,27 +265,27 @@ Gets or sets the sort mode for the column. A that specifies the criteria used to order the rows based on the cell values in a column. - control is sorted using a column with a property value of , a sorting glyph is automatically displayed in the column header. - - When the control is sorted using a column with a property value of , you must display the sorting glyph yourself through the property. - - The default sort mode of a is . The default sort mode for other column types is . - - The value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the method. - - A property value of will not prevent the event from occurring, but it will prevent the header from changing its appearance when it is clicked. - - - -## Examples - The following code example illustrates the use of this property. - + control is sorted using a column with a property value of , a sorting glyph is automatically displayed in the column header. + + When the control is sorted using a column with a property value of , you must display the sorting glyph yourself through the property. + + The default sort mode of a is . The default sort mode for other column types is . + + The value does not prevent you from sorting a column programmatically, although other restrictions may apply. For more information, see the method. + + A property value of will not prevent the event from occurring, but it will prevent the header from changing its appearance when it is clicked. + + + +## Examples + The following code example illustrates the use of this property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/CellBeginEdit/datagridviewmisc.cs" id="Snippet066"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewMisc/VB/datagridviewmisc.vb" id="Snippet066"::: + ]]> diff --git a/xml/System.Windows.Forms/DateTimePicker.xml b/xml/System.Windows.Forms/DateTimePicker.xml index f2b685455e9..52f6d3f0b5c 100644 --- a/xml/System.Windows.Forms/DateTimePicker.xml +++ b/xml/System.Windows.Forms/DateTimePicker.xml @@ -62,46 +62,46 @@ Represents a Windows control that allows the user to select a date and a time and to display the date and time with a specified format. - control is used to allow the user to select a date and time, and to display that date and time in the specified format. The control makes it easy to work with dates and times because it handles a lot of the data validation automatically. - + control is used to allow the user to select a date and time, and to display that date and time in the specified format. The control makes it easy to work with dates and times because it handles a lot of the data validation automatically. + > [!NOTE] -> The control only supports Gregorian calendars. - - When used to represent a date, the control appears in two parts: a drop-down list with a date represented in text, and a calendar that appears when you click the down-arrow next to the list. The calendar looks like the control, which can be used for selecting multiple dates. For more information about the control, see [MonthCalendar Control Overview](/dotnet/framework/winforms/controls/monthcalendar-control-overview-windows-forms). - - You can change the look of the calendar portion of the control by setting the , , , , , and properties. - - To use a spin button control (also known as an up-down control) to adjust the date/time value, set the property to `true`. The calendar will not drop down when the control is selected. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. - - The property contains the current date and time the control is set to. You can use the property or the appropriate member of to get the date and time value. For more information, see [How to: Set and Return Dates with the Windows Forms DateTimePicker Control](/dotnet/framework/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control). You can limit the dates and times that can be selected by setting the and properties. - - The values can be displayed in four formats, which are set by the property: , , , or . The default date is . - - If you want the to appear as a control for picking or editing times instead of dates, set the property to `true` and the property to . For more information, see [How to: Display Time with the DateTimePicker Control](/dotnet/framework/winforms/controls/how-to-display-time-with-the-datetimepicker-control). - - If the property is set to , you can create your own format style by setting the property and building a custom format string. The custom format string can be a combination of custom field characters and other literal characters. For example, you can display the date as "June 01, 2012 - Friday" by setting the property to "MMMM dd, yyyy - dddd". For more information, see [How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control](/dotnet/framework/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). - +> The control only supports Gregorian calendars. + + When used to represent a date, the control appears in two parts: a drop-down list with a date represented in text, and a calendar that appears when you click the down-arrow next to the list. The calendar looks like the control, which can be used for selecting multiple dates. For more information about the control, see [MonthCalendar Control Overview](/dotnet/desktop/winforms/controls/monthcalendar-control-overview-windows-forms). + + You can change the look of the calendar portion of the control by setting the , , , , , and properties. + + To use a spin button control (also known as an up-down control) to adjust the date/time value, set the property to `true`. The calendar will not drop down when the control is selected. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. + + The property contains the current date and time the control is set to. You can use the property or the appropriate member of to get the date and time value. For more information, see [How to: Set and Return Dates with the Windows Forms DateTimePicker Control](/dotnet/desktop/winforms/controls/how-to-set-and-return-dates-with-the-windows-forms-datetimepicker-control). You can limit the dates and times that can be selected by setting the and properties. + + The values can be displayed in four formats, which are set by the property: , , , or . The default date is . + + If you want the to appear as a control for picking or editing times instead of dates, set the property to `true` and the property to . For more information, see [How to: Display Time with the DateTimePicker Control](/dotnet/desktop/winforms/controls/how-to-display-time-with-the-datetimepicker-control). + + If the property is set to , you can create your own format style by setting the property and building a custom format string. The custom format string can be a combination of custom field characters and other literal characters. For example, you can display the date as "June 01, 2012 - Friday" by setting the property to "MMMM dd, yyyy - dddd". For more information, see [How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control](/dotnet/desktop/winforms/controls/display-a-date-in-a-custom-format-with-wf-datetimepicker-control) and [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). + > [!CAUTION] -> When a is data-bound and the backing value is changed to `null`, the value of the will not be updated and the previous value will be retained. In situations where this behavior is not desirable (for example, when using a set of data-bound controls to page through a recordset) use the event of the class to set the to a value recognizable as a `null`. - - - -## Examples - The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control. To run this example, paste the following code into a form and call the `CreateMyDateTimePicker` method in the example form's constructor or event handling method. - +> When a is data-bound and the backing value is changed to `null`, the value of the will not be updated and the previous value will be retained. In situations where this behavior is not desirable (for example, when using a set of data-bound controls to page through a recordset) use the event of the class to set the to a value recognizable as a `null`. + + + +## Examples + The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control. To run this example, paste the following code into a form and call the `CreateMyDateTimePicker` method in the example form's constructor or event handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> - How to: Set and Return Dates with the Windows Forms DateTimePicker Control - How to: Display Time with the DateTimePicker Control - How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control + How to: Set and Return Dates with the Windows Forms DateTimePicker Control + How to: Display Time with the DateTimePicker Control + How to: Display a Date in a Custom Format with the Windows Forms DateTimePicker Control Custom Date and Time Format Strings @@ -128,15 +128,15 @@ Initializes a new instance of the class. - control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). - + control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -178,11 +178,11 @@ Gets or sets a value indicating the background color of the control. The background of the . - has no effect on the appearance of the . To set the background color for the drop-down calendar of the , see the property. - + has no effect on the appearance of the . To set the background color for the drop-down calendar of the , see the property. + ]]> @@ -267,11 +267,11 @@ Gets or sets the background image for the control. The background image for the control. - @@ -351,11 +351,11 @@ Gets or sets the layout of the background image of the control. One of the values. - property has no effect on the appearance of the control. - + property has no effect on the appearance of the control. + ]]> @@ -439,20 +439,20 @@ Gets or sets the font style applied to the calendar. A that represents the font style applied to the calendar. - property. This example creates a new control, adds it to the collection of a , and then initializes the property to a dynamically defined . - + property. This example creates a new control, adds it to the collection of a , and then initializes the property to a dynamically defined . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarFont/CPP/calendarfont.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarFont/calendarfont.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarFont/VB/calendarfont.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarFont/VB/calendarfont.vb" id="Snippet1"::: + ]]> @@ -490,22 +490,22 @@ Gets or sets the foreground color of the calendar. A that represents the foreground color of the calendar. - is created, this property is initially set equal to the property value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - - - -## Examples - The following code example demonstrates how to initialize the property. This example creates a new , adds it to the collection, and then initializes its property to the constant. - + is created, this property is initially set equal to the property value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + + + +## Examples + The following code example demonstrates how to initialize the property. This example creates a new , adds it to the collection, and then initializes its property to the constant. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/CPP/calendarforecolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarForeColor/calendarforecolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/VB/calendarforecolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarForeColor/VB/calendarforecolor.vb" id="Snippet1"::: + ]]> The value assigned is . @@ -545,22 +545,22 @@ Gets or sets the background color of the calendar month. A that represents the background color of the calendar month. - is created, this property is initially set equal to the field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - - - -## Examples - The following code example demonstrates how to initialize the property. After creating a and adding it to a , the example initializes the property to a constant. - + is created, this property is initially set equal to the field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + + + +## Examples + The following code example demonstrates how to initialize the property. After creating a and adding it to a , the example initializes the property to a constant. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/CPP/calendarmonthbackground.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CalendarMonthBackground/calendarmonthbackground.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/VB/calendarmonthbackground.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.CalendarMonthBackground/VB/calendarmonthbackground.vb" id="Snippet1"::: + ]]> The value assigned is . @@ -600,13 +600,13 @@ Gets or sets the background color of the calendar title. A that represents the background color of the calendar title. - is created, this property is initially set equal to the field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + is created, this property is initially set equal to the field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]> The value assigned is . @@ -646,13 +646,13 @@ Gets or sets the foreground color of the calendar title. A that represents the foreground color of the calendar title. - is created, this property is initially set equal to the field value. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + is created, this property is initially set equal to the field value. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]> The value assigned is . @@ -692,15 +692,15 @@ Gets or sets the foreground color of the calendar trailing dates. A that represents the foreground color of the calendar trailing dates. - is created, this property is initially set equal to the field value. - - The trailing dates are the ending dates from the previous month or the beginning dates from the next month used to fill the calendar. - - Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. - + is created, this property is initially set equal to the field value. + + The trailing dates are the ending dates from the previous month or the beginning dates from the next month used to fill the calendar. + + Starting with Windows Vista and depending on the theme, setting this property might not change the appearance of the calendar. For example, if Windows is set to use the Aero theme, setting this property has no effect. This is because an updated version of the calendar is rendered with an appearance that is derived at run time from the current operating system theme. If you want to use this property and enable the earlier version of the calendar, you can disable visual styles for your application. Disabling visual styles might affect the appearance and behavior of other controls in your application. To disable visual styles in Visual Basic, open the Project Designer and uncheck the **Enable XP visual styles** check box. To disable visual styles in C#, open Program.cs and comment out `Application.EnableVisualStyles();`. + ]]> The value assigned is . @@ -745,11 +745,11 @@ if the property has been set with a valid value and the displayed value is able to be updated; otherwise, . The default is . - property value is `true`. If the property value is `true`, the control displays the properly formatted property value; otherwise, the control displays the last valid date/time value assigned to the property or the current date and time () if no value has ever been assigned. - + property value is `true`. If the property value is `true`, the control displays the properly formatted property value; otherwise, the control displays the last valid date/time value assigned to the property or the current date and time () if no value has ever been assigned. + ]]> @@ -792,11 +792,11 @@ Occurs when the control is clicked. - @@ -828,21 +828,21 @@ Occurs when the drop-down calendar is dismissed and disappears. - 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 type named `DateTimePicker1`. Then 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 type named `DateTimePicker1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet376"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet376"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet376"::: + ]]> @@ -876,14 +876,14 @@ 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. - +> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -1007,51 +1007,51 @@ Gets or sets the custom date/time format string. A string that represents the custom date/time format. The default is . - property to "MMMM dd 'at' t:mm tt". If the "at" substring is not enclosed by escape characters, the result is "June 15 aP 12:00PM" because the "t" character is read as the one-letter A.M./P.M. format string (see the format string table below). - - The format strings can be combined to format the date and time. For example, to display the date and time as 06/15/2001 12:00 PM, this property should be set to "MM'/'dd'/'yyyy hh':'mm tt". For more information, see [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). - + property to "MMMM dd 'at' t:mm tt". If the "at" substring is not enclosed by escape characters, the result is "June 15 aP 12:00PM" because the "t" character is read as the one-letter A.M./P.M. format string (see the format string table below). + + The format strings can be combined to format the date and time. For example, to display the date and time as 06/15/2001 12:00 PM, this property should be set to "MM'/'dd'/'yyyy hh':'mm tt". For more information, see [Custom Date and Time Format Strings](/dotnet/standard/base-types/custom-date-and-time-format-strings). + > [!NOTE] -> The property must be set to for this property to affect the formatting of the displayed date and time. - - The following table lists all the valid format strings and their descriptions. - -|Format string|Description| -|-------------------|-----------------| -|d|The one- or two-digit day.| -|dd|The two-digit day. Single-digit day values are preceded by a 0.| -|ddd|The three-character day-of-week abbreviation.| -|dddd|The full day-of-week name.| -|h|The one- or two-digit hour in 12-hour format.| -|hh|The two-digit hour in 12-hour format. Single digit values are preceded by a 0.| -|H|The one- or two-digit hour in 24-hour format.| -|HH|The two-digit hour in 24-hour format. Single digit values are preceded by a 0.| -|m|The one- or two-digit minute.| -|mm|The two-digit minute. Single digit values are preceded by a 0.| -|M|The one- or two-digit month number.| -|MM|The two-digit month number. Single digit values are preceded by a 0.| -|MMM|The three-character month abbreviation.| -|MMMM|The full month name.| -|s|The one- or two-digit seconds.| -|ss|The two-digit seconds. Single digit values are preceded by a 0.| -|t|The one-letter A.M./P.M. abbreviation (A.M. is displayed as "A").| -|tt|The two-letter A.M./P.M. abbreviation (A.M. is displayed as "AM").| -|y|The one-digit year (2001 is displayed as "1").| -|yy|The last two digits of the year (2001 is displayed as "01").| -|yyyy|The full year (2001 is displayed as "2001").| - - - -## Examples - The following code example sets the property so that the will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a control has been created on a . - +> The property must be set to for this property to affect the formatting of the displayed date and time. + + The following table lists all the valid format strings and their descriptions. + +|Format string|Description| +|-------------------|-----------------| +|d|The one- or two-digit day.| +|dd|The two-digit day. Single-digit day values are preceded by a 0.| +|ddd|The three-character day-of-week abbreviation.| +|dddd|The full day-of-week name.| +|h|The one- or two-digit hour in 12-hour format.| +|hh|The two-digit hour in 12-hour format. Single digit values are preceded by a 0.| +|H|The one- or two-digit hour in 24-hour format.| +|HH|The two-digit hour in 24-hour format. Single digit values are preceded by a 0.| +|m|The one- or two-digit minute.| +|mm|The two-digit minute. Single digit values are preceded by a 0.| +|M|The one- or two-digit month number.| +|MM|The two-digit month number. Single digit values are preceded by a 0.| +|MMM|The three-character month abbreviation.| +|MMMM|The full month name.| +|s|The one- or two-digit seconds.| +|ss|The two-digit seconds. Single digit values are preceded by a 0.| +|t|The one-letter A.M./P.M. abbreviation (A.M. is displayed as "A").| +|tt|The two-letter A.M./P.M. abbreviation (A.M. is displayed as "AM").| +|y|The one-digit year (2001 is displayed as "1").| +|yy|The last two digits of the year (2001 is displayed as "01").| +|yyyy|The full year (2001 is displayed as "2001").| + + + +## Examples + The following code example sets the property so that the will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a control has been created on a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CustomFormat/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1288,11 +1288,11 @@ if the control should redraw its surface using a secondary buffer; otherwise, . - property has no effect on the control. - + property has no effect on the control. + ]]> @@ -1333,11 +1333,11 @@ Occurs when the control is double-clicked. - @@ -1369,20 +1369,20 @@ Occurs when the drop-down calendar is shown. - event of a and using the and fields. To run this example paste the following code in a form that contains a named `DateTimePicker1`. - + event of a and using the and fields. To run this example paste the following code in a form that contains a named `DateTimePicker1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: + ]]> @@ -1425,20 +1425,20 @@ Gets or sets the alignment of the drop-down calendar on the control. The alignment of the drop-down calendar on the control. The default is . - by setting the , , , and properties. To run this example, paste the following code into a form and call `InitializeDateTimePicker` from the form's constructor or event-handling method. - + by setting the , , , and properties. To run this example, paste the following code into a form and call `InitializeDateTimePicker` from the form's constructor or event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet1"::: + ]]> The value assigned is not one of the values. @@ -1482,13 +1482,13 @@ Gets or sets the foreground color of the control. The foreground of the . - property has no effect on the appearance of the control. - - To set the foreground color for the drop-down calendar of the , see the property. - + property has no effect on the appearance of the control. + + To set the foreground color for the drop-down calendar of the , see the property. + ]]> @@ -1533,13 +1533,13 @@ Occurs when the value of the property changes. - property is changed either by a programmatic modification or through interaction. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - + property is changed either by a programmatic modification or through interaction. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + ]]> @@ -1585,25 +1585,25 @@ Gets or sets the format of the date and time displayed in the control. One of the values. The default is . - [!NOTE] -> The property must be set to for the property to affect the formatting of the displayed date and time. - - To display only time in a , set the to , and the property to `true`. - - - -## Examples - The following code example sets the property so that the will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a control has been created on a . - +> The property must be set to for the property to affect the formatting of the displayed date and time. + + To display only time in a , set the to , and the property to `true`. + + + +## Examples + The following code example sets the property so that the will display the date as "June 01, 2001 - Friday". This code assumes that an instance of a control has been created on a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/CustomFormat/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker.CustomFormat Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned is not one of the values. @@ -1637,21 +1637,21 @@ Occurs when the property value has changed. - 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 type named `DateTimePicker1`. Then 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 type named `DateTimePicker1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet374"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet374"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet374"::: + ]]> @@ -1689,11 +1689,11 @@ if the specified key is a regular input key; otherwise, . - @@ -1726,15 +1726,15 @@ Gets or sets the maximum date and time that can be selected in the control. The maximum date and time that can be selected in the control. The default is the earlier of `December 31st 9998 12 am` and the property of the current culture's `Calendar`. - control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). - + control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1784,19 +1784,19 @@ The value assigned is greater than the control. This field is read-only. - event of a and using the and fields. To run this example, paste the following code into a form that contains a named `DateTimePicker1`. - +## Examples + The following code example demonstrates handling the event of a and using the and fields. To run this example, paste the following code into a form that contains a named `DateTimePicker1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/DropDown/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DateTimePicker/VB/form1.vb" id="Snippet2"::: + ]]> @@ -1830,12 +1830,12 @@ The maximum date is set to 12/31/9998 23:59:59. Gets the maximum date value allowed for the control. The maximum date value for the control. - @@ -1867,22 +1867,22 @@ The maximum date is set to December 31, 9998. Gets or sets the minimum date and time that can be selected in the control. The minimum date and time that can be selected in the control. The default is `1/1/1753 00:00:00`. - control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). - + control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned is greater than the value. -or- - + The value assigned is less than the value. @@ -1925,11 +1925,11 @@ The value assigned is less than the control. - @@ -1960,11 +1960,11 @@ The value assigned is less than the control. The minimum date value for the control. - @@ -2005,11 +2005,11 @@ The value assigned is less than the @@ -2050,11 +2050,11 @@ The value assigned is less than the @@ -2089,15 +2089,15 @@ The value assigned is less than the An that contains the event data. Raises the event. - event occurs when the drop-down calendar is dismissed and disappears. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event occurs when the drop-down calendar is dismissed and disappears. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -2136,15 +2136,15 @@ The value assigned is less than the An that contains the event data. Raises the event. - event occurs when the drop-down calendar is shown. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event occurs when the drop-down calendar is shown. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -2211,13 +2211,13 @@ The value assigned is less than the 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. + ]]> @@ -2255,15 +2255,15 @@ The value assigned is less than the An that contains the event data. Raises the event. - event occurs when the property value has changed. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event occurs when the property value has changed. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -2329,13 +2329,13 @@ The value assigned is less than the 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. + ]]> @@ -2372,13 +2372,13 @@ The value assigned is less than the 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. + ]]> @@ -2421,13 +2421,13 @@ The value assigned is less than the 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. + ]]> @@ -2497,15 +2497,15 @@ The value assigned is less than the An that contains the event data. Raises the event. - event occurs when the value for the control changes. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event occurs when the value for the control changes. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -2559,11 +2559,11 @@ The value assigned is less than the in all cases. - property has no effect on the control. - + property has no effect on the control. + ]]> @@ -2604,11 +2604,11 @@ The value assigned is less than the property changes. - @@ -2693,11 +2693,11 @@ The value assigned is less than the control. The preferred height, in pixels, of the control. - applied. - + applied. + ]]> @@ -2743,11 +2743,11 @@ The value assigned is less than the if the layout of the contents is from right to left; otherwise, . The default is . - property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. - + property is used for international applications where the language is written from right to left, such as Hebrew or Arabic. + ]]> @@ -2778,21 +2778,21 @@ The value assigned is less than 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 type named `DateTimePicker1`. Then 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 type named `DateTimePicker1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet377"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet377"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet377"::: + ]]> @@ -2867,20 +2867,20 @@ The value assigned is less than the if a check box is displayed to the left of the selected date; otherwise, . The default is . - property is set to `true`, a check box is displayed to the left of the date in the control. When the check box is selected, the date/time value can be updated. When the check box is cleared, the date/time value is unable to be changed. - - - -## Examples - The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). - + property is set to `true`, a check box is displayed to the left of the date in the control. When the check box is selected, the date/time value can be updated. When the check box is cleared, the date/time value is unable to be changed. + + + +## Examples + The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control (also known as an up-down control). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2919,22 +2919,22 @@ The value assigned is less than the if a spin button control is used to adjust the date/time value; otherwise, . The default is . - property is set to `true`, a spin button control (also known as an up-down control), rather than a drop-down calendar, is used to adjust time values. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. - - To display only time in a , set the property to , and the property to `true`. - - - -## Examples - The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control. - + property is set to `true`, a spin button control (also known as an up-down control), rather than a drop-down calendar, is used to adjust time values. The date and time can be adjusted by selecting each element individually and using the up and down buttons to change the value. + + To display only time in a , set the property to , and the property to `true`. + + + +## Examples + The following code example creates an new instance of a control and initializes it. The control's property is set. Also, the property is set so that the control displays a , and the property is set so that the control is displayed as a spin button control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic DateTimePicker Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic DateTimePicker Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -2989,13 +2989,13 @@ The value assigned is less than the property with the appropriate formatting or custom formatting applied. For example, if the property is set to 06/01/2001 12:00:00 AM while the property is set to "dddd, MMMM dd, yyyy", the property value is "Friday, June 01, 2001". - - When setting this property, the string must be convertible to an instance of the class. It is possible to define a custom format that results in a string that cannot be converted to a valid value. Because of this, the string returned from the property might cause an error if it is passed back to the property. If the string cannot be converted to a date/time value, the class throws a . - + property with the appropriate formatting or custom formatting applied. For example, if the property is set to 06/01/2001 12:00:00 AM while the property is set to "dddd, MMMM dd, yyyy", the property value is "Friday, June 01, 2001". + + When setting this property, the string must be convertible to an instance of the class. It is possible to define a custom format that results in a string that cannot be converted to a valid value. Because of this, the string returned from the property might cause an error if it is passed back to the property. If the string cannot be converted to a date/time value, the class throws a . + ]]> @@ -3112,20 +3112,20 @@ The value assigned is less than the value assign to the control. - property has not been changed in code or by the user, it is set to the current date and time (). - - - -## Examples - The following code example demonstrates how use the property to retrieve the current date value. First, the example displays the property. The example then increments the property by one day and displays the property value again. - + property has not been changed in code or by the user, it is set to the current date and time (). + + + +## Examples + The following code example demonstrates how use the property to retrieve the current date value. First, the example displays the property. The example then increments the property by one day and displays the property value again. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DateTimePicker.Value/CPP/value.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DateTimePicker/Value/value.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.Value/VB/value.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DateTimePicker.Value/VB/value.vb" id="Snippet1"::: + ]]> The set value is less than or more than . @@ -3159,23 +3159,23 @@ The value assigned is less than the property changes. - or later than . - - 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 type named `DateTimePicker1`. Then ensure that the event handler is associated with the event. - + or later than . + + 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 type named `DateTimePicker1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet378"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet378"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet378"::: + ]]> diff --git a/xml/System.Windows.Forms/DragDropEffects.xml b/xml/System.Windows.Forms/DragDropEffects.xml index af730de7de0..a67cdb7c330 100644 --- a/xml/System.Windows.Forms/DragDropEffects.xml +++ b/xml/System.Windows.Forms/DragDropEffects.xml @@ -29,33 +29,33 @@ Specifies the possible effects of a drag-and-drop operation. - , , and classes. - - You can use `DragDropEffects` to display different mouse pointers for drag-and-drop operations. For example, you can display a plus symbol for a `Copy` drag-and-drop operation, an arrow symbol for a `Move` drag-and-drop operation, or a red circle with a line through it symbol for a `None` drag-and-drop operation. - - If you want to drop data at a position in the target that is not currently visible, you could scroll the target while dragging. If a target does not support scrolling, you must make sure that the drop position is visible in the target before you begin the drag-and-drop operation. The following are some scenarios when you might want to scroll a target: - -- You're dragging text into a document, and you want to drop the text at a position not visible in the document window. + , , and classes. + + You can use `DragDropEffects` to display different mouse pointers for drag-and-drop operations. For example, you can display a plus symbol for a `Copy` drag-and-drop operation, an arrow symbol for a `Move` drag-and-drop operation, or a red circle with a line through it symbol for a `None` drag-and-drop operation. + + If you want to drop data at a position in the target that is not currently visible, you could scroll the target while dragging. If a target does not support scrolling, you must make sure that the drop position is visible in the target before you begin the drag-and-drop operation. The following are some scenarios when you might want to scroll a target: + +- You're dragging text into a document, and you want to drop the text at a position not visible in the document window. + +- You're dragging a file into a file tree, and you want to drop the file on a node not visible in the file tree. + + + +## Examples The following example demonstrates using the `DragDropEffects` enumeration when the user moves the mouse over the drop target during a drag-and-drop operation. This example is part of a larger example provided for the method. - + :::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"::: + ]]> - Drag-and-Drop Operations and Clipboard Support + Drag-and-Drop Operations and Clipboard Support diff --git a/xml/System.Windows.Forms/FileDialog.xml b/xml/System.Windows.Forms/FileDialog.xml index 4ff88e1edc6..6efdaedd798 100644 --- a/xml/System.Windows.Forms/FileDialog.xml +++ b/xml/System.Windows.Forms/FileDialog.xml @@ -38,45 +38,45 @@ Displays a dialog box from which the user can select a file. - is an abstract class that contains common behavior for the and classes. It is not intended to be used directly but contains common behavior for those two classes. You cannot create an instance of . Although the class is declared public, you cannot inherit from it, as it contains internal abstract methods. To create a dialog box to select or save a file, use or . - - is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a file. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur. - + is an abstract class that contains common behavior for the and classes. It is not intended to be used directly but contains common behavior for those two classes. You cannot create an instance of . Although the class is declared public, you cannot inherit from it, as it contains internal abstract methods. To create a dialog box to select or save a file, use or . + + is a modal dialog box; therefore, when shown, it blocks the rest of the application until the user has chosen a file. When a dialog box is displayed modally, no input (keyboard or mouse click) can occur except to objects on the dialog box. The program must hide or close the dialog box (usually in response to some user action) before input to the calling program can occur. + > [!CAUTION] -> When you use classes derived from , such as and , avoid using string literals containing absolute paths. Instead, dynamically obtain the path using one or more of the techniques described in the following table. - - If you want to enable users to select a folder instead of a file, use the . - - Depending upon the type of application, how data associated with the application is stored, and the reason for accessing the file system, there are many possible ways in which you can create a directory path. The following table shows the techniques for creating paths dynamically. - -|Path or program category|Class and members to use| -|------------------------------|------------------------------| -|Standard Windows paths, such as Program Files, MyDocuments, the Desktop and so on|The class is the most complete source for these, either through its static methods, such as , or through the method, using one of the enumerated values.| -|Paths related to the current application|The class has static members to obtain certain paths, such as , , , and .

The method of the returns the path of the temporary folder.

The method of the class returns the application's current executing directory.

The property of the class represents the specified drive's root directory.| -|Paths stored as application settings|Access the corresponding applications settings property of the wrapper class derived from . For more information, see [Application Settings for Windows Forms](/dotnet/framework/winforms/advanced/application-settings-for-windows-forms).| -|Registry storage|Some applications store directory information in the registry. The class has the and properties that resolve to a value.| -|ClickOnce applications|For ClickOnce applications, use class members such as , which will return a pointer to the ClickOnce data directory. For more information, see [Accessing Local and Remote Data in ClickOnce Applications](/visualstudio/deployment/accessing-local-and-remote-data-in-clickonce-applications).| -|International applications|For international applications, retrieve the relative path portion from a string resource in your application by using the class. For more information about globalization and localization, see the topic [Globalization and Localization](/dotnet/standard/globalization-localization/).| - - Notice that a full path may be built up using one or more of the described techniques. For example, the method might be used to obtain the path to the MyDocuments folder, then an application setting may be used to add a relative subdirectory portion. - - The class contains static members to assist in manipulating absolute and relative path strings, whereas the and classes have static members that actually manipulate files and directories, respectively. - +> When you use classes derived from , such as and , avoid using string literals containing absolute paths. Instead, dynamically obtain the path using one or more of the techniques described in the following table. + + If you want to enable users to select a folder instead of a file, use the . + + Depending upon the type of application, how data associated with the application is stored, and the reason for accessing the file system, there are many possible ways in which you can create a directory path. The following table shows the techniques for creating paths dynamically. + +|Path or program category|Class and members to use| +|------------------------------|------------------------------| +|Standard Windows paths, such as Program Files, MyDocuments, the Desktop and so on|The class is the most complete source for these, either through its static methods, such as , or through the method, using one of the enumerated values.| +|Paths related to the current application|The class has static members to obtain certain paths, such as , , , and .

The method of the returns the path of the temporary folder.

The method of the class returns the application's current executing directory.

The property of the class represents the specified drive's root directory.| +|Paths stored as application settings|Access the corresponding applications settings property of the wrapper class derived from . For more information, see [Application Settings for Windows Forms](/dotnet/desktop/winforms/advanced/application-settings-for-windows-forms).| +|Registry storage|Some applications store directory information in the registry. The class has the and properties that resolve to a value.| +|ClickOnce applications|For ClickOnce applications, use class members such as , which will return a pointer to the ClickOnce data directory. For more information, see [Accessing Local and Remote Data in ClickOnce Applications](/visualstudio/deployment/accessing-local-and-remote-data-in-clickonce-applications).| +|International applications|For international applications, retrieve the relative path portion from a string resource in your application by using the class. For more information about globalization and localization, see the topic [Globalization and Localization](/dotnet/standard/globalization-localization/).| + + Notice that a full path may be built up using one or more of the described techniques. For example, the method might be used to obtain the path to the MyDocuments folder, then an application setting may be used to add a relative subdirectory portion. + + The class contains static members to assist in manipulating absolute and relative path strings, whereas the and classes have static members that actually manipulate files and directories, respectively. + > [!IMPORTANT] -> If the user of your application changes the folder in the , then the current working directory for your application is set to the location specified in the . To prevent this, set the property to `true`. - - - -## Examples - The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the method to display the dialog box and return the . The example requires a form with a placed on it and the namespace added to it. - +> If the user of your application changes the folder in the , then the current working directory for your application is set to the location specified in the . To prevent this, set the property to `true`. + + + +## Examples + The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the method to display the dialog box and return the . The example requires a form with a placed on it and the namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]>
@@ -130,15 +130,15 @@ if the dialog box adds an extension to a file name if the user omits the extension; otherwise, . The default value is . - property. - - If the property is `true`, the dialog box adds the first extension from the current file filter that matches an existing file. If no files match the current file filter, the dialog box adds the extension specified in the property. - - If the property is `false`, the dialog box adds the first valid file name extension from the current file filter. If the current file filter contains no valid file name extensions, the dialog box adds the extension specified in the property. - + property. + + If the property is `true`, the dialog box adds the first extension from the current file filter that matches an existing file. If no files match the current file filter, the dialog box adds the extension specified in the property. + + If the property is `false`, the dialog box adds the first valid file name extension from the current file filter. If the current file filter contains no valid file name extensions, the dialog box adds the extension specified in the property. + ]]> @@ -216,13 +216,13 @@ if this instance should automatically upgrade appearance and behavior when running on Windows Vista; otherwise, . The default is . - class will have a Windows XP-style appearance and behavior on Windows Vista. - - On Windows XP, this property does not have any effect. - + class will have a Windows XP-style appearance and behavior on Windows Vista. + + On Windows XP, this property does not have any effect. + ]]>
@@ -265,11 +265,11 @@ if the dialog box displays a warning if the user specifies a file name that does not exist; otherwise, . The default value is . - and `false` for an inheriting . - + and `false` for an inheriting . + ]]> @@ -409,19 +409,19 @@ Gets the custom places collection for this instance. The custom places collection for this instance. - collection. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. - + collection. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -459,22 +459,22 @@ Gets or sets the default file name extension. The default file name extension. The returned string does not include the period. The default value is an empty string (""). - appends an extension to the file name. The extension that is used is determined by the and properties. If a filter is selected in the and the filter specifies an extension, then that extension is used. If the filter selected uses a wildcard in place of the extension, then the extension specified in the property is used. - - - -## Examples - The following code example demonstrates using the and methods with streams. It also demonstrates using the , , , and members. - - This is a complete example that is ready to run when you copy it to your project. - + appends an extension to the file name. The extension that is used is determined by the and properties. If a filter is selected in the and the filter specifies an extension, then that extension is used. If the filter selected uses a wildcard in place of the extension, then the extension specified in the property is used. + + + +## Examples + The following code example demonstrates using the and methods with streams. It also demonstrates using the , , , and members. + + This is a complete example that is ready to run when you copy it to your project. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/DefaultExt/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: + ]]> @@ -576,26 +576,26 @@ Gets or sets a string containing the file name selected in the file dialog box. The file name selected in the file dialog box. The default value is an empty string (""). - class, this property represents the file being saved; when used from the class, it represents the file being opened. - - This property can only be the name of one selected file. If you want to return an array containing the names of all selected files in a multiple-selection dialog box, use . - - - -## Examples - The following code example demonstrates using the and methods with streams. It also demonstrates using the , , , and members. - - This is a complete example that is ready to run when you copy it to your project. - + class, this property represents the file being saved; when used from the class, it represents the file being opened. + + This property can only be the name of one selected file. If you want to return an array containing the names of all selected files in a multiple-selection dialog box, use . + + + +## Examples + The following code example demonstrates using the and methods with streams. It also demonstrates using the , , , and members. + + This is a complete example that is ready to run when you copy it to your project. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/DefaultExt/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RichTextBoxSaveFile/VB/form1.vb" id="Snippet1"::: + ]]> @@ -644,19 +644,19 @@ Gets the file names of all selected files in the dialog box. An array of type , containing the file names of all selected files in the dialog box. - controls on a Form. It demonstrates initializing an , setting the and properties, and allowing the user to select multiple files by setting the property to true. This code example assumes that your form already has an control named `openFileDialog1`, a named `SelectFileButton`, and a named `flowLayoutPanel1`. - + controls on a Form. It demonstrates initializing an , setting the and properties, and allowing the user to select multiple files by setting the property to true. This code example assumes that your form already has an control named `openFileDialog1`, a named `SelectFileButton`, and a named `flowLayoutPanel1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/FileNames/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.OpenFileDialog.MultiSelect/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.OpenFileDialog.MultiSelect/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -688,20 +688,20 @@ Occurs when the user clicks on the **Open** or **Save** button on a file dialog box. - property, handling the event and using the method. When the example runs, a user can select graphics files from an object. The selected files are displayed in the form. The method forces a repaint of the form for each graphics file opened. To run this example paste the following code in a form containing a named `PictureBox1`, an named `OpenFileDialog1`, and a named `fileButton`. Call the `InitializePictureBox` and `InitializeOpenFileDialog` methods from the form's constructor or `Load` method. When the example is running, display the dialog box by clicking the button. - + property, handling the event and using the method. When the example runs, a user can select graphics files from an object. The selected files are displayed in the form. The method forces a repaint of the form for each graphics file opened. To run this example paste the following code in a form containing a named `PictureBox1`, an named `OpenFileDialog1`, and a named `fileButton`. Call the `InitializePictureBox` and `InitializeOpenFileDialog` methods from the form's constructor or `Load` method. When the example is running, display the dialog box by clicking the button. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/CPP/filedialogform.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Application/DoEvents/filedialogform.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet1"::: + ]]> @@ -744,30 +744,30 @@ Gets or sets the current file name filter string, which determines the choices that appear in the "Save as file type" or "Files of type" box in the dialog box. The file filtering options available in the dialog box. - property to set which filtering option is shown first to the user. - - - -## Examples - The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the and properties to provide a list of filters for the user. The example requires a form with a placed on it and the namespace added to it. - + property to set which filtering option is shown first to the user. + + + +## Examples + The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the and properties to provide a list of filters for the user. The example requires a form with a placed on it and the namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -817,23 +817,23 @@ Gets or sets the index of the filter currently selected in the file dialog box. A value containing the index of the filter currently selected in the file dialog box. The default value is 1. - property to set which filtering option is shown first to the user. You can also use the value of after showing the file dialog to perform special file operations depending upon the filter chosen. - + property to set which filtering option is shown first to the user. You can also use the value of after showing the file dialog to perform special file operations depending upon the filter chosen. + > [!NOTE] -> The index value of the first filter entry is 1. - - - -## Examples - The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the and properties to provide a list of filters for the user. The example requires a form with a placed on it and the namespace added to it. - +> The index value of the first filter entry is 1. + + + +## Examples + The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the and properties to provide a list of filters for the user. The example requires a form with a placed on it and the namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -877,13 +877,13 @@ Defines the common dialog box hook procedure that is overridden to add specific functionality to the file dialog box. Returns zero if the default dialog box procedure processes the message; returns a nonzero value if the default dialog box procedure ignores the message. - @@ -928,32 +928,32 @@ Gets or sets the initial directory displayed by the file dialog box. The initial directory displayed by the file dialog box. The default is an empty string (""). - property is typically set using one of the following sources: - -- A path that was previously used in the program, perhaps retained from the last directory or file operation. - -- A path read from a persistent source, such as an application setting, a or a string resource in the application. - -- Standard Windows system and user paths, such as Program Files, MyDocuments, MyMusic, and so on (which you can obtain using the method) - -- A path related to the current application, such as its startup directory (which you can obtain using properties on the object). - - For more information about creating dynamic paths, see the class overview. - - On Windows Vista, if is set to a full file name instead of just a directory path, the initial directory will default either to the application path, or to the directory from which the user last selected a file. - - - -## Examples - The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the property to set what the initial directory is when the dialog box is displayed to the user. The example requires a form with a placed on it and the namespace added to it. - + property is typically set using one of the following sources: + +- A path that was previously used in the program, perhaps retained from the last directory or file operation. + +- A path read from a persistent source, such as an application setting, a or a string resource in the application. + +- Standard Windows system and user paths, such as Program Files, MyDocuments, MyMusic, and so on (which you can obtain using the method) + +- A path related to the current application, such as its startup directory (which you can obtain using properties on the object). + + For more information about creating dynamic paths, see the class overview. + + On Windows Vista, if is set to a full file name instead of just a directory path, the initial directory will default either to the application path, or to the directory from which the user last selected a file. + + + +## Examples + The following code example uses the implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the property to set what the initial directory is when the dialog box is displayed to the user. The example requires a form with a placed on it and the namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1082,11 +1082,11 @@ Gets values to initialize the . A bitwise combination of internal values that initializes the . - property corresponds to the flags used to initialize a file dialog box using Win32. Use the properties of the class to get and set the options. - + property corresponds to the flags used to initialize a file dialog box using Win32. Use the properties of the class to get and set the options. + ]]> @@ -1161,15 +1161,15 @@ if the dialog box restores the current directory to the previously selected directory if the user changed the directory while searching for files; otherwise, . The default value is . - implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the property to ensure that the previously selected directory is restored when the dialog box is closed. The example requires a form with a placed on it and the namespace added to it. - + implementation of and illustrates creating, setting of properties, and showing the dialog box. The example uses the property to ensure that the previously selected directory is restored when the dialog box is closed. The example requires a form with a placed on it and the namespace added to it. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic OpenFileDialog Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic OpenFileDialog Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1207,13 +1207,13 @@ if the file could be opened; otherwise, . - , and is invoked when the user of a file dialog invokes . - - In the derived classes and an invalid file name can be raised. - + , and is invoked when the user of a file dialog invokes . + + In the derived classes and an invalid file name can be raised. + ]]> @@ -1260,11 +1260,11 @@ if the dialog box includes a help button; otherwise, . The default value is . - event is raised when the user clicks the **Help** button. - + event is raised when the user clicks the **Help** button. + ]]> @@ -1370,21 +1370,21 @@ if the dialog box supports multiple file name extensions; otherwise, . The default is . - property to a multi-dotted extension. - - If is `false`, and you assign a multi-dotted extension to , derived controls such as will only use the last extension in the string. For example, ".manifest" will be used instead of ".exe.manifest". - - - -## Examples - The following code example saves files with the extension ".data.txt". This code example requires that your application host a named `saveFileDialog1` and a named `button1`. - + property to a multi-dotted extension. + + If is `false`, and you assign a multi-dotted extension to , derived controls such as will only use the last extension in the string. For example, ".manifest" will be used instead of ".exe.manifest". + + + +## Examples + The following code example saves files with the extension ".data.txt". This code example requires that your application host a named `saveFileDialog1` and a named `button1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/SupportMultiDottedExtensions/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SupportMultiDottedExtensions/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SupportMultiDottedExtensions/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -1427,20 +1427,20 @@ Gets or sets the file dialog box title. The file dialog box title. The default value is an empty string (""). - , setting the and properties, and allowing the user to select multiple files by setting the property to true. To run this example, paste the following code in a form containing an named `OpenFileDialog1` and a named `fileButton`. Call the `InitializeOpenFileDialog` method in the form's constructor or `Load` method. The example also requires that the `Click` event of the `Button` control is connected to the event handler defined in the example. - + , setting the and properties, and allowing the user to select multiple files by setting the property to true. To run this example, paste the following code in a form containing an named `OpenFileDialog1` and a named `fileButton`. Call the `InitializeOpenFileDialog` method in the form's constructor or `Load` method. The example also requires that the `Click` event of the `Button` control is connected to the event handler defined in the example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/CPP/filedialogform.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Application/DoEvents/filedialogform.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialog/VB/filedialogform.vb" id="Snippet6"::: + ]]> @@ -1509,11 +1509,11 @@ if the dialog box accepts only valid Win32 file names; otherwise, . The default value is . - diff --git a/xml/System.Windows.Forms/FileDialogCustomPlace.xml b/xml/System.Windows.Forms/FileDialogCustomPlace.xml index 4f2c0c966c4..9f24373fb7f 100644 --- a/xml/System.Windows.Forms/FileDialogCustomPlace.xml +++ b/xml/System.Windows.Forms/FileDialogCustomPlace.xml @@ -50,8 +50,8 @@ ]]> - How To: Add a Custom Place to a File Dialog Box - Known Folder GUIDs for File Dialog Custom Places + How To: Add a Custom Place to a File Dialog Box + Known Folder GUIDs for File Dialog Custom Places @@ -96,7 +96,7 @@ Gets or sets the Windows Vista Known Folder GUID for the custom place. - A that indicates the Windows Vista Known Folder for the custom place. If the custom place was specified with a folder path, then an empty GUID is returned. For a list of the available Windows Vista Known Folders, see Known Folder GUIDs for File Dialog Custom Places or the KnownFolders.h file in the Windows SDK. + A that indicates the Windows Vista Known Folder for the custom place. If the custom place was specified with a folder path, then an empty GUID is returned. For a list of the available Windows Vista Known Folders, see Known Folder GUIDs for File Dialog Custom Places or the KnownFolders.h file in the Windows SDK. To be added. diff --git a/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml b/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml index c389ed728b8..b8366b1d4fe 100644 --- a/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml +++ b/xml/System.Windows.Forms/FileDialogCustomPlacesCollection.xml @@ -43,19 +43,19 @@ Represents a collection of Windows Vista custom places for the class. - . To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. - + . To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -137,25 +137,25 @@ A that represents a Windows Vista Known Folder. Adds a custom place to the collection. - and is not a system or application wide change. - - The folders are positioned in the custom places in the order that they are added to the . The last one added will be at the top. If you add a custom place to the collection that does not exist on the computer running the application, the custom place will not be shown. GUIDs are case-insensitive. For a list of the available Windows Vista Known Folders, see [Known Folder GUIDs for File Dialog Custom Places](/dotnet/framework/winforms/controls/known-folder-guids-for-file-dialog-custom-places) or the KnownFolders.h file in the Windows SDK. - - - -## Examples - The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. - + and is not a system or application wide change. + + The folders are positioned in the custom places in the order that they are added to the . The last one added will be at the top. If you add a custom place to the collection that does not exist on the computer running the application, the custom place will not be shown. GUIDs are case-insensitive. For a list of the available Windows Vista Known Folders, see [Known Folder GUIDs for File Dialog Custom Places](/dotnet/desktop/winforms/controls/known-folder-guids-for-file-dialog-custom-places) or the KnownFolders.h file in the Windows SDK. + + + +## Examples + The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]> - Known Folder Guids for File Dialog Custom Places + Known Folder Guids for File Dialog Custom Places
@@ -191,21 +191,21 @@ A folder path to the custom place. Adds a custom place to the collection. - and is not a system or application wide change. - - The folders are positioned in the custom places in the order that they are added to the . The last one added will be at the top. - - - -## Examples - The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. - + and is not a system or application wide change. + + The folders are positioned in the custom places in the order that they are added to the . The last one added will be at the top. + + + +## Examples + The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form and call `InitializeDialogAndButton` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FileDialog/CustomPlaces/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FileDialogCommonPlaces/VB/Form1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/FlowLayoutPanel.xml b/xml/System.Windows.Forms/FlowLayoutPanel.xml index 0870c465147..5c78308c9a7 100644 --- a/xml/System.Windows.Forms/FlowLayoutPanel.xml +++ b/xml/System.Windows.Forms/FlowLayoutPanel.xml @@ -61,31 +61,31 @@ Represents a panel that dynamically lays out its contents horizontally or vertically. - control arranges its contents in a horizontal or vertical flow direction. Its contents can be wrapped from one row to the next, or from one column to the next. Alternatively, its contents can be clipped instead of wrapped. - - You can specify the flow direction by setting the value of the property. The control correctly reverses its flow direction in right-to-left (RTL) layouts. You can also specify whether the contents of the control are wrapped or clipped by setting the value of the property. - - Any Windows Forms control, including other instances of , can be a child of the control. With this capability, you can construct sophisticated layouts that adapt to your form's dimensions at run time. - - Docking and anchoring behaviors of child controls differ from the behaviors in other container controls. Both docking and anchoring are relative to the largest control in the flow direction. For more information, see [How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-flowlayoutpanel-control). - - - -## Examples - The following example shows how to set the and properties on a control. Paste the code into the Form1 source file. If your project contains a file named Form1.Designer.cs or Form1.Designer.vb, remove that file from the project. You may need to click the **Show All Files** button in Solution Explorer to see the designer file. - + control arranges its contents in a horizontal or vertical flow direction. Its contents can be wrapped from one row to the next, or from one column to the next. Alternatively, its contents can be clipped instead of wrapped. + + You can specify the flow direction by setting the value of the property. The control correctly reverses its flow direction in right-to-left (RTL) layouts. You can also specify whether the contents of the control are wrapped or clipped by setting the value of the property. + + Any Windows Forms control, including other instances of , can be a child of the control. With this capability, you can construct sophisticated layouts that adapt to your form's dimensions at run time. + + Docking and anchoring behaviors of child controls differ from the behaviors in other container controls. Both docking and anchoring are relative to the largest control in the flow direction. For more information, see [How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-flowlayoutpanel-control). + + + +## Examples + The following example shows how to set the and properties on a control. Paste the code into the Form1 source file. If your project contains a file named Form1.Designer.cs or Form1.Designer.vb, remove that file from the project. You may need to click the **Show All Files** button in Solution Explorer to see the designer file. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet1"::: + ]]> - How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control + How to: Anchor and Dock Child Controls in a FlowLayoutPanel Control @@ -110,11 +110,11 @@ Initializes a new instance of the class. - and properties to their default values: and `true`, respectively. - + and properties to their default values: and `true`, respectively. + ]]> @@ -157,20 +157,20 @@ Gets or sets a value indicating the flow direction of the control. One of the values indicating the direction of consecutive placement of controls in the panel. The default is . - property is the default property for the class. - - - -## Examples - The following code example sets the value of depending on the selected . - + property is the default property for the class. + + + +## Examples + The following code example sets the value of depending on the selected . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet4"::: + ]]> @@ -326,11 +326,11 @@ if this object can provide extender properties to the specified object; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> @@ -372,22 +372,22 @@ if the contents should be wrapped; otherwise, . The default is . - property depending on the value of a control. - + property depending on the value of a control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/cpp/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/FlowDirection/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.FlowLayoutPanel/VB/form1.vb" id="Snippet3"::: + ]]> diff --git a/xml/System.Windows.Forms/Form.xml b/xml/System.Windows.Forms/Form.xml index d39dd61cae9..fc90f7087c9 100644 --- a/xml/System.Windows.Forms/Form.xml +++ b/xml/System.Windows.Forms/Form.xml @@ -100,7 +100,7 @@ ]]> - Multiple-Document Interface (MDI) Applications + Multiple-Document Interface (MDI) Applications @@ -722,7 +722,7 @@ ## Remarks > [!IMPORTANT] -> The is obsolete and has been retained for backward compatibility. The non-obsolete alternative is . For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> The is obsolete and has been retained for backward compatibility. The non-obsolete alternative is . For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). You can use this property to allow your form and its controls to automatically adjust based on changes in the font. This can be useful in applications where the font might increase or decrease based on the language specified for use by Windows. @@ -794,7 +794,7 @@ ## Remarks > [!IMPORTANT] -> This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). The value of the property is used at form-display time to compute the scaling factor for the form. The autoscaling base size is used by the form as a baseline for comparison to the system's font size to determine how much to scale the form when autoscaling is used. If you want to determine the size a form will auto scale to based on a specific font, use the method. @@ -1330,7 +1330,7 @@ The size of the client area of the form is the size of the form excluding the borders and the title bar. The client area of a form is the area within a form where controls can be placed. You can use this property to get the proper dimensions when performing graphics operations or when sizing and positioning controls on the form. To get the size of the entire form, use the property or use the individual properties and . > [!NOTE] -> You cannot currently bind to this property using application settings. For more information on application settings, see [Application Settings Overview](/dotnet/framework/winforms/advanced/application-settings-overview). +> You cannot currently bind to this property using application settings. For more information on application settings, see [Application Settings Overview](/dotnet/desktop/winforms/advanced/application-settings-overview). @@ -2227,7 +2227,7 @@ - Note: Reading this property is only for tracking purposes. If the Form's border color is changed through other external means (Win32 calls), + Note: Reading this property is only for tracking purposes. If the Form's border color is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. @@ -2362,11 +2362,11 @@ - Reading this property is only for tracking purposes. If the window's title bar color is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the window's title bar color is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. - The property only reflects the value that was previously set using this property. The + The property only reflects the value that was previously set using this property. The event is raised accordingly when the value is changed, which allows the property to be participating in binding scenarios. @@ -2437,11 +2437,11 @@ - Reading this property is only for tracking purposes. If the Form's title bar's text color (window caption text) is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the Form's title bar's text color (window caption text) is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. - The property only reflects the value that was previously set using this property. The + The property only reflects the value that was previously set using this property. The event is raised accordingly when the value is changed, which allows the property to be participating in binding scenarios. @@ -2635,7 +2635,7 @@ To be added. - Reading this property is only for tracking purposes. If the Form's corner preference is changed through other external means (Win32 calls), + Reading this property is only for tracking purposes. If the Form's corner preference is changed through other external means (Win32 calls), reading this property will not reflect those changes, as the Win32 API does not provide a mechanism to retrieve the current title bar color. @@ -2726,7 +2726,7 @@ ## Remarks > [!IMPORTANT] -> The method is obsolete starting with the .NET Framework 2.0. This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/framework/winforms/automatic-scaling-in-windows-forms). +> The method is obsolete starting with the .NET Framework 2.0. This member has been retained for backward compatibility. For more information about automatic scaling, see [Automatic Scaling in Windows Forms](/dotnet/desktop/winforms/automatic-scaling-in-windows-forms). You can use this method to determine the size a form would autoscale to for a specific font before applying the font to the form. If you want to determine the size a form is autoscaled to based on the font currently assigned to the form, use the property. @@ -6717,7 +6717,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another ## Remarks The method overrides the base implementation to provide additional handling of main menu command keys and MDI accelerators. - For information about keyboard input, see [Keyboard Input in a Windows Forms Application](/dotnet/framework/winforms/keyboard-input-in-a-windows-forms-application). + For information about keyboard input, see [Keyboard Input in a Windows Forms Application](/dotnet/desktop/winforms/keyboard-input-in-a-windows-forms-application). ]]> @@ -7763,7 +7763,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another If the owner window is provided, it ensures that the owner is topmost and sets the owner for the form. - This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, attempting to display the form when + This method also performs several checks to prevent invalid operations, such as trying to display a disabled form, attempting to display the form when it is not a top-level window, or setting the form as its own owner. @@ -8197,7 +8197,7 @@ This example assumes that the `CreateMyOpaqueForm` method is called from another event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event. For more information about the order of events of a form, see [Order of Events in Windows Forms](/dotnet/framework/winforms/order-of-events-in-windows-forms). + The event is only raised the first time a form is displayed; subsequently minimizing, maximizing, restoring, hiding, showing, or invalidating and repainting will not raise this event. For more information about the order of events of a form, see [Order of Events in Windows Forms](/dotnet/desktop/winforms/order-of-events-in-windows-forms). For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). diff --git a/xml/System.Windows.Forms/GroupBoxRenderer.xml b/xml/System.Windows.Forms/GroupBoxRenderer.xml index d870d20344d..0d71e1249c9 100644 --- a/xml/System.Windows.Forms/GroupBoxRenderer.xml +++ b/xml/System.Windows.Forms/GroupBoxRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a group box control with or without visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a group box control. Rendering a control refers to drawing the user interface of a control. To draw a group box, use one of the methods. These methods provide a variety of text drawing options. - - If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the group box with the current visual style. Otherwise, will draw the group box with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the method to draw a group box with a double border if visual styles are enabled. - + class provides a set of `static` methods that can be used to render a group box control. Rendering a control refers to drawing the user interface of a control. To draw a group box, use one of the methods. These methods provide a variety of text drawing options. + + If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the group box with the current visual style. Otherwise, will draw the group box with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the method to draw a group box with a double border if visual styles are enabled. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -101,20 +101,20 @@ One of the values that specifies the visual state of the group box. Draws a group box control in the specified state and bounds. - method in a custom control's method to draw a group box with a double border. This code example is part of a larger example provided for the class. - + method in a custom control's method to draw a group box with a double border. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> @@ -170,20 +170,20 @@ One of the values that specifies the visual state of the group box. Draws a group box control in the specified state and bounds, with the specified text and font. - method in a custom control's method to draw a group box with a double border. This code example is part of a larger example provided for the class. - + method in a custom control's method to draw a group box with a double border. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> @@ -241,11 +241,11 @@ One of the values that specifies the visual state of the group box. Draws a group box control in the specified state and bounds, with the specified text, font, and color. - @@ -297,11 +297,11 @@ One of the values that specifies the visual state of the group box. Draws a group box control in the specified state and bounds, with the specified text, font, and text formatting. - @@ -355,11 +355,11 @@ One of the values that specifies the visual state of the group box. Draws a group box control in the specified state and bounds, with the specified text, font, color, and text formatting. - @@ -469,19 +469,19 @@ if the application state is used to determine rendering style; otherwise, . The default is . - is `true`, the uses the setting from to determine the rendering style. If is `false`, the renderer will always render using visual styles. - - - -## Examples - The following code example uses the property to change whether a group box is rendered using visual styles. This code example is part of a larger example provided for the class. - + is `true`, the uses the setting from to determine the rendering style. If is `false`, the renderer will always render using visual styles. + + + +## Examples + The following code example uses the property to change whether a group box is rendered using visual styles. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/GroupBoxRenderer/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.GroupBoxRenderer/VB/form1.vb" id="Snippet3"::: + ]]> diff --git a/xml/System.Windows.Forms/HtmlDocument.xml b/xml/System.Windows.Forms/HtmlDocument.xml index c0583826bc0..8be6198f55d 100644 --- a/xml/System.Windows.Forms/HtmlDocument.xml +++ b/xml/System.Windows.Forms/HtmlDocument.xml @@ -29,50 +29,50 @@ Provides top-level programmatic access to an HTML document hosted by the control. - provides a managed wrapper around Internet Explorer's document object, also known as the HTML Document Object Model (DOM). You obtain an instance of through the property of the control. - - HTML tags inside of an HTML document can be nested inside one another. thus represents a document tree, whose children are instances of the class. The following code example shows a simple HTML file. - + provides a managed wrapper around Internet Explorer's document object, also known as the HTML Document Object Model (DOM). You obtain an instance of through the property of the control. + + HTML tags inside of an HTML document can be nested inside one another. thus represents a document tree, whose children are instances of the class. The following code example shows a simple HTML file. + ```html - - -
Simple HTML Form
-
- Enter Your Name: - -
- - -``` - - In this example, represents the entire document inside the `HTML` tags. The `BODY`, `DIV`, `FORM` and `SPAN` tags are represented by individual objects. - - There are several ways you can access the elements in this tree. Use the property to access the `BODY` tag and all of its children. The property gives you the for the element on an HTML page that has user input focus. All elements within an HTML page can have a name; the collection provides access to each using its name as an index. will return an of all objects with a given HTML tag name, such as `DIV` or `TABLE`. will return the single corresponding to the unique ID that you supply. will return the that can be found on the screen at the supplied mouse pointer coordinates. - - You can also use the and collection to iterate through elements that represent user input forms and graphics, respectively. - - is based on the unmanaged interfaces implemented by Internet Explorer's DHTML DOM: `IHTMLDocument`, `IHTMLDocument2`, `IHTMLDocument3`, and `IHTMLDocument4`. Only the most frequently used properties and methods on these unmanaged interfaces are exposed by . You can access all other properties and methods directly using the property, which you can cast to the desired unmanaged interface pointer. - - An HTML document may contain frames, which are different windows inside of the control. Each frame displays its own HTML page. The collection is available through the property. You may also use the property to resize the displayed page, scroll the document, or display alerts and prompts to the user. - - exposes the most common events you would expect to handle when hosting HTML pages. For events not exposed directly by the interface, you can add a handler for the event using . - - HTML files may contain `SCRIPT` tags that encapsulate code written in one of the Active Scripting languages, such as JScript or VBScript. The method provides for execution of properties and methods defined in a `SCRIPT` tag. - + + +
Simple HTML Form
+
+ Enter Your Name: + +
+ + +``` + + In this example, represents the entire document inside the `HTML` tags. The `BODY`, `DIV`, `FORM` and `SPAN` tags are represented by individual objects. + + There are several ways you can access the elements in this tree. Use the property to access the `BODY` tag and all of its children. The property gives you the for the element on an HTML page that has user input focus. All elements within an HTML page can have a name; the collection provides access to each using its name as an index. will return an of all objects with a given HTML tag name, such as `DIV` or `TABLE`. will return the single corresponding to the unique ID that you supply. will return the that can be found on the screen at the supplied mouse pointer coordinates. + + You can also use the and collection to iterate through elements that represent user input forms and graphics, respectively. + + is based on the unmanaged interfaces implemented by Internet Explorer's DHTML DOM: `IHTMLDocument`, `IHTMLDocument2`, `IHTMLDocument3`, and `IHTMLDocument4`. Only the most frequently used properties and methods on these unmanaged interfaces are exposed by . You can access all other properties and methods directly using the property, which you can cast to the desired unmanaged interface pointer. + + An HTML document may contain frames, which are different windows inside of the control. Each frame displays its own HTML page. The collection is available through the property. You may also use the property to resize the displayed page, scroll the document, or display alerts and prompts to the user. + + exposes the most common events you would expect to handle when hosting HTML pages. For events not exposed directly by the interface, you can add a handler for the event using . + + HTML files may contain `SCRIPT` tags that encapsulate code written in one of the Active Scripting languages, such as JScript or VBScript. The method provides for execution of properties and methods defined in a `SCRIPT` tag. + > [!NOTE] -> While most of the properties, methods, and events on have kept the same names as they have on the unmanaged DOM, some have been changed for consistency with the .NET Framework. - - - -## Examples - The following code example uses data from the Northwind database to create an `HTML TABLE` dynamically using . The method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a control named `WebBrowser1`. The code should be called after a document has been loaded. - +> While most of the properties, methods, and events on have kept the same names as they have on the unmanaged DOM, some have been changed for consistency with the .NET Framework. + + + +## Examples + The following code example uses data from the Northwind database to create an `HTML TABLE` dynamically using . The method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a control named `WebBrowser1`. The code should be called after a document has been loaded. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: + ]]>
document - Web APIs @@ -112,15 +112,15 @@ Provides the which currently has user input focus. The which currently has user input focus. - returns the element corresponding to the `` tag. - - If the document does not have focus, returns `null`. - - If the current element with input focus is a cell (`TD`) in an HTML `TABLE` tag, will return the element that contains the `TABLE` element. - + returns the element corresponding to the `` tag. + + If the document does not have focus, returns `null`. + + If the current element with input focus is a cell (`TD`) in an HTML `TABLE` tag, will return the element that contains the `TABLE` element. + ]]> activeElement Property @@ -152,13 +152,13 @@ Gets or sets the of a hyperlink when clicked by a user. The for active links. - type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]> alinkColor Property @@ -190,23 +190,23 @@ Gets an instance of , which stores all objects for the document. The of all elements in the document. - collection provides random access to any element in the HTML document, regardless of its position in the document tree. Use it to access any element in an HTML document by name, ID, or index. You may also iterate over all of the elements within a document. - - Some elements, such as `HEAD` and `TITLE`, will never have names associated with them. All other elements will have names only if the author of the HTML file assigned them. You can access elements without names by ID or index. - - You cannot add elements directly to the collection, because all elements in an HTML file outside of the `HTML` tag must have a parent element. Use the method or the property on to add new elements to the tree. - - - -## Examples - The following code example iterates through all of the elements in a document and sets `Enabled=True`, enabling any elements that may have been disabled by default to prevent user input while the document was loading. The code example requires that your application contains a control named `WebBrowser1`. - + collection provides random access to any element in the HTML document, regardless of its position in the document tree. Use it to access any element in an HTML document by name, ID, or index. You may also iterate over all of the elements within a document. + + Some elements, such as `HEAD` and `TITLE`, will never have names associated with them. All other elements will have names only if the author of the HTML file assigned them. You can access elements without names by ID or index. + + You cannot add elements directly to the collection, because all elements in an HTML file outside of the `HTML` tag must have a parent element. Use the method or the property on to add new elements to the tree. + + + +## Examples + The following code example iterates through all of the elements in a document and sets `Enabled=True`, enabling any elements that may have been disabled by default to prevent user input while the document was loading. The code example requires that your application contains a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet1"::: + ]]> all Property @@ -243,13 +243,13 @@ The managed code that handles the event. Adds an event handler for the named HTML DOM event. - event of the control. - - This method allows you to attach handlers to unmanaged DOM events not exposed by . For more information about available unmanaged DOM events, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model) and the IHTMLDocument interfaces: [IHTMLDocument](https://go.microsoft.com/fwlink/?LinkId=104882), [IHTMLDocument2](https://go.microsoft.com/fwlink/?LinkId=104884), [IHTMLDocument3](https://go.microsoft.com/fwlink/?LinkId=104886), [IHTMLDocument4](https://go.microsoft.com/fwlink/?LinkId=104887), [IHTMLDocument5](https://go.microsoft.com/fwlink/?LinkId=104888). - + event of the control. + + This method allows you to attach handlers to unmanaged DOM events not exposed by . For more information about available unmanaged DOM events, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model) and the IHTMLDocument interfaces: [IHTMLDocument](https://go.microsoft.com/fwlink/?LinkId=104882), [IHTMLDocument2](https://go.microsoft.com/fwlink/?LinkId=104884), [IHTMLDocument3](https://go.microsoft.com/fwlink/?LinkId=104886), [IHTMLDocument4](https://go.microsoft.com/fwlink/?LinkId=104887), [IHTMLDocument5](https://go.microsoft.com/fwlink/?LinkId=104888). + ]]> attachEvent Method @@ -281,13 +281,13 @@ Gets or sets the background color of the HTML document. The of the document's background. - will display when no other element occupies that area of the screen. - - The type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + will display when no other element occupies that area of the screen. + + The type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]> @@ -329,25 +329,25 @@ Gets the for the BODY tag. The object for the BODY tag. - . To obtain the `HEAD` element, use . - - - -## Examples - The following code example creates a new `DIV` element and appends it to the bottom of the document using the method. - + . To obtain the `HEAD` element, use . + + + +## Examples + The following code example creates a new `DIV` element and appends it to the bottom of the document using the method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet13"::: + ]]> body Property @@ -385,19 +385,19 @@ Occurs when the user clicks anywhere on the document. - to align the element with the top of the Web page. - + to align the element with the top of the Web page. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: + ]]> onclick Event @@ -435,18 +435,18 @@ Occurs when the user requests to display the document's context menu. - event and uses it to display a . - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: - + event and uses it to display a . + + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: + ]]> oncontextmenu Event @@ -478,25 +478,25 @@ Gets or sets the HTTP cookies associated with this document. A containing a list of cookies, with each cookie separated by a semicolon. - property of exposes all cookies set for a Web page. - - A *cookie* is an arbitrary name/value pair associated with a given Web page. Web developers use cookies to track when users visit or return to a Web site. A cookie is composed of multiple parts, called cookie crumbs, that determine the following: - -- The document set to which the cookie applies; its domain and path. - -- The name and value of the cookie. - -- The expiration date of the cookie. - -- Whether the cookie can only be sent using a secure connection. - - The property may contain multiple cookies. - - You can only use the property to set one cookie at a time. - + property of exposes all cookies set for a Web page. + + A *cookie* is an arbitrary name/value pair associated with a given Web page. Web developers use cookies to track when users visit or return to a Web site. A cookie is composed of multiple parts, called cookie crumbs, that determine the following: + +- The document set to which the cookie applies; its domain and path. + +- The name and value of the cookie. + +- The expiration date of the cookie. + +- Whether the cookie can only be sent using a secure connection. + + The property may contain multiple cookies. + + You can only use the property to set one cookie at a time. + ]]> cookie Property @@ -533,25 +533,25 @@ Creates a new of the specified HTML tag type. A new element of the specified tag type. - returns an element unattached to the current document tree. To add the element to the document, use either the or methods. - - This method will not affect the state of an existing document's source code when you use the control's **View Source** context menu command or the and properties of the control. - - When you create new elements with , you will not be able to set certain properties, such as `Name`. In cases where you need to set the Name attribute, assign them as HTML to the property of another object in the document. - - - -## Examples - The following code example uses data from the Northwind database to create an HTML table using . The method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a control called `WebBrowser1`. - + returns an element unattached to the current document tree. To add the element to the document, use either the or methods. + + This method will not affect the state of an existing document's source code when you use the control's **View Source** context menu command or the and properties of the control. + + When you create new elements with , you will not be able to set certain properties, such as `Name`. In cases where you need to set the Name attribute, assign them as HTML to the property of another object in the document. + + + +## Examples + The following code example uses data from the Northwind database to create an HTML table using . The method is also used, first to add cells (`TD` elements) to rows (`TR` elements), then to add rows to the table, and finally to append the table to the end of the current document. The code example requires that your application has a control called `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet10"::: + ]]> createElement Method @@ -583,11 +583,11 @@ Gets the encoding used by default for the current document. The representing the encoding that the browser uses when the page is first displayed. - defaultCharset Property @@ -653,15 +653,15 @@ Gets or sets the string describing the domain of this document for security purposes. A valid domain. - property. In the previous URL example, setting to microsoft.com would allow both pages to communicate with one another. - - Strings assigned to the property must be valid top-level domains. In the previous URL example, you can set to microsoft.com, but not to .com, which would enable any page on the Internet to script a page's contents. - - You cannot use the property to enable cross-frame scripting for pages accessed using two different protocols. If one frame in your page comes from a Web server (the http:// protocol) and another comes from the file system (the file://) protocol, they will not be able to communicate with one another regardless of the value of the property. - + property. In the previous URL example, setting to microsoft.com would allow both pages to communicate with one another. + + Strings assigned to the property must be valid top-level domains. In the previous URL example, you can set to microsoft.com, but not to .com, which would enable any page on the Internet to script a page's contents. + + You cannot use the property to enable cross-frame scripting for pages accessed using two different protocols. If one frame in your page comes from a Web server (the http:// protocol) and another comes from the file system (the file://) protocol, they will not be able to communicate with one another regardless of the value of the property. + ]]> The argument for the Domain property must be a valid domain name using Domain Name System (DNS) conventions. @@ -701,19 +701,19 @@ Gets the unmanaged interface pointer for this . An representing an IDispatch pointer to the unmanaged document. - is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLDocument2`, you can use this object to query for them. - - To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `IDispatch::Invoke` method. - -## Examples - The following code example casts the to an `IHTMLDocument2` pointer and displays the value of the `lastModified` property, which tells when the owner of the document last updated its contents. The code example requires that you have a on your form named `Button6`. - + is a wrapper for the Internet Explorer Document Object Model (DOM), which is written in COM. If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLDocument2`, you can use this object to query for them. + + To use the unmanaged interfaces, import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `IDispatch::Invoke` method. + +## Examples + The following code example casts the to an `IHTMLDocument2` pointer and displays the value of the `lastModified` property, which tells when the owner of the document last updated its contents. The code example requires that you have a on your form named `Button6`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet3"::: + ]]> IHTMLDocument2 Interface @@ -817,14 +817,14 @@ The value to assign using the command. Not applicable for all commands. Executes the specified command against the document. - exposes a large array of commands for which there are no methods exposed on . Using you can insert new HTML elements, select and format text, and clear any cached authentication credentials. For a full list of commands, see [Command Identifiers](https://go.microsoft.com/fwlink/?LinkId=198814). - + exposes a large array of commands for which there are no methods exposed on . Using you can insert new HTML elements, select and format text, and clear any cached authentication credentials. For a full list of commands, see [Command Identifiers](https://go.microsoft.com/fwlink/?LinkId=198814). + > [!NOTE] -> Certain commands, such as copy, have return values. In the current implementation of , you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a reference instead. - +> Certain commands, such as copy, have return values. In the current implementation of , you cannot obtain a return value from your call. To retrieve return values, use the corresponding unmanaged method on a reference instead. + ]]> execCommand Method @@ -863,11 +863,11 @@ Sets user input focus on the current document. - will set focus on the control, if the control currently does not have focus. If the document is hosted inside of a `FRAME`, this method will put focus on that `FRAME` within the `FRAMESET`. - + will set focus on the control, if the control currently does not have focus. If the document is hosted inside of a `FRAME`, this method will put focus on that `FRAME` within the `FRAMESET`. + ]]> focus Method @@ -937,21 +937,21 @@ Occurs before focus is given to the document. - 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 type named `HtmlDocument1`. Then 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 run the example code, paste it into a project that contains an instance of type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet424"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet424"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet424"::: + ]]> onfocusin Event @@ -983,11 +983,11 @@ Gets or sets the text color for the document. The color of the text in the document. - type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]> @@ -1022,23 +1022,23 @@ Gets a collection of all of the <FORM> elements in the document. An of the <FORM> elements within the document. - and calling its `Submit` method using the method. - - To add a new `FORM` to a document, you can either create a new `FORM` tag as a string, and assign it to the property of an element previously added to the HTML DOM; or you can use the method, set its properties using , and add it as a child of an existing element using . - - - -## Examples - The following code example iterates through all of the `Form` elements on a Web page and clears all user input, setting the forms back to their default values. - + and calling its `Submit` method using the method. + + To add a new `FORM` to a document, you can either create a new `FORM` tag as a string, and assign it to the property of an element previously added to the HTML DOM; or you can use the method, set its properties using , and add it as a child of an existing element using . + + + +## Examples + The following code example iterates through all of the `Form` elements on a Web page and clears all user input, setting the forms back to their default values. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet4"::: + ]]> forms Property @@ -1076,19 +1076,19 @@ Retrieves a single using the element's ID attribute as a search key. Returns the first object with the same ID attribute as the specified value, or if the cannot be found. - will return the first one it finds. - - - -## Examples - The following code example retrieves a named `TABLE` from a document, counts up the number of rows, and displays the result in the Web page. The code example requires that you have a control in your project named `WebBrowser1`, and that you have loaded a Web page with a `TABLE` whose `ID` attribute is `Table1`. - + will return the first one it finds. + + + +## Examples + The following code example retrieves a named `TABLE` from a document, counts up the number of rows, and displays the result in the Web page. The code example requires that you have a control in your project named `WebBrowser1`, and that you have loaded a Web page with a `TABLE` whose `ID` attribute is `Table1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet5"::: + ]]> getElementById Method @@ -1125,19 +1125,19 @@ Retrieves the HTML element located at the specified client coordinates. The at the specified screen location in the document. - uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the property. - - - -## Examples - The following code example detects a click on the document, finds the element, and uses to align the element with the top of the Web page. - + uses client coordinates, in which the upper-left corner of the document is assigned the value (0,0). Client coordinates for the current position of the cursor can be obtained using the property. + + + +## Examples + The following code example detects a click on the document, finds the element, and uses to align the element with the top of the Web page. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet7"::: + ]]> elementFromPoint Method @@ -1173,14 +1173,14 @@ Retrieve a collection of elements with the specified HTML tag. The collection of elements who tag name is equal to the argument. - control named `WebBrowser1`. - + control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: + ]]> getElementsByTagName Method @@ -1241,21 +1241,21 @@ Gets a collection of all image tags in the document. A collection of objects, one for each IMG tag in the document. Elements are returned from the collection in source order. - returns a collection of objects. To access attributes, such as `ALT` and `SRC`, that are not directly exposed by , use the method. - - To add a new image to a document, either create a new `IMG` tag as a string, and assign it to the property of an element previously added to the HTML DOM; or use the method, set its properties using , and add it as a child of an existing element using . - - - -## Examples - The following code example examines the `ALT` attribute of all of the images in the document, and sets a default `ALT` attribute if a value is not already set. - + returns a collection of objects. To access attributes, such as `ALT` and `SRC`, that are not directly exposed by , use the method. + + To add a new image to a document, either create a new `IMG` tag as a string, and assign it to the property of an element previously added to the HTML DOM; or use the method, set its properties using , and add it as a child of an existing element using . + + + +## Examples + The following code example examines the `ALT` attribute of all of the images in the document, and sets a default `ALT` attribute if a value is not already set. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet8"::: + ]]> images Property @@ -1269,28 +1269,28 @@ Executes an Active Scripting function defined in an HTML page. - - - - - - - -``` - + + + + + + + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: + ]]> @@ -1332,56 +1332,56 @@ window.alert("Name is " + name + "; address is " + address); Executes an Active Scripting function defined in an HTML page. The object returned by the Active Scripting call. - will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. - - You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript. - - The will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. - -## Examples - The following code example executes the contents of a script in a Web page. The code example requires that you have a in your application called `WebBrowser1`, and that you have loaded the following Web page. - + will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. + + You may call any function written in any Active Scripting language installed on the user's computer, including JScript and VBScript. + + The will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. + +## Examples + The following code example executes the contents of a script in a Web page. The code example requires that you have a in your application called `WebBrowser1`, and that you have loaded the following Web page. + ```html - - - - Invoke Script Sample - - - - - - -
-
- - - - -``` - + + + + Invoke Script Sample + + + + + + +
+
+ + + + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet12"::: + ]]>
@@ -1426,35 +1426,35 @@ window.alert("Name is " + name + "; address is " + address); Executes an Active Scripting function defined in an HTML page. The object returned by the Active Scripting call. - will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. - - You may call any function written in any Active Scripting language installed on the user's machine, including JScript and VBScript. - - This method will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. - -## Examples - The following code example executes the contents of a script in a Web page. The code example requires that you have a in your application called `WebBrowser1`, and that you have loaded the following Web page. - -``` - - - - - - - -``` - + will vary. If the called Active Scripting function returns scalar data, such as a string or an integer, it will be returned as a string. If it returns a script-based object, such as an object created using JScript or VBScript's `new` operator, it will be of type `Object`. (You can make calls on such objects by calling and using .) If it returns an HTML DOM element, such as a `DIV` or a `TABLE`, it will be of type `Object`; if you have added a project reference to MSHTML.DLL, however, it will be cast to its specific unmanaged DOM type. + + You may call any function written in any Active Scripting language installed on the user's machine, including JScript and VBScript. + + This method will do nothing if the user has explicitly turned off script execution in Internet Explorer, or if the current security configuration for the Web page does not allow it. + +## Examples + The following code example executes the contents of a script in a Web page. The code example requires that you have a in your application called `WebBrowser1`, and that you have loaded the following Web page. + +``` + + + + + + + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet9"::: + ]]>
@@ -1485,11 +1485,11 @@ window.alert("Name is " + name + "; address is " + address); Gets or sets the color of hyperlinks. The color for hyperlinks in the current document. - type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. - + type in the .NET Framework supports an `Alpha` value, but the HTML DOM does not. Therefore, `Alpha` will have no effect when assigned to this property. + ]]> @@ -1524,13 +1524,13 @@ window.alert("Name is " + name + "; address is " + address); Gets a list of all the hyperlinks within this HTML document. An of objects. - objects contained within this collection encapsulate the unmanaged `IHTMLLinkElement` interface. To access the properties of the underlying interface safely, use the method. - + objects contained within this collection encapsulate the unmanaged `IHTMLLinkElement` interface. To access the properties of the underlying interface safely, use the method. + ]]> links Property @@ -1568,21 +1568,21 @@ window.alert("Name is " + name + "; address is " + address); Occurs while focus is leaving a control. - 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 type named `HtmlDocument1`. Then 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 run the example code, paste it into a project that contains an instance of type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet425"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet425"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet425"::: + ]]> onfocusout Event @@ -1620,23 +1620,23 @@ window.alert("Name is " + name + "; address is " + address); Occurs when the user clicks the left mouse button. - event occurs before the event. - - 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. - + event occurs before the event. + + 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet426"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet426"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet426"::: + ]]> onmousedown Event @@ -1674,21 +1674,21 @@ window.alert("Name is " + name + "; address is " + address); Occurs when the mouse is no longer hovering over the document. - 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 type named `HtmlDocument1`. Then 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet427"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet427"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet427"::: + ]]> onmouseout Event @@ -1726,21 +1726,21 @@ window.alert("Name is " + name + "; address is " + address); Occurs when the mouse is moved over the document. - 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 type named `HtmlDocument1`. Then 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet428"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet428"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet428"::: + ]]> onmousemove Event @@ -1778,21 +1778,21 @@ window.alert("Name is " + name + "; address is " + address); Occurs when the mouse is moved over the document. - 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 type named `HtmlDocument1`. Then 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet429"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet429"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet429"::: + ]]> onmouseover Event @@ -1830,21 +1830,21 @@ window.alert("Name is " + name + "; address is " + address); Occurs when the user releases the left mouse button. - 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 type named `HtmlDocument1`. Then 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 type named `HtmlDocument1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet430"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet430"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet430"::: + ]]> onmouseup Event @@ -1955,21 +1955,21 @@ window.alert("Name is " + name + "; address is " + address); Gets a new to use with the method. A new document for writing. - will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in to be raised. - - always creates a new document in the current window. To open a document in a new window, use the method on the class. - - - -## Examples - The following code example prepares the DOM for writing and writes a new document using the method. - + will clear the previous loaded document, including any associated state, such as variables. It will not cause navigation events in to be raised. + + always creates a new document in the current window. To open a document in a new window, use the method on the class. + + + +## Examples + The following code example prepares the DOM for writing and writes a new document using the method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: + ]]> open Method @@ -2002,13 +2002,13 @@ window.alert("Name is " + name + "; address is " + address); if text renders from right to left; otherwise, . - will not have any value unless it has been set explicitly, either in code or in HTML. - - Unlike the property on Windows Forms controls, on the managed HTML DOM will not affect the direction of Latin text. - + will not have any value unless it has been set explicitly, either in code or in HTML. + + Unlike the property on Windows Forms controls, on the managed HTML DOM will not affect the direction of Latin text. + ]]> dir Property @@ -2046,20 +2046,20 @@ window.alert("Name is " + name + "; address is " + address); Occurs when navigation to another Web page is halted. - method of the control. Navigation failures caused by network outages or malfunctioning Web sites will not cause to occur. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example resets the status bar on a Windows Forms application when the `Stop` event has occurred. The code example requires that you have a control named `StatusBar1` in your application. - - :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: - + method of the control. Navigation failures caused by network outages or malfunctioning Web sites will not cause to occur. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example resets the status bar on a Windows Forms application when the `Stop` event has occurred. The code example requires that you have a control named `StatusBar1` in your application. + + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet15"::: + ]]> onstop Event @@ -2091,21 +2091,21 @@ window.alert("Name is " + name + "; address is " + address); Gets or sets the text value of the <TITLE> tag in the current HTML document. The title of the current document. - property to identify the document by way of a human-readable name. - - Changes to this property will also reflect in the property of the control. - - - -## Examples - The following code example creates an HTML hyperlink to the current document using the URL of the document as the link's location and the title of the document as the link text. The code example requires that your application has a control named `WebBrowser1`. - + property to identify the document by way of a human-readable name. + + Changes to this property will also reflect in the property of the control. + + + +## Examples + The following code example creates an HTML hyperlink to the current document using the URL of the document as the link's location and the title of the document as the link text. The code example requires that your application has a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet14"::: + ]]> @@ -2145,11 +2145,11 @@ window.alert("Name is " + name + "; address is " + address); Gets the URL describing the location of this document. A representing this document's URL. - property on the control. - + property on the control. + ]]> @@ -2180,11 +2180,11 @@ window.alert("Name is " + name + "; address is " + address); Gets or sets the Color of links to HTML pages that the user has already visited. The color of visited links. - @@ -2226,11 +2226,11 @@ window.alert("Name is " + name + "; address is " + address); Gets the associated with this document. The window for this document. - . - + . + ]]> parentWindow Property @@ -2265,21 +2265,21 @@ window.alert("Name is " + name + "; address is " + address); The HTML text to write into the document. Writes a new HTML page. - should be preceded by a call to , which will clear the current document and all of its variables. Your calls to will create a new HTML document in its place. To change only a specific portion of the document, obtain the appropriate and set its property. - - It is recommended that you write an entire valid HTML document using the method, including `HTML` and `BODY` tags. However, if you write just HTML elements, the Document Object Model (DOM) will supply these elements for you. - - - -## Examples - The following code example opens a new and writes in a new HTML file. - + should be preceded by a call to , which will clear the current document and all of its variables. Your calls to will create a new HTML document in its place. To change only a specific portion of the document, obtain the appropriate and set its property. + + It is recommended that you write an entire valid HTML document using the method, including `HTML` and `BODY` tags. However, if you write just HTML elements, the Document Object Model (DOM) will supply these elements for you. + + + +## Examples + The following code example opens a new and writes in a new HTML file. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet11"::: + ]]> diff --git a/xml/System.Windows.Forms/HtmlElement.xml b/xml/System.Windows.Forms/HtmlElement.xml index eb75e6b8998..297d155831a 100644 --- a/xml/System.Windows.Forms/HtmlElement.xml +++ b/xml/System.Windows.Forms/HtmlElement.xml @@ -29,27 +29,27 @@ Represents an HTML element inside of a Web page. - represents any possible type of element in an HTML document, such as `BODY`, `TABLE`, and `FORM`, among others. The class exposes the most common properties you can expect to find on all elements. - - Most elements can have *child elements*: other HTML elements that are placed underneath them. Use the property to test whether a given element has children, and the collection to iterate through them. The property returns the in which the current element is nested. - - You often need access to attributes, properties, and methods on the underlying element that are not directly exposed by , such as the `SRC` attribute on an `IMG` element or the `Submit` method on a `FORM`. The and methods enable you to retrieve and alter any attribute or property on a specific element, while provides access to any methods not exposed in the managed Document Object Model (DOM). If your application has unmanaged code permission, you can also access unexposed properties and methods with the attribute. - - Use the property to test whether an element is of a specific type. - - Any HTML document can be modified at run time. You can create new objects with the method of , and add them to another element using the or methods. You can also create the elements as HTML tags and assign them to an existing element's property. - - - -## Examples - The following code example shows how to examine an arbitrary HTML document and derive a string describing the HTML elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. This code example requires that your application hosts a control named `WebBrowser1`. - + represents any possible type of element in an HTML document, such as `BODY`, `TABLE`, and `FORM`, among others. The class exposes the most common properties you can expect to find on all elements. + + Most elements can have *child elements*: other HTML elements that are placed underneath them. Use the property to test whether a given element has children, and the collection to iterate through them. The property returns the in which the current element is nested. + + You often need access to attributes, properties, and methods on the underlying element that are not directly exposed by , such as the `SRC` attribute on an `IMG` element or the `Submit` method on a `FORM`. The and methods enable you to retrieve and alter any attribute or property on a specific element, while provides access to any methods not exposed in the managed Document Object Model (DOM). If your application has unmanaged code permission, you can also access unexposed properties and methods with the attribute. + + Use the property to test whether an element is of a specific type. + + Any HTML document can be modified at run time. You can create new objects with the method of , and add them to another element using the or methods. You can also create the elements as HTML tags and assign them to an existing element's property. + + + +## Examples + The following code example shows how to examine an arbitrary HTML document and derive a string describing the HTML elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. This code example requires that your application hosts a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: + ]]> IHTMLElement Interface @@ -90,13 +90,13 @@ Gets an of all elements underneath the current element. A collection of all elements that are direct or indirect children of the current element. If the current element is a TABLE, for example, will return every TH, TR, and TD element within the table, as well as any other elements, such as DIV and SPAN elements, contained within the cells. - collection instead. - - Elements in this collection will not necessarily be returned in source order. - + collection instead. + + Elements in this collection will not necessarily be returned in source order. + ]]> @@ -139,23 +139,23 @@ Adds an element to another element's subtree. The element after it has been added to the tree. - to add new elements to an existing document, or to move an element on the page. - - If an element has already been parented, appending an element to another element will automatically remove that element from its previous parent. - - Any additions made to a document at run-time using will not be persisted when you call the method on the control. - - - -## Examples - The following code example creates a new hyperlink using the method and adds it to end of a page using `AppendChild` on the `BODY` element. The example requires that your application contains a control named `WebBrowser1`. - + to add new elements to an existing document, or to move an element on the page. + + If an element has already been parented, appending an element to another element will automatically remove that element from its previous parent. + + Any additions made to a document at run-time using will not be persisted when you call the method on the control. + + + +## Examples + The following code example creates a new hyperlink using the method and adds it to end of a page using `AppendChild` on the `BODY` element. The example requires that your application contains a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: + ]]> @@ -193,15 +193,15 @@ The managed code that handles the event. Adds an event handler for a named event on the HTML Document Object Model (DOM). - to add an event handler to these unexposed events. - - You should not attach an event to the document or one of its objects until the document has completed loading. The earliest you should call this method is in the event of the control. - - For more information about the available unmanaged events, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model) and the IHTMLElement interfaces: [IHTMLElement](https://go.microsoft.com/fwlink/?LinkId=104876), [IHTMLElement2](https://go.microsoft.com/fwlink/?LinkId=104877), [IHTMLElement3](https://go.microsoft.com/fwlink/?LinkId=104878), [IHTMLElement4](https://go.microsoft.com/fwlink/?LinkId=104879). - + to add an event handler to these unexposed events. + + You should not attach an event to the document or one of its objects until the document has completed loading. The earliest you should call this method is in the event of the control. + + For more information about the available unmanaged events, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model) and the IHTMLElement interfaces: [IHTMLElement](https://go.microsoft.com/fwlink/?LinkId=104876), [IHTMLElement2](https://go.microsoft.com/fwlink/?LinkId=104877), [IHTMLElement3](https://go.microsoft.com/fwlink/?LinkId=104878), [IHTMLElement4](https://go.microsoft.com/fwlink/?LinkId=104879). + ]]> EventTarget.addEventListener() @@ -234,19 +234,19 @@ if element can have child elements; otherwise, . - or on an arbitrary element. - - - -## Examples - The following code example handles the event on . If an element was not previous selected using a mouse click, the code assigns the element to a private class variable named `MoveElement`. If an element was selected, the code attempts to append it to the element that was just clicked. This code example requires that your application hosts a control named `WebBrowser1`, and that you have already added an event handler for the event on . - + or on an arbitrary element. + + + +## Examples + The following code example handles the event on . If an element was not previous selected using a mouse click, the code assigns the element to a private class variable named `MoveElement`. If an element was selected, the code attempts to append it to the element that was just clicked. This code example requires that your application hosts a control named `WebBrowser1`, and that you have already added an event handler for the event on . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet2"::: + ]]> @@ -283,25 +283,25 @@ Gets an of all children of the current element. A collection of all objects that have the current element as a parent. - collection provides a simple mechanism for exploring the tree structure of a document. - - only exposes elements whose direct parent is the current element. If you have an for a `TABLE` element, will give you all of the `TR` (row) elements inside of the `TABLE`. To retrieve the `TD` (cell) elements contained inside of the `TR` elements, you will need to use either the collection on each individual `TR` element, or use the collection on . - - Elements in this collection are not guaranteed to be in source order. - - If is `false`, `Children` will always be empty. - - - -## Examples - The following code example examines an arbitrary HTML document and derive a string describing the elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. It does this by searching the `Children` collection of all elements recursively, starting with the HTML element at the top of the document. This code example requires that your application has a control named `WebBrowser1`. - + collection provides a simple mechanism for exploring the tree structure of a document. + + only exposes elements whose direct parent is the current element. If you have an for a `TABLE` element, will give you all of the `TR` (row) elements inside of the `TABLE`. To retrieve the `TD` (cell) elements contained inside of the `TR` elements, you will need to use either the collection on each individual `TR` element, or use the collection on . + + Elements in this collection are not guaranteed to be in source order. + + If is `false`, `Children` will always be empty. + + + +## Examples + The following code example examines an arbitrary HTML document and derive a string describing the elements, with indentation and level numbers used to indicate how deeply nested the elements are in the document. It does this by searching the `Children` collection of all elements recursively, starting with the HTML element at the top of the document. This code example requires that your application has a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -333,25 +333,25 @@ Occurs when the user clicks on the element with the left mouse button. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - If the user clicks on an element that does not currently have input focus, the event will occur after the event, but before the event for that element. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + If the user clicks on an element that does not currently have input focus, the event will occur after the event, but before the event for that element. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet432"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet432"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet432"::: + ]]> onclick Event @@ -383,35 +383,35 @@ Gets the bounds of the client area of the element in the HTML document. The client area occupied by the element, minus any area taken by borders and scroll bars. To obtain the position and dimensions of the element inclusive of its adornments, use instead. - will return position data only for elements that have been assigned an explicit height and width, or elements that use absolute positioning. A document is absolutely positioned if its position style is set to `absolute`, after which it can be positioned at any coordinate on the HTML page. - - - -## Examples - Assume you have loaded the following HTML page into a hosted instance of the control. - -``` - - - - -
- Edit this text. -
- - - - -``` - - The following code example demonstrates retrieving this element and expanding its dimensions if the client area is less than 400 pixels wide by 50 pixels high, and also sets the `DIV` to the `contentEditable` state so that the user can input text. - + will return position data only for elements that have been assigned an explicit height and width, or elements that use absolute positioning. A document is absolutely positioned if its position style is set to `absolute`, after which it can be positioned at any coordinate on the HTML page. + + + +## Examples + Assume you have loaded the following HTML page into a hosted instance of the control. + +``` + + + + +
+ Edit this text. +
+ + + + +``` + + The following code example demonstrates retrieving this element and expanding its dimensions if the client area is less than 400 pixels wide by 50 pixels high, and also sets the `DIV` to the `contentEditable` state so that the user can input text. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet3"::: + ]]>
@@ -482,11 +482,11 @@ Gets the to which this element belongs. The parent document of this element. - . This property is most useful when you have received a reference to an element in an event handler from the , and need to perform some action on the document in which the element resides. - + . This property is most useful when you have received a reference to an element in an event handler from the , and need to perform some action on the document in which the element resides. + ]]> @@ -528,19 +528,19 @@ Gets an unmanaged interface pointer for this element. The COM IUnknown pointer for the element, which you can cast to one of the HTML element interfaces, such as IHTMLElement. - is a wrapper for the Internet Explorer Document Object Model (DOM), which is written using the Component Object Model (COM). If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLElement`, you can use this object to query for them. - - In order to use the unmanaged interfaces, you will need to import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `Invoke` method. - -## Examples - The following code example uses unmanaged interfaces to take the currently selected text and convert it into a hyperlink, with the URL chosen by the user. This code was written under the assumption that your form has a control named `WebBrowser1`, and that you have added the unmanaged MSHTML library as a reference to your project. - + is a wrapper for the Internet Explorer Document Object Model (DOM), which is written using the Component Object Model (COM). If you need to access unexposed properties or methods on the underlying COM interfaces, such as `IHTMLElement`, you can use this object to query for them. + + In order to use the unmanaged interfaces, you will need to import the MSHTML library (mshtml.dll) into your application. However, you can also execute unexposed properties and methods using the `Invoke` method. + +## Examples + The following code example uses unmanaged interfaces to take the currently selected text and convert it into a hyperlink, with the URL chosen by the user. This code was written under the assumption that your form has a control named `WebBrowser1`, and that you have added the unmanaged MSHTML library as a reference to your project. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet4"::: + ]]> @@ -573,25 +573,25 @@ Occurs when the user clicks the left mouse button over an element twice, in rapid succession. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet433"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet433"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet433"::: + ]]> ondblclick Event @@ -623,27 +623,27 @@ Occurs when the user drags text to various locations. - control or Internet Explorer. - To another application. - To the Windows desktop. - - You can cancel the default action for a event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + + You can cancel the default action for a event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet434"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet434"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet434"::: + ]]> ondrag Event @@ -675,23 +675,23 @@ Occurs when a user finishes a drag operation. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet435"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet435"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet435"::: + ]]> ondragend Event @@ -723,16 +723,16 @@ Occurs when the user is no longer dragging an item over this element. - 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 type named `HtmlElement1`. Then 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet436"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet436"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet436"::: + ]]> @@ -763,23 +763,23 @@ Occurs when the user drags text over the element. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet437"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet437"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet437"::: + ]]> ondragover Event @@ -812,11 +812,11 @@ if the element allows user input; otherwise, . - to `false` will prevent the user from using these form fields. For other elements, such as `DIV` or `SPAN`, setting to `false` will cause all text within the element to appear shaded; however, the text will still be selectable. To cancel selection, add an event handler for the unexposed `onselectstart` event using the method. - + to `false` will prevent the user from using these form fields. For other elements, such as `DIV` or `SPAN`, setting to `false` will cause all text within the element to appear shaded; however, the text will still be selectable. To cancel selection, add an event handler for the unexposed `onselectstart` event using the method. + ]]> disabled Property @@ -883,11 +883,11 @@ Gets the next element below this element in the document tree. An representing the first element contained underneath the current element, in source order. - in conjunction with to walk the document tree for an HTML document. - + in conjunction with to walk the document tree for an HTML document. + ]]> firstChild Property @@ -919,13 +919,13 @@ Puts user input focus on the current element. - property of . - - Any key strokes entered by a user after has been called will be sent to that element. - + property of . + + Any key strokes entered by a user after has been called will be sent to that element. + ]]> focus Method @@ -957,25 +957,25 @@ Occurs when the element first receives user input focus. - and events again when the user switches back to your application. - - You cannot cancel the default behavior of this event. To remove focus from an element, call on a different element from within the event. - - A event on an element will also occur on that element's parents and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + and events again when the user switches back to your application. + + You cannot cancel the default behavior of this event. To remove focus from an element, call on a different element from within the event. + + A event on an element will also occur on that element's parents and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet438"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet438"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet438"::: + ]]> onfocusin Event @@ -1011,21 +1011,21 @@ Retrieves the value of the named attribute on the element. The value of this attribute on the element, as a value. If the specified attribute does not exist on this element, returns an empty string. - exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use and to manipulate attributes not exposed on the managed Document Object Model (DOM). - - and are case-insensitive. - - - -## Examples - The following code example retrieves all of the `META` tags within an HTML document, using to find the `META` tag with the name `Description`. The example requires that your application has a control named `WebBrowser1`. - + exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use and to manipulate attributes not exposed on the managed Document Object Model (DOM). + + and are case-insensitive. + + + +## Examples + The following code example retrieves all of the `META` tags within an HTML document, using to find the `META` tag with the name `Description`. The example requires that your application has a control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlDocument/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlDocument/VB/Form1.vb" id="Snippet6"::: + ]]> getAttribute Method @@ -1120,33 +1120,33 @@ Occurs when the element has received user input focus. - on a different element from within the event. - - - -## Examples - Save the following HTML code into a file, and load the file into a control in a Windows Forms project. - -``` - - -
- - - -
- - -``` - - The following code example prevents the next `INPUT` element in the tab order from receiving user input focus if the previous element contains less than five characters. The example requires that the previously mentioned HTML file is loaded into an instance of the control named `WebBrowser1`. - + on a different element from within the event. + + + +## Examples + Save the following HTML code into a file, and load the file into a control in a Windows Forms project. + +``` + + +
+ + + +
+ + +``` + + The following code example prevents the next `INPUT` element in the tab order from receiving user input focus if the previous element contains less than five characters. The example requires that the previously mentioned HTML file is loaded into an instance of the control named `WebBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet15"::: + ]]>
onfocus Event @@ -1184,11 +1184,11 @@ Gets or sets a label by which to identify the element. The unique identifier for the element. - must be unique; you cannot have two elements with the same inside of the same document. Use the property to give the same identifier to a group of logically related elements. - + must be unique; you cannot have two elements with the same inside of the same document. Use the property to give the same identifier to a group of logically related elements. + ]]> @@ -1228,21 +1228,21 @@ Gets or sets the HTML markup underneath this element. The HTML markup that defines the child elements of the current element. - and methods. Using is often the fastest way to add new content when you have to set many attributes or styles on your new elements. - - differs from in that will not include the HTML that represents the object you are calling. See for more information about the difference between these two properties. - - Setting destroys any children previously appended to the element. If you retrieve an element from the DOM and then assign new HTML to its parents' property, your reference to that element will be useless, and its behavior when it calls its properties and methods is undefined. - - For some elements, setting is not a valid operation. Some HTML tags have no closing tag, such as the `IMG` tag, and therefore cannot contain nested elements. Some tags, such as the `SCRIPT` tag, can only contain text content; setting will result in an error. For both types of tags, the property will return `false`. However, you also cannot set on `TABLE` and `TR` elements, as assigning malformed HTML to these elements could corrupt the rendering of the document. Use or the `insertRow` and `insertCell` methods on the unmanaged `IHTMLTable` interface to add rows and cells to a `TABLE`. - - If you need only to assign text to an element and not HTML markup, use the property instead. - - Assigning a value to will destroy any text values previously assigned using . - + and methods. Using is often the fastest way to add new content when you have to set many attributes or styles on your new elements. + + differs from in that will not include the HTML that represents the object you are calling. See for more information about the difference between these two properties. + + Setting destroys any children previously appended to the element. If you retrieve an element from the DOM and then assign new HTML to its parents' property, your reference to that element will be useless, and its behavior when it calls its properties and methods is undefined. + + For some elements, setting is not a valid operation. Some HTML tags have no closing tag, such as the `IMG` tag, and therefore cannot contain nested elements. Some tags, such as the `SCRIPT` tag, can only contain text content; setting will result in an error. For both types of tags, the property will return `false`. However, you also cannot set on `TABLE` and `TR` elements, as assigning malformed HTML to these elements could corrupt the rendering of the document. Use or the `insertRow` and `insertCell` methods on the unmanaged `IHTMLTable` interface to add rows and cells to a `TABLE`. + + If you need only to assign text to an element and not HTML markup, use the property instead. + + Assigning a value to will destroy any text values previously assigned using . + ]]> Creating child elements on this element is not allowed. @@ -1285,21 +1285,21 @@ Gets or sets the text assigned to the element. The element's text, absent any HTML markup. If the element contains child elements, only the text in those child elements will be preserved. - , the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the property, will return all of the text in that HTML with the markup removed. - - Assigning a value to will destroy any child elements that belong to the element. - - - -## Examples - The following code creates a new hyperlink using , and assigns text to the link using the property. - + , the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the property, will return all of the text in that HTML with the markup removed. + + Assigning a value to will destroy any child elements that belong to the element. + + + +## Examples + The following code creates a new hyperlink using , and assigns text to the link using the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet8"::: + ]]> The specified element cannot contain text (for example, an IMG element). @@ -1347,21 +1347,21 @@ Insert a new element into the Document Object Model (DOM). The that was just inserted. If insertion failed, this will return . - event on the control has occurred. Calling this method before then can result in an exception, as the document will not have finished loading. - - Whether a value of is valid will depend on the type of the element. For example, is valid if the element is a `DIV`, but not if it is a `SCRIPT` or `IMG` element, neither of which can contain child elements. - - - -## Examples - The following code example inserts a `DIV` element into the top of every page that users view outside of the ADatum.com server. The example requires that your form contains a control named `WebBrowser1`. Your sample must also import the namespace . - + event on the control has occurred. Calling this method before then can result in an exception, as the document will not have finished loading. + + Whether a value of is valid will depend on the type of the element. For example, is valid if the element is a `DIV`, but not if it is a `SCRIPT` or `IMG` element, neither of which can contain child elements. + + + +## Examples + The following code example inserts a `DIV` element into the top of every page that users view outside of the ADatum.com server. The example requires that your form contains a control named `WebBrowser1`. Your sample must also import the namespace . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet9"::: + ]]> insertAdjacentElement Method @@ -1413,11 +1413,11 @@ Executes an unexposed method on the underlying DOM element of this element. The element returned by this method, represented as an . If this is another HTML element, and you have a reference to the unmanaged MSHTML library added to your project, you can cast it to its appropriate unmanaged interface. - to execute unexposed methods that take no arguments. For an example, see . - + to execute unexposed methods that take no arguments. For an example, see . + ]]>
@@ -1466,19 +1466,19 @@ Executes a function defined in the current HTML page by a scripting language. The element returned by the function, represented as an . If this is another HTML element, and you have a reference to the unmanaged MSHTML library added to your project, you can cast it to its appropriate unmanaged interface. - will be converted to Win32 `VARIANT` data types before they are passed to the named scripting function. - - - -## Examples - The following code example gets a `TABLE` called `dataTable` and uses the unexposed `moveRow` method to move a row from the end of the table to the beginning. - + will be converted to Win32 `VARIANT` data types before they are passed to the named scripting function. + + + +## Examples + The following code example gets a `TABLE` called `dataTable` and uses the unexposed `moveRow` method to move a row from the end of the table to the beginning. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet11"::: + ]]>
@@ -1509,25 +1509,25 @@ Occurs when the user presses a key on the keyboard. - occurs before , which in turns occurs before . - - You can cancel the default action for a event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + occurs before , which in turns occurs before . + + You can cancel the default action for a event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet442"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet442"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet442"::: + ]]> onkeydown Event @@ -1559,25 +1559,25 @@ Occurs when the user presses and releases a key on the keyboard. - occurs after and before . - - You can cancel the default action for a event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + occurs after and before . + + You can cancel the default action for a event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet443"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet443"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet443"::: + ]]> onkeypress Event @@ -1609,25 +1609,25 @@ Occurs when the user releases a key on the keyboard. - occurs after , which occurs after . - - You cannot cancel this event. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + occurs after , which occurs after . + + You cannot cancel this event. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet444"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet444"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet444"::: + ]]> onkeyup Event @@ -1659,16 +1659,16 @@ Occurs when the element is losing user input focus. - 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 type named `HtmlElement1`. Then 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 run the example code, paste it into a project that contains an instance of type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet440"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet440"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet440"::: + ]]> @@ -1699,25 +1699,25 @@ Occurs when the element has lost user input focus. - occurs until it is given focus again, either by the user selecting it on the page or by the application calling the method on that element. - - You cannot cancel this event. - - An event on an element will also occur on that element's parents and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + occurs until it is given focus again, either by the user selecting it on the page or by the application calling the method on that element. + + You cannot cancel this event. + + An event on an element will also occur on that element's parents and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet441"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet441"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet441"::: + ]]> onfocusout Event @@ -1749,23 +1749,23 @@ Occurs when the user presses a mouse button. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet446"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet446"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet446"::: + ]]> onmousedown Event @@ -1797,16 +1797,16 @@ Occurs when the user first moves the mouse cursor over the current element. - 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 type named `HtmlElement1`. Then 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet449"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet449"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet449"::: + ]]> @@ -1837,16 +1837,16 @@ Occurs when the user moves the mouse cursor off of the current element. - 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 type named `HtmlElement1`. Then 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet450"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet450"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet450"::: + ]]> @@ -1877,23 +1877,23 @@ Occurs when the user moves the mouse cursor across the element. - event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet445"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet445"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet445"::: + ]]> onmousemove Event @@ -1925,23 +1925,23 @@ Occurs when the mouse cursor enters the bounds of the element. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet447"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet447"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet447"::: + ]]> onmouseover Event @@ -1973,23 +1973,23 @@ Occurs when the user releases a mouse button. - event on an element by setting the property of the class to `true`. - - A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. - - - -## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. - + event on an element by setting the property of the class to `true`. + + A event on an element will also occur on that element's parent elements and on the class itself, unless you set the property of the class to `true`. + + + +## 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 type named `HtmlElement1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet448"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet448"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet448"::: + ]]> onmouseup Event @@ -2035,13 +2035,13 @@ Gets or sets the name of the element. A representing the element's name. - property to retrieve elements from a document using the method on the property of . - - When applied to `INPUT` elements, defines the variable name for that element's data when its form is submitted to the server. - + property to retrieve elements from a document using the method on the property of . + + When applied to `INPUT` elements, defines the variable name for that element's data when its form is submitted to the server. + ]]> name Property @@ -2074,11 +2074,11 @@ Gets the next element at the same level as this element in the document tree. An representing the element to the right of the current element. - in conjunction with to walk the document tree for an HTML element. - + in conjunction with to walk the document tree for an HTML element. + ]]> nextSibling Property @@ -2109,49 +2109,49 @@ Gets the element from which is calculated. - The element from which the offsets are calculated. - + The element from which the offsets are calculated. + If an element's parent or another element in the element's hierarchy uses relative or absolute positioning, will be the first relatively or absolutely positioned element in which the current element is nested. If none of the elements above the current element are absolutely or relatively positioned, will be the BODY tag of the document. - and differ for `span1`, `span2` and `span3`: - -``` - - - -
- Placeholder text 1. -
- -
- Placeholder text 2. -
- -
-
- Placeholder text 3. -
-
- - - -``` - + and differ for `span1`, `span2` and `span3`: + +``` + + + +
+ Placeholder text 1. +
+ +
+ Placeholder text 2. +
+ +
+
+ Placeholder text 3. +
+
+ + + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: + ]]>
offsetParent Property @@ -2181,53 +2181,53 @@ Gets the location of an element relative to its parent. - The x- and y-coordinate positions of the element, and its width and its height, in relation to its parent. - + The x- and y-coordinate positions of the element, and its width and its height, in relation to its parent. + If an element's parent is relatively or absolutely positioned, will return the offset of the parent element. If the element itself is relatively positioned with respect to its parent, will return the offset from its parent. - and differ for `span1`, `span2` and `span3`: - -``` - - - -
- Placeholder text 1. -
- -
- Placeholder text 2. -
- -
-
- Placeholder text 3. -
-
- - - -``` - + and differ for `span1`, `span2` and `span3`: + +``` + + + +
+ Placeholder text 1. +
+ +
+ Placeholder text 2. +
+ +
+
+ Placeholder text 3. +
+
+ + + +``` + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet6"::: + ]]>
@@ -2271,11 +2271,11 @@ if both parameters are , or if both elements have the same underlying COM interface; otherwise, . - classes. - + classes. + The equivalent method for this operator is ]]>
@@ -2350,63 +2350,63 @@ Gets or sets the current element's HTML code. The HTML code for the current element and its children. - will return all HTML contained in the current element excluding the current element's surrounding tags, includes the current element's tag as well as the HTML that tag contains, for example: - - `` - - `` - - `
` - - `Hello` - - `
` - - `World` - - `
` - - `How are you?` - - `
` - - `
` - - `
` - - `` - - `` - - In this example, calling on `div2` will return: - - `
` - - `World` - - `
` - - `How are you?` - - `
` - - `
` - - Calling will return: - - `World` - - `
` - - `How are you?` - - `
` - - If you assign a new value to , the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned. - + will return all HTML contained in the current element excluding the current element's surrounding tags, includes the current element's tag as well as the HTML that tag contains, for example: + + `` + + `` + + `
` + + `Hello` + + `
` + + `World` + + `
` + + `How are you?` + + `
` + + `
` + + `
` + + `` + + `` + + In this example, calling on `div2` will return: + + `
` + + `World` + + `
` + + `How are you?` + + `
` + + `
` + + Calling will return: + + `World` + + `
` + + `How are you?` + + `
` + + If you assign a new value to , the current element reference will become invalid; it will not reflect the name, properties and child content of the HTML you have just assigned. + ]]>
@@ -2445,13 +2445,13 @@ Gets or sets the current element's text. The text inside the current element, and in the element's children. - , the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the property, will return all of the text in that HTML with the markup removed. - - Assigning a value to will destroy any child elements that belong to the element. - + , the HTML code will display as literals in the document, just as if you were viewing HTML within a text file. If you assign HTML to an element using the property, will return all of the text in that HTML with the markup removed. + + Assigning a value to will destroy any child elements that belong to the element. + ]]> You cannot set text outside of this element. @@ -2486,21 +2486,21 @@ Gets the current element's parent element. The element above the current element in the HTML document's hierarchy. - property enables discovery of an element's context. It is most useful inside of event handlers such as , which can fire for any element anywhere in the document's object hierarchy. - - The property of the HTML element (the top of an HTML document) points back to itself. If you call inside a loop, verify that the loop's break condition compares the type of the current element and the type of the `Parent` property, or else your code may execute an infinite loop. - - - -## Examples - The following code example finds all of the `IMG` tags in a document, and uses the property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. - + property enables discovery of an element's context. It is most useful inside of event handlers such as , which can fire for any element anywhere in the document's object hierarchy. + + The property of the HTML element (the top of an HTML document) points back to itself. If you call inside a loop, verify that the loop's break condition compares the type of the current element and the type of the `Parent` property, or else your code may execute an infinite loop. + + + +## Examples + The following code example finds all of the `IMG` tags in a document, and uses the property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: + ]]> parentElement Property @@ -2535,11 +2535,11 @@ The name of the event to raise. Causes the named event to call all registered event handlers. - class, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model). - + class, see [Accessing Unexposed Members on the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/accessing-unexposed-members-on-the-managed-html-document-object-model). + ]]>
@@ -2570,13 +2570,13 @@ Removes focus from the current element, if that element has focus. - event for the element. - - When focus is cleared from an element using this method, it is given to the document containing the element, not to the next element in the tab order. - + event for the element. + + When focus is cleared from an element using this method, it is given to the document containing the element, not to the next element in the tab order. + ]]> blur Method @@ -2611,14 +2611,14 @@ If , the top of the object will be displayed at the top of the window. If , the bottom of the object will be displayed at the bottom of the window. Scrolls through the document containing this element until the top or bottom edge of this element is aligned with the document's window. - scrollIntoView Method @@ -2650,11 +2650,11 @@ Gets or sets the distance between the edge of the element and the left edge of its content. The distance, in pixels, between the left edge of the element and the left edge of its content. - ; `ScrollLeft` and are exposed independently because these are the only two properties of the scroll area that developers can set. - + ; `ScrollLeft` and are exposed independently because these are the only two properties of the scroll area that developers can set. + ]]> scrollLeft Property @@ -2686,13 +2686,13 @@ Gets the dimensions of an element's scrollable region. The size and coordinate location of the scrollable area of an element. - and properties to achieve this. - + and properties to achieve this. + ]]> scrollLeft Property @@ -2727,11 +2727,11 @@ Gets or sets the distance between the edge of the element and the top edge of its content. The distance, in pixels, between the top edge of the element and the top edge of its content. - ; and `ScrollTop` are exposed independently because these are the only two properties of the scroll area that developers can set. - + ; and `ScrollTop` are exposed independently because these are the only two properties of the scroll area that developers can set. + ]]> scrollTop Property @@ -2768,25 +2768,25 @@ The new value of this attribute. Sets the value of the named attribute on the element. - exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use and to manipulate attributes not exposed on the managed Document Object Model (DOM). - - If `attributeName` is not a defined attribute on an element, will define it on the element as a new attribute. - - and are case-insensitive. - - To set the `class` attribute on an , you must refer to the attribute as `className` when specifying the first argument to - - - -## Examples - The following code example adds a new `IMG` element to the current document, using to set the `SRC` attribute for the image. - + exposes only those attributes that are common to all elements, leaving out those that only apply to certain types of elements; `SRC` is a predefined attribute for the `IMG` tag, for example, but not for the `DIV` tag. Use and to manipulate attributes not exposed on the managed Document Object Model (DOM). + + If `attributeName` is not a defined attribute on an element, will define it on the element as a new attribute. + + and are case-insensitive. + + To set the `class` attribute on an , you must refer to the attribute as `className` when specifying the first argument to + + + +## Examples + The following code example adds a new `IMG` element to the current document, using to set the `SRC` attribute for the image. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet13"::: + ]]> setAttribute Method @@ -2824,19 +2824,19 @@ Gets or sets a semicolon-delimited list of styles for the current element. A string consisting of all of the element's styles. - property take the form of colon-delimited name-value pairs, with each pair separated by a semicolon, as follows: - - `style-name1:value1;...;[style-nameN:valueN;]` - - To set the font for a `DIV` element to 14-point Times New Roman bold, for example, you would assign the following string: - - `font-face:Times New Roman;font-size:14px;font-weight:bold;` - - For a full list of all available styles in the HTML DOM, see [STYLE Attribute](https://developer.mozilla.org/en-us/docs/web/html/global_attributes/style). - + property take the form of colon-delimited name-value pairs, with each pair separated by a semicolon, as follows: + + `style-name1:value1;...;[style-nameN:valueN;]` + + To set the font for a `DIV` element to 14-point Times New Roman bold, for example, you would assign the following string: + + `font-face:Times New Roman;font-size:14px;font-weight:bold;` + + For a full list of all available styles in the HTML DOM, see [STYLE Attribute](https://developer.mozilla.org/en-us/docs/web/html/global_attributes/style). + ]]> @@ -2867,13 +2867,13 @@ Gets or sets the location of this element in the tab order. The numeric index of the element in the tab order. - determines which element in an HTML document will next receive focus when the user presses the TAB key. By default, the only elements included in the tab order are `INPUT` elements, the `SELECT` control, and any element whose `contentEditable` property is set to `true`. You can include any HTML element in the tab order, such as a `DIV`, by assigning it an explicit . - - Valid values for range from -32767 to 32767. - + determines which element in an HTML document will next receive focus when the user presses the TAB key. By default, the only elements included in the tab order are `INPUT` elements, the `SELECT` control, and any element whose `contentEditable` property is set to `true`. You can include any HTML element in the tab order, such as a `DIV`, by assigning it an explicit . + + Valid values for range from -32767 to 32767. + ]]> tabIndex Property @@ -2911,19 +2911,19 @@ Gets the name of the HTML tag. The name used to create this element using HTML markup. - when you have an element of a potentially arbitrary type, and need to perform a type-specific operation. - - - -## Examples - The following code example finds all of the `IMG` tags in a document, and uses the `TagName` property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. - + when you have an element of a potentially arbitrary type, and need to perform a type-specific operation. + + + +## Examples + The following code example finds all of the `IMG` tags in a document, and uses the `TagName` property to test whether the `IMG` is hyperlinked to another page; if it is, the code assigns the URL to the `ALT` attribute of the `IMG` tag, so that users can mouse over the image to see where it will take them. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/HtmlElement/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.HtmlElement/VB/Form1.vb" id="Snippet7"::: + ]]> diff --git a/xml/System.Windows.Forms/HtmlWindow.xml b/xml/System.Windows.Forms/HtmlWindow.xml index 50bbc82cca8..28eb2c76a4f 100644 --- a/xml/System.Windows.Forms/HtmlWindow.xml +++ b/xml/System.Windows.Forms/HtmlWindow.xml @@ -1506,7 +1506,7 @@ The following example displays a
- Windows Forms Coordinates + Windows Forms Coordinates screenLeft Property screenTop Property diff --git a/xml/System.Windows.Forms/IDataGridViewEditingCell.xml b/xml/System.Windows.Forms/IDataGridViewEditingCell.xml index 2ca87015c06..2af622603a3 100644 --- a/xml/System.Windows.Forms/IDataGridViewEditingCell.xml +++ b/xml/System.Windows.Forms/IDataGridViewEditingCell.xml @@ -21,15 +21,15 @@ Defines common functionality for a cell that allows the manipulation of its value. - that derive from and provide a user interface (UI) for specifying values without hosting an editing control. The UI in this case is displayed regardless of whether the cell is in edit mode. - - Other cell types, such as , provide a UI but do not store user-specified values. In this case, the cell type does not implement or host an editing control. - - Cell types that display an editing control when the cell is in edit mode, such as , do not implement but instead provide a companion class that implements . For example, provides a that derives from the control and implements . In this case, the cell property is set to a object representing the editing control type. For information about implementing , see [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - + that derive from and provide a user interface (UI) for specifying values without hosting an editing control. The UI in this case is displayed regardless of whether the cell is in edit mode. + + Other cell types, such as , provide a UI but do not store user-specified values. In this case, the cell type does not implement or host an editing control. + + Cell types that display an editing control when the cell is in edit mode, such as , do not implement but instead provide a companion class that implements . For example, provides a that derives from the control and implements . In this case, the cell property is set to a object representing the editing control type. For information about implementing , see [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + ]]> @@ -65,13 +65,13 @@ Gets or sets the formatted value of the cell. An that contains the cell's value. - method and passing in the value. - + method and passing in the value. + ]]> @@ -106,11 +106,11 @@ if the value of the cell has changed; otherwise, . - @@ -149,13 +149,13 @@ Retrieves the formatted value of the cell. An that represents the formatted version of the cell contents. - property. - + property. + ]]> @@ -195,11 +195,11 @@ to select the cell contents; otherwise, . Prepares the currently selected cell for editing. - diff --git a/xml/System.Windows.Forms/IDataGridViewEditingControl.xml b/xml/System.Windows.Forms/IDataGridViewEditingControl.xml index b76e8277935..f4bb9921b7f 100644 --- a/xml/System.Windows.Forms/IDataGridViewEditingControl.xml +++ b/xml/System.Windows.Forms/IDataGridViewEditingControl.xml @@ -21,35 +21,35 @@ Defines common functionality for controls that are hosted within cells of a . - and , that are hosted by corresponding cells, such as and , when they are in edit mode. - - Cell types that can host editing controls set their property to a representing the editing control type. When the cell enters edit mode, the following steps are performed: - -1. The control creates an instance of the editing control type. - -2. The control calls the cell method. You can override this method to transfer the cell value to the editing control. - -3. The control calls the editing control method and passes in the cell's current style. You can implement this method to initialize the appearance of the editing control so that it matches the appearance of the cell. - -4. The control calls the editing control method. You can implement this method to make final adjustments to the editing control, such as selecting the control value. - - For more information about implementing , see [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - - Cell types such as that provide a user interface (UI) for specifying values without hosting an editing control implement the interface. The UI in this case is displayed regardless of whether the cell is in edit mode. - - Other cell types, such as , provide a UI but do not store user-specified values. In this case, the cell type does not implement or host an editing control. - - - -## Examples - The following code example provides an implementation of this interface that derives from . This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - + and , that are hosted by corresponding cells, such as and , when they are in edit mode. + + Cell types that can host editing controls set their property to a representing the editing control type. When the cell enters edit mode, the following steps are performed: + +1. The control creates an instance of the editing control type. + +2. The control calls the cell method. You can override this method to transfer the cell value to the editing control. + +3. The control calls the editing control method and passes in the cell's current style. You can implement this method to initialize the appearance of the editing control so that it matches the appearance of the cell. + +4. The control calls the editing control method. You can implement this method to make final adjustments to the editing control, such as selecting the control value. + + For more information about implementing , see [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + + Cell types such as that provide a user interface (UI) for specifying values without hosting an editing control implement the interface. The UI in this case is displayed regardless of whether the cell is in edit mode. + + Other cell types, such as , provide a UI but do not store user-specified values. In this case, the cell type does not implement or host an editing control. + + + +## Examples + The following code example provides an implementation of this interface that derives from . This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet300"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet300"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet300"::: + ]]> @@ -60,7 +60,7 @@ - How to: Host Controls in Windows Forms DataGridView Cells + How to: Host Controls in Windows Forms DataGridView Cells @@ -92,19 +92,19 @@ The to use as the model for the UI. Changes the control's user interface (UI) to be consistent with the specified cell style. - @@ -173,19 +173,19 @@ Gets or sets the formatted value of the cell being modified by the editor. An that represents the formatted value of the cell. - @@ -219,11 +219,11 @@ Gets or sets the index of the hosting cell's parent row. The index of the row that contains the cell, or -1 if there is no parent row. - interface does not define a corresponding `ColumnIndex` property. You can use the property to retrieve the parent control and use the property to determine the row and column indexes of the active cell. - + interface does not define a corresponding `ColumnIndex` property. You can use the property to retrieve the parent control and use the property to determine the row and column indexes of the active cell. + ]]> @@ -258,11 +258,11 @@ if the value of the control differs from the cell value; otherwise, . - property is set to `true` to indicate that the hosting cell's state has changed and its user interface (UI) needs to be updated to reflect this change in value. The owning cell or table will reset this property to `false` after an update. - + property is set to `true` to indicate that the hosting cell's state has changed and its user interface (UI) needs to be updated to reflect this change in value. The owning cell or table will reset this property to `false` after an update. + ]]> @@ -307,21 +307,21 @@ if the specified key is a regular input key that should be handled by the editing control; otherwise, . - . - - The method is called by the . The will pass in `true` for `dataGridViewWantsInputKey` when it can process the `keyData`. If the editing control can let the handle the `keyData`, should return `false` when `dataGridViewWantsInputKey` is `true`. Other implementations of may ignore a `dataGridViewWantsInputKey` value of `true` and handle the `keyData` in the editing control. - - - -## Examples - The following code example provides an implementation of this member. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - + . + + The method is called by the . The will pass in `true` for `dataGridViewWantsInputKey` when it can process the `keyData`. If the editing control can let the handle the `keyData`, should return `false` when `dataGridViewWantsInputKey` is `true`. Other implementations of may ignore a `dataGridViewWantsInputKey` value of `true` and handle the `keyData` in the editing control. + + + +## Examples + The following code example provides an implementation of this member. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet305"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet305"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet305"::: + ]]> @@ -353,19 +353,19 @@ Gets the cursor used when the mouse pointer is over the but not over the editing control. A that represents the mouse pointer used for the editing panel. - that hosts the editing control when the control is in edit mode. The actual editing control may not cover the entire area of the editing panel. In this case, the implementation should return the cursor to use when the mouse pointer is over the panel but not over the control. Typically, you will want to return the same cursor that the control uses. If you want to change the cursor that appears when the pointer is over the control, you must set the property. You can set this in the constructor of the implementation, or you can set it in the implementation. - - - -## Examples - The following code example provides an implementation of this member. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/framework/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). - + that hosts the editing control when the control is in edit mode. The actual editing control may not cover the entire area of the editing panel. In this case, the implementation should return the cursor to use when the mouse pointer is over the panel but not over the control. Typically, you will want to return the same cursor that the control uses. If you want to change the cursor that appears when the pointer is over the control, you must set the property. You can set this in the constructor of the implementation, or you can set it in the implementation. + + + +## Examples + The following code example provides an implementation of this member. This example is part of a larger example available in [How to: Host Controls in Windows Forms DataGridView Cells](/dotnet/desktop/winforms/controls/how-to-host-controls-in-windows-forms-datagridview-cells). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DataGridView/EditingControl/datagridviewcalendarcolumn.cs" id="Snippet311"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet311"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.DataGridViewCalendarColumn/VB/datagridviewcalendarcolumn.vb" id="Snippet311"::: + ]]> @@ -404,13 +404,13 @@ Retrieves the formatted value of the cell. An that represents the formatted version of the cell contents. - property. - + property. + ]]> @@ -451,11 +451,11 @@ to select all of the cell's content; otherwise, . Prepares the currently selected cell for editing. - @@ -488,11 +488,11 @@ if the contents need to be repositioned; otherwise, . - diff --git a/xml/System.Windows.Forms/LayoutSettings.xml b/xml/System.Windows.Forms/LayoutSettings.xml index 538e128561c..10870b9efe4 100644 --- a/xml/System.Windows.Forms/LayoutSettings.xml +++ b/xml/System.Windows.Forms/LayoutSettings.xml @@ -29,19 +29,19 @@ Provides a base class for collecting layout scheme characteristics. - class is the base class for types that collect the various characteristics common to a specific user interface (UI) layout scheme, such as and . - - - -## Examples - The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + class is the base class for types that collect the various characteristics common to a specific user interface (UI) layout scheme, such as and . + + + +## Examples + The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> @@ -107,11 +107,11 @@ Gets the current table layout engine. The currently being used. - property is typically used in two contexts: the container that uses a layout scheme, and the child control of the container to which the layout scheme is applied. - + property is typically used in two contexts: the container that uses a layout scheme, and the child control of the container to which the layout scheme is applied. + ]]> diff --git a/xml/System.Windows.Forms/ListView.xml b/xml/System.Windows.Forms/ListView.xml index 5430b03c8b3..9e9150d10db 100644 --- a/xml/System.Windows.Forms/ListView.xml +++ b/xml/System.Windows.Forms/ListView.xml @@ -3315,7 +3315,7 @@ When this property is set to `false`, selected items in the insertion mark feature lets you visually indicate the expected drop location in a drag-and-drop operation when an item is dragged to a new position. This feature works only when the property is set to `true` and when the control does not sort the items automatically. To prevent automatic sorting, the property must be set to and the property must be set to , , or . Additionally, the insertion mark feature may not be visible with the grouping feature because the grouping feature orders the items by group membership. - The class is typically used in a handler for the or event to update the position of the insertion mark as an item is dragged. It is also used in a handler for the or event to insert a dragged item at the correct location. For more information, see and [How to: Display an Insertion Mark in a Windows Forms ListView Control](/dotnet/framework/winforms/controls/how-to-display-an-insertion-mark-in-a-windows-forms-listview-control). + The class is typically used in a handler for the or event to update the position of the insertion mark as an item is dragged. It is also used in a handler for the or event to insert a dragged item at the correct location. For more information, see and [How to: Display an Insertion Mark in a Windows Forms ListView Control](/dotnet/desktop/winforms/controls/how-to-display-an-insertion-mark-in-a-windows-forms-listview-control). > [!NOTE] > The insertion mark feature is available only on Windows XP and Windows Server 2003 when your application calls the method. On earlier operating systems, any code relating to the insertion mark has no effect and the insertion mark will not appear. As a result, any code that depends on the insertion mark feature might not work correctly. You might want to include code that determines whether this feature is available, and provide alternate functionality when it is unavailable. For example, you might want to bypass all code that implements drag-and-drop item repositioning when running on operating systems that do not support insertion marks. diff --git a/xml/System.Windows.Forms/ListViewItem.xml b/xml/System.Windows.Forms/ListViewItem.xml index e8708ecb2aa..678f3f297af 100644 --- a/xml/System.Windows.Forms/ListViewItem.xml +++ b/xml/System.Windows.Forms/ListViewItem.xml @@ -61,47 +61,47 @@ Represents an item in a control. - control is similar to a in that it displays a list of items. The main difference is that the control provides a number of different ways items can be viewed by the user. The class defines the appearance, behavior, and data associated with an item that is displayed in the control. objects can be displayed in the control in one of four different views. Items can be displayed as large or small icons or as small icons in a vertical list. Items can also have subitems that contain information that is related to the parent item. The fourth view style, details view, allows you to display the item and its subitems in a grid with column headers that can be used to identify the information being displayed in a subitem. - - Most of the properties of the class provide ways to change the display of the item in the control it is associated with. The , , and properties allow you to change how the text of the item is displayed in the control. The property allows you to specify the image to load from the that is assigned to the control (by setting the or properties of the ). Items can display check boxes in order to obtain item choices from the user in a way similar to a control. You can use the property to determine if an item is checked, or to select or clear the check box at run time. Items can display any number of subitems when the property of the associated control is set to and columns are defined in the of the control. You can add subitems to an item by calling the method of the class. The property allows you to gain access to the class and its members. - - Some of the properties and methods of the class are item-specific versions of properties and methods in the control. For example, the method is similar to the version of the method, but the version affects only the current item. - - The class also provides methods that are not versions of methods. The method places the item's text into edit mode so the user can change the item's text (when the property of the control is set to `true`). The method allows you to create copies of existing objects to reuse in other controls. - - - -## Examples - The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: - -- - -- - -- - -- - -- - -- - -- - - You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + control is similar to a in that it displays a list of items. The main difference is that the control provides a number of different ways items can be viewed by the user. The class defines the appearance, behavior, and data associated with an item that is displayed in the control. objects can be displayed in the control in one of four different views. Items can be displayed as large or small icons or as small icons in a vertical list. Items can also have subitems that contain information that is related to the parent item. The fourth view style, details view, allows you to display the item and its subitems in a grid with column headers that can be used to identify the information being displayed in a subitem. + + Most of the properties of the class provide ways to change the display of the item in the control it is associated with. The , , and properties allow you to change how the text of the item is displayed in the control. The property allows you to specify the image to load from the that is assigned to the control (by setting the or properties of the ). Items can display check boxes in order to obtain item choices from the user in a way similar to a control. You can use the property to determine if an item is checked, or to select or clear the check box at run time. Items can display any number of subitems when the property of the associated control is set to and columns are defined in the of the control. You can add subitems to an item by calling the method of the class. The property allows you to gain access to the class and its members. + + Some of the properties and methods of the class are item-specific versions of properties and methods in the control. For example, the method is similar to the version of the method, but the version affects only the current item. + + The class also provides methods that are not versions of methods. The method places the item's text into edit mode so the user can change the item's text (when the property of the control is set to `true`). The method allows you to create copies of existing objects to reuse in other controls. + + + +## Examples + The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: + +- + +- + +- + +- + +- + +- + +- + + You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]> - ListView Control (Windows Forms) + ListView Control (Windows Forms) @@ -136,31 +136,31 @@ Initializes a new instance of the class with default values. - control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: - -- - -- - -- - -- - -- - -- - -- - - You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: + +- + +- + +- + +- + +- + +- + +- + + You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -199,11 +199,11 @@ The text to display for the item. This should not exceed 259 characters. Initializes a new instance of the class with the specified item text. - should not exceed 259 characters or unexpected behavior could occur. - + should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -278,14 +278,14 @@ The to assign the item to. Initializes a new instance of the class and assigns it to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -352,11 +352,11 @@ The zero-based index of the image within the associated with the that contains the item. Initializes a new instance of the class with the specified item text and the image index position of the item's icon. - should not exceed 259 characters or unexpected behavior could occur. - + should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -392,13 +392,13 @@ The name of the image within the of the owning to display in the . Initializes a new instance of the class with the specified text and image. - associated with the owning control, which can be accessed with the property. - - The text of the should not exceed 259 characters or unexpected behavior could occur. - + associated with the owning control, which can be accessed with the property. + + The text of the should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -432,16 +432,16 @@ The to assign the item to. Initializes a new instance of the class with the specified item text and assigns it to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - - The text of the should not exceed 259 characters or unexpected behavior could occur. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + + The text of the should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -525,11 +525,11 @@ The name of the image within the of the owning to display in the . Initializes a new instance of the class with the specified item and subitem text and image. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + ]]> @@ -570,14 +570,14 @@ The to assign the item to. Initializes a new instance of the class with an array of strings representing subitems, and assigns the item to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -613,11 +613,11 @@ The zero-based index of the image within the associated with the that contains the item. Initializes a new instance of the class with the image index position of the item's icon and an array of objects. - objects before adding them to a (for example, to indicate special formatting or to use the subitems in multiple items). - + objects before adding them to a (for example, to indicate special formatting or to use the subitems in multiple items). + ]]> @@ -661,11 +661,11 @@ The name of the image within the of the owning to display in the . Initializes a new instance of the class with the specified subitems and image. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + ]]> @@ -701,16 +701,16 @@ The to assign the item to. Initializes a new instance of the class with the specified item text and the image index position of the item's icon, and assigns the item to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - - The text of the should not exceed 259 characters or unexpected behavior could occur. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + + The text of the should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -749,18 +749,18 @@ The to assign the item to. Initializes a new instance of the class with the specified text, image, and group. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - - The text of the should not exceed 259 characters or unexpected behavior could occur. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + + The text of the should not exceed 259 characters or unexpected behavior could occur. + ]]> @@ -803,14 +803,14 @@ The to assign the item to. Initializes a new instance of the class with the image index position of the item's icon and an array of strings representing subitems, and assigns the item to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -856,16 +856,16 @@ The to assign the item to. Initializes a new instance of the class with subitems containing the specified text, image, and group. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -908,14 +908,14 @@ The to assign the item to. Initializes a new instance of the class with the image index position of the item's icon and an array of objects, and assigns the item to the specified group. - objects before adding them to a object (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. - + objects before adding them to a object (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -962,16 +962,16 @@ The to assign the item to. Initializes a new instance of the class with the specified subitems, image, and group. - objects before adding them to a (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. - - The `imageKey` parameter specifies an image in the associated with the owning control, which can be accessed with the property. - + objects before adding them to a (for example, to indicate special formatting or to use the subitems in multiple items). It also allows you to specify the group to which an item belongs. + + The `imageKey` parameter specifies an image in the associated with the owning control, which can be accessed with the property. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -1019,15 +1019,15 @@ A that represents the font to display the item's text in. Initializes a new instance of the class with the image index position of the item's icon; the foreground color, background color, and font of the item; and an array of strings representing subitems. - control that manually sorts items when a column in the control is clicked. The example defines a class called `ListViewItemComparer` that implements the interface that performs the comparison. The example creates an instance of `ListViewItemComparer` and uses it to set the property of the control. The method call in the event handler uses the methods defined in `ListViewItemComparer` to perform the sort of items, based on the column that is clicked. - + control that manually sorts items when a column in the control is clicked. The example defines a class called `ListViewItemComparer` that implements the interface that performs the comparison. The example creates an instance of `ListViewItemComparer` and uses it to set the property of the control. The method call in the event handler uses the methods defined in `ListViewItemComparer` to perform the sort of items, based on the column that is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListView.ColumnClick/CPP/listviewsort1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Overview/listviewsort1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListView.ColumnClick/VB/listviewsort1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListView.ColumnClick/VB/listviewsort1.vb" id="Snippet1"::: + ]]> @@ -1078,11 +1078,11 @@ A to apply to the item text. Initializes a new instance of the class with the subitems containing the specified text, image, colors, and font. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + ]]> @@ -1131,14 +1131,14 @@ The to assign the item to. Initializes a new instance of the class with the image index position of the item's icon; the foreground color, background color, and font of the item; and an array of strings representing subitems. Assigns the item to the specified group. - [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -1192,16 +1192,16 @@ The to assign the item to. Initializes a new instance of the class with the subitems containing the specified text, image, colors, font, and group. - associated with the owning control, which can be accessed with the property. - + associated with the owning control, which can be accessed with the property. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + ]]> @@ -1243,13 +1243,13 @@ Gets or sets the background color of the item's text. A that represents the background color of the item's text. - property to change the color displayed behind the item text. This property can be used if you want to use different background and foreground color combinations (using the property to set the foreground color) to differentiate one item from another. For example, you could set the property to to identify items that have failed validation or are missing subitem information. - - If you want to use the same background color for all subitems of an item, set the property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. - + property to change the color displayed behind the item text. This property can be used if you want to use different background and foreground color combinations (using the property to set the foreground color) to differentiate one item from another. For example, you could set the property to to identify items that have failed validation or are missing subitem information. + + If you want to use the same background color for all subitems of an item, set the property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. + ]]> @@ -1283,11 +1283,11 @@ Places the item text into edit mode. - property of the control that contains the item is set to `true`. You can use this method at run time to force the item's text to display in edit mode. For example, if you are validating the item text edited by the user, and an item fails validation, you could select the item in the control and call the method to force the user to change the text that failed validation. - + property of the control that contains the item is set to `true`. You can use this method at run time to force the item's text to display in edit mode. For example, if you are validating the item text edited by the user, and an item fails validation, you could select the item in the control and call the method to force the user to change the text that failed validation. + ]]> The property of the associated is not set to . @@ -1326,15 +1326,15 @@ Gets the bounding rectangle of the item, including subitems. A that represents the bounding rectangle of the item. - method. The class provides a method that allows you to get the bounding rectangle of any item located within the control. - - The returned bounding rectangle uses client control coordinates that are relative to the top-left corner of the currently visible area of the containing . If the is scrollable and positioned so that the is not visible, the coordinates returned may be negative. - - When the property has a value of , the width of the bounding rectangle is the width of the column containing the item, not the width of the text in the item. If the collection does not contain any columns, the default column width of 60 pixels is used. - + method. The class provides a method that allows you to get the bounding rectangle of any item located within the control. + + The returned bounding rectangle uses client control coordinates that are relative to the top-left corner of the currently visible area of the containing . If the is scrollable and positioned so that the is not visible, the coordinates returned may be negative. + + When the property has a value of , the width of the bounding rectangle is the width of the column containing the item, not the width of the text in the item. If the collection does not contain any columns, the default column width of 60 pixels is used. + ]]> @@ -1383,36 +1383,36 @@ if the item is checked; otherwise, . The default is . - property of the control the item is contained in is set to `true`. You can use this property to determine if the item has been checked by the user or through code at run time. To determine all the items that are checked in a control, you can use the property. To take action when an item has been checked, you can create an event handler for the property of the control. - - - -## Examples - The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: - -- - -- - -- - -- - -- - -- - -- - - You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - + property of the control the item is contained in is set to `true`. You can use this property to determine if the item has been checked by the user or through code at run time. To determine all the items that are checked in a control, you can use the property. To take action when an item has been checked, you can create an event handler for the property of the control. + + + +## Examples + The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: + +- + +- + +- + +- + +- + +- + +- + + You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1451,11 +1451,11 @@ Creates an identical copy of the item. An object that represents an item that has the same text, image, and subitems associated with it as the cloned item. - class based on an existing item. Even the subitems of the item being cloned are specified for the new version. This feature is useful if you want to reuse a in more than one control. - + class based on an existing item. Even the subitems of the item being cloned are specified for the new version. This feature is useful if you want to reuse a in more than one control. + ]]> @@ -1527,13 +1527,13 @@ Ensures that the item is visible within the control, scrolling the contents of the control, if necessary. - control. This method can be used when performing validation on the item. You can call the method to ensure that the item is displayed in the control if it failed validation, to allow the user to perform changes on the item. - - This method is similar to the method of the control. - + control. This method can be used when performing validation on the item. You can call the method to ensure that the item is displayed in the control if it failed validation, to allow the user to perform changes on the item. + + This method is similar to the method of the control. + ]]> @@ -1570,21 +1570,21 @@ Finds the next item from the , searching in the specified direction. The that is closest to the given coordinates, searching in the specified direction. - method returns `null` if no item is found in the given direction. - - Identifying the nearest item can vary depending on the operating system the application is running on and will affect the results of . - - - -## Examples - The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form that contains a named `findListView`. Ensure that the property is set to an icon view and that the is populated with items. Associate the event of `findListView` with the `findListView_MouseDown` method in this example. - + method returns `null` if no item is found in the given direction. + + Identifying the nearest item can vary depending on the operating system the application is running on and will affect the results of . + + + +## Examples + The following code example demonstrates how to use the method. To run this example, paste the following code into a Windows Form that contains a named `findListView`. Ensure that the property is set to an icon view and that the is populated with items. Associate the event of `findListView` with the `findListView_MouseDown` method in this example. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet1"::: + ]]> The property of the containing is set to a value other than or . @@ -1632,13 +1632,13 @@ if the item has focus; otherwise, . - control does not have directly editable areas - only items contained in the can be edited - the text of an item in the will display the focus reticle when the has focus. Typically, the last selected item in the control is the item with focus. Although an item may display the focus reticle, it might not actually be a selected item in the . You can use the property to determine if the item is currently the focused item in the control that contains it. If the is not associated with a control, this property will return `false`. - - The control provides the property to allow you to determine which in the has the focus. - + control does not have directly editable areas - only items contained in the can be edited - the text of an item in the will display the focus reticle when the has focus. Typically, the last selected item in the control is the item with focus. Although an item may display the focus reticle, it might not actually be a selected item in the . You can use the property to determine if the item is currently the focused item in the control that contains it. If the is not associated with a control, this property will return `false`. + + The control provides the property to allow you to determine which in the has the focus. + ]]> @@ -1685,26 +1685,26 @@ Gets or sets the font of the text displayed by the item. The to apply to the text displayed by the control. The default is the value of the property if the is not associated with a control; otherwise, the font specified in the property for the control is used. - is immutable (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. - - - -## Examples - The following code example shows how to adjust the existing font to make it bold. - -```csharp -listViewItem1.Font = new Font(listViewItem1.Font, - listViewItem1.Font.Style | FontStyle.Bold); -``` - -```vb -ListViewItem1.Font = New Font(ListViewItem1.Font, _ - ListViewItem1.Font.Style Or FontStyle.Bold) -``` - + is immutable (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. + + + +## Examples + The following code example shows how to adjust the existing font to make it bold. + +```csharp +listViewItem1.Font = new Font(listViewItem1.Font, + listViewItem1.Font.Style | FontStyle.Bold); +``` + +```vb +ListViewItem1.Font = New Font(ListViewItem1.Font, _ + ListViewItem1.Font.Style Or FontStyle.Bold) +``` + ]]> @@ -1746,13 +1746,13 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ Gets or sets the foreground color of the item's text. A that represents the foreground color of the item's text. - property to change the color of the item text. This property can be used if you want to use different background and foreground color combinations (using the property to set the background color) to differentiate one item from another. For example, you could set the property to to identify items that have a negative number associated with them or have failed item validation. - - If you want to use the same foreground color for all subitems of an item, set the property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. - + property to change the color of the item text. This property can be used if you want to use different background and foreground color combinations (using the property to set the background color) to differentiate one item from another. For example, you could set the property to to identify items that have a negative number associated with them or have failed item validation. + + If you want to use the same foreground color for all subitems of an item, set the property to `true`. This will cause the colors and fonts specified for the item to be used for all subitem text. + ]]> @@ -1790,11 +1790,11 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ Retrieves the specified portion of the bounding rectangle for the item. A that represents the bounding rectangle for the specified portion of the item. - method represents only the section of the item specified in the `portion` parameter. You can also call the methods of the class to obtain the bounding rectangle of any item in a control. - + method represents only the section of the item specified in the `portion` parameter. You can also call the methods of the class to obtain the bounding rectangle of any item in a control. + ]]> @@ -1833,19 +1833,19 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ Returns the subitem of the at the specified coordinates. The at the specified x- and y-coordinates. - method will return `null` if the is not in view, or there is not a located at the specified point. - - - -## Examples - The following code example demonstrates how to use the method. To run this code, paste it into a Windows Form and call `InitializeListView1` from the form's constructor or event-handling method. - + method will return `null` if the is not in view, or there is not a located at the specified point. + + + +## Examples + The following code example demonstrates how to use the method. To run this code, paste it into a Windows Form and call `InitializeListView1` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet5"::: + ]]> @@ -1895,25 +1895,25 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ Gets or sets the group to which the item is assigned. The to which the item is assigned. - constructor, or you can use this property to modify the group membership at run time. If you set this property to `null` and there are groups in the collection, the item will appear in the default group, which has the header label "DefaultGroupSystem.Windows.Forms". The default group is not contained in the collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups. - + constructor, or you can use this property to modify the group membership at run time. If you set this property to `null` and there are groups in the collection, the item will appear in the default group, which has the header label "DefaultGroupSystem.Windows.Forms". The default group is not contained in the collection, and cannot be altered. It is primarily useful in debugging to ensure that all items have been properly added to groups. + > [!NOTE] -> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. - - - -## Examples - The following code example demonstrates how the property can be used in an application that organizes items by subitem value in the details view. This form of grouping is similar to the grouping used in Windows Explorer. In the example, the groups are created dynamically. For each subitem column, one group is created for each unique subitem value. For the parent item column, one group is created for each unique initial letter. The groups created for each column are stored in a hash table along with the subitem text or initial letter. When a column header is clicked, the hash table corresponding to that column is retrieved. Next, the subitem text values for that column are used as hash table keys to retrieve the correct group for each item. The item is then assigned to the group using the property. - - This code example is part of a larger example provided for the property. - +> groups are only available on Windows XP and the Windows Server 2003 family (Windows XP Home Edition, Windows XP Professional, Windows Server 2003). For more information, see the overview topic. + + + +## Examples + The following code example demonstrates how the property can be used in an application that organizes items by subitem value in the details view. This form of grouping is similar to the grouping used in Windows Explorer. In the example, the groups are created dynamically. For each subitem column, one group is created for each unique subitem value. For the parent item column, one group is created for each unique initial letter. The groups created for each column are stored in a hash table along with the subitem text or initial letter. When a column header is clicked, the hash table corresponding to that column is retrieved. Next, the subitem text values for that column are used as hash table keys to retrieve the correct group for each item. The item is then assigned to the group using the property. + + This code example is part of a larger example provided for the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/CPP/listviewgroupsexample.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/Groups/listviewgroupsexample.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/VB/listviewgroupsexample.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView.Groups/VB/listviewgroupsexample.vb" id="Snippet2"::: + ]]> @@ -1992,17 +1992,17 @@ ListViewItem1.Font = New Font(ListViewItem1.Font, _ Gets or sets the index of the image that is displayed for the item. The zero-based index of the image in the that is displayed for the item. The default is -1. - property. Depending on the current value of the property of the control associated with the item, the used by the item could be one specified in the property or the property of the control. If the property is set to , the specified in the property is used; otherwise, the specified in the property is used. The images defined in the specified in the property should have the same index positions as the images in the specified in the property. If the index positions are the same for both controls, you can set a single index value for the property and the appropriate image will be displayed regardless of the value of the property of the control. - + and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). - +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). + If the property value is changed to `null`, the property returns its default value, -1. However, the assigned value is retained internally and used when another object is assigned to the property. If the new assigned to the property has an property value that is less than or equal to the value assigned to the property minus one (to account for the collection being a zero-based index), the property value is adjusted to one less than the property value. -For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. - +For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. + ]]> @@ -2076,15 +2076,15 @@ For example, consider a button control whose Gets or sets the key for the image that is displayed for the item. The key for the image that is displayed for the . - and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). - +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). + > [!NOTE] -> If you are using multiple image lists, for small and large icon view, with a control, you should place small and large versions of the image at the same index location in their respective image lists. When switching between views, the index location of the image in one list is used to locate the image in the other list, regardless of the key value specified. - +> If you are using multiple image lists, for small and large icon view, with a control, you should place small and large versions of the image at the same index location in their respective image lists. When switching between views, the index location of the image in one list is used to locate the image in the other list, regardless of the key value specified. + ]]> @@ -2127,11 +2127,11 @@ If you set the property, th Gets the that contains the image displayed with the item. The used by the control that contains the image displayed with the item. - property of the control associated with the item, the used by the item could be one specified in the property or the property of the control. If the property is set to , the specified in the property is used; otherwise, the specified in the property is used. You can use this property to determine which control is providing the image for the item. To determine the index position in the that contains the image to display for the item, use the property. - + property of the control associated with the item, the used by the item could be one specified in the property or the property of the control. If the property is set to , the specified in the property is used; otherwise, the specified in the property is used. You can use this property to determine which control is providing the image for the item. To determine the index position in the that contains the image to display for the item, use the property. + ]]> @@ -2173,19 +2173,19 @@ If you set the property, th Gets or sets the number of small image widths by which to indent the . The number of small image widths by which to indent the . - property can be used only when the property of the containing is set to , and the property of the is set. - - - -## Examples - The following code example demonstrates how to set the property. To run this example, paste the following code into a Windows Form and call the `InitializeIndentedListViewItems` method from the form's constructor or event-handling method. - + property can be used only when the property of the containing is set to , and the property of the is set. + + + +## Examples + The following code example demonstrates how to set the property. To run this example, paste the following code into a Windows Form and call the `InitializeIndentedListViewItems` method from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet2"::: + ]]> When setting , the number specified is less than 0. @@ -2224,11 +2224,11 @@ If you set the property, th Gets the zero-based index of the item within the control. The zero-based index of the item within the of the control, or -1 if the item is not associated with a control. - control as well as to determine its position within the of the . - + control as well as to determine its position within the of the . + ]]> @@ -2275,11 +2275,11 @@ If you set the property, th Gets the control that contains the item. A that contains the . - control that owns the . - + control that owns the . + ]]> @@ -2329,11 +2329,11 @@ If you set the property, th Gets or sets the name associated with this . The name of the . The default is an empty string (""). - property is also the key for the when the item is accessed in a collection. - + property is also the key for the when the item is accessed in a collection. + ]]> @@ -2378,19 +2378,19 @@ If you set the property, th Gets or sets the position of the upper-left corner of the . The at the upper-left corner of the . - property should be set after the and containing are constructed. Changing the property when the containing is in or view will have no effect on the position of the items. Also, the property will automatically change when the property of the containing is changed from , , or view to or . When the is in , , or view, setting the property for an item will cause the other items contained in the to be rearranged. - - - -## Examples - The following code example demonstrates how to use the property of a . To run this example, paste the following code into a Windows Form and call the `InitializePositionedListViewItems` from the form's event-handling method. Click the button to see the items repositioned. - + property should be set after the and containing are constructed. Changing the property when the containing is in or view will have no effect on the position of the items. Also, the property will automatically change when the property of the containing is changed from , , or view to or . When the is in , , or view, setting the property for an item will cause the other items contained in the to be rearranged. + + + +## Examples + The following code example demonstrates how to use the property of a . To run this example, paste the following code into a Windows Form and call the `InitializePositionedListViewItems` from the form's event-handling method. Click the button to see the items repositioned. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet3"::: + ]]> The is set when the containing is in virtual mode. @@ -2426,11 +2426,11 @@ If you set the property, th Removes the item from its associated control. - method of the in the control that contains the item. You can use the method to remove an item from its control. This feature can be useful if you want to move the item to a different control or need to remove the item based on a request from the user to remove the item from within your application. - + method of the in the control that contains the item. You can use the method to remove an item from its control. This feature can be useful if you want to move the item to a different control or need to remove the item based on a request from the user to remove the item from within your application. + ]]> @@ -2479,23 +2479,23 @@ If you set the property, th if the item is selected; otherwise, . - property of the control the item is contained in is set to `true`, setting the value of this property adds or removes the item from the set of selected items. If the property is set to `false`, setting the value of this property to select an item automatically cancels the selection for any other items in the control. You can use this property to determine if an item is selected or to select an item at run time. You can access all items that are selected in a control by using the property. - + property of the control the item is contained in is set to `true`, setting the value of this property adds or removes the item from the set of selected items. If the property is set to `false`, setting the value of this property to select an item automatically cancels the selection for any other items in the control. You can use this property to determine if an item is selected or to select an item at run time. You can access all items that are selected in a control by using the property. + > [!NOTE] -> Items appear selected only when the control has focus. To select items in response to a user action such as a button click, be sure to call the method in addition to setting this property. - - - -## Examples - The following code example demonstrates how to use the and members. To run the example, place the following code in a form containing a named `ListView1` and a , located toward the bottom of the form, named `Button1`. Call the `InitializeListView` method from the form's constructor or event-handling method. - +> Items appear selected only when the control has focus. To select items in response to a user action such as a button click, be sure to call the method in addition to setting this property. + + + +## Examples + The following code example demonstrates how to use the and members. To run the example, place the following code in a form containing a named `ListView1` and a , located toward the bottom of the form, named `Button1`. Call the `InitializeListView` method from the form's constructor or event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListView4/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/Clear/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView4/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListView4/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2611,20 +2611,20 @@ If you set the property, th Gets or sets the index of the state image (an image such as a selected or cleared check box that indicates the state of the item) that is displayed for the item. The zero-based index of the state image in the that is displayed for the item. - assigned to the property of the associated control, where the state images to display to the left of the item are stored. Typically, the state image is a selected or cleared check box or an image that is intended to represent selected or cleared states for the item. If no value is specified for the property, the control displays a default selected or cleared check box when the property of the control is set to `true`. - + assigned to the property of the associated control, where the state images to display to the left of the item are stored. Typically, the state image is a selected or cleared check box or an image that is intended to represent selected or cleared states for the item. If no value is specified for the property, the control displays a default selected or cleared check box when the property of the control is set to `true`. + > [!NOTE] -> Although the specified in the property can contain any number of images, and the property can be set to any value equal to or lower than 14, only the images at index positions 0 and 1 are displayed as state images. - +> Although the specified in the property can contain any number of images, and the property can be set to any value equal to or lower than 14, only the images at index positions 0 and 1 are displayed as state images. + ]]> - The value specified for this property is less than -1. - - -or- - + The value specified for this property is less than -1. + + -or- + The value specified for this property is greater than 14. @@ -2674,39 +2674,39 @@ If you set the property, th Gets a collection containing all subitems of the item. A that contains the subitems. - , you can add subitems, remove subitems, and obtain a count of subitems. For more information on the tasks that can be performed with the subitems in the collection, see the class reference topics. - + , you can add subitems, remove subitems, and obtain a count of subitems. For more information on the tasks that can be performed with the subitems in the collection, see the class reference topics. + > [!NOTE] -> The first subitem in the is always the item that owns the subitems. When performing operations on subitems in the collection, be sure to reference index position 1 instead of 0 to make changes to the first subitem. - - - -## Examples - The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: - -- - -- - -- - -- - -- - -- - -- - - You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. - +> The first subitem in the is always the item that owns the subitems. When performing operations on subitems in the collection, be sure to reference index position 1 instead of 0 to make changes to the first subitem. + + + +## Examples + The following code example creates a control with three objects specified and three objects specified for each item. The example also creates objects to display the subitems in details view. Two objects are also created in the code example to provide images for the objects. These objects are added to the and properties. The example uses the following properties in creating the control: + +- + +- + +- + +- + +- + +- + +- + + You need to add the code to a and call the method created in the example from the constructor or another method on the form. The example requires that images named `MySmallImage1`, `MySmallImage2`, `MyLargeImage1`, and `MyLargeImage2` are located in the root directory of drive C. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ListViewExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView+ColumnHeaderCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ListViewExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2813,20 +2813,20 @@ If you set the property, th Gets or sets an object that contains data to associate with the item. An object that contains information that is associated with the item. - property can be used to store any object that you want to associate with an item. Although you can store any item, the property is typically used to store string information about the item, such as a unique identifier or the index position of the item's data in a database. - - - -## Examples - The following code example demonstrates how to initialize a and set the and properties. To run this example, place the following code in a form that contains a named `ListView1`, and call `InitializeListViewItems` from the form's constructor or event-handling method. - + property can be used to store any object that you want to associate with an item. Although you can store any item, the property is typically used to store string information about the item, such as a unique identifier or the index position of the item's data in a database. + + + +## Examples + The following code example demonstrates how to initialize a and set the and properties. To run this example, place the following code in a form that contains a named `ListView1`, and call `InitializeListViewItems` from the form's constructor or event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListViewItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2872,22 +2872,22 @@ If you set the property, th Gets or sets the text of the item. The text to display for the item. This should not exceed 259 characters. - property allows you to change the text displayed for the item. The text of the should not exceed 259 characters or unexpected behavior could occur. - - You can use the , , and properties to specify how the text is displayed. The class provides the property that determines whether text wraps to the next line or is displayed on a single line. - - - -## Examples - The following code example demonstrates how to initialize a and set the and properties. To run this example, place the following code in a form containing a named `ListView1`, and call `InitializeListViewItems` from the form's constructor or event-handling method. - + property allows you to change the text displayed for the item. The text of the should not exceed 259 characters or unexpected behavior could occur. + + You can use the , , and properties to specify how the text is displayed. The class provides the property that determines whether text wraps to the next line or is displayed on a single line. + + + +## Examples + The following code example demonstrates how to initialize a and set the and properties. To run this example, place the following code in a form containing a named `ListView1`, and call `InitializeListViewItems` from the form's constructor or event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListViewItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2932,19 +2932,19 @@ If you set the property, th Gets or sets the text shown when the mouse pointer rests on the . The text shown when the mouse pointer rests on the . - and its containing have ToolTips set, only the ToolTip for the will be shown. - - - -## Examples - The following code example demonstrates how to use the and properties. To run this example, paste the code into a Windows Form and call `InitializeItemsWithToolTips` from the form's constructor or event-handling method. - + and its containing have ToolTips set, only the ToolTip for the will be shown. + + + +## Examples + The following code example demonstrates how to use the and properties. To run this example, paste the code into a Windows Form and call `InitializeItemsWithToolTips` from the form's constructor or event-handling method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/ShowItemToolTips/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemWhidbeyMembers/VB/form1.vb" id="Snippet4"::: + ]]> @@ -3014,20 +3014,20 @@ If you set the property, th if all subitems use the font, foreground color, and background color settings of the item; otherwise, . The default is . - control, you can set this property to `false`. When this property is set to `true`, any changes made to the subitem's , , and properties are ignored, and the values of the item are used instead. You can use this property if you need to specify a different text color, background color, or font to be used for a subitem to highlight the item when subitems are displayed in the control. - - - -## Examples - The following code example demonstrates how to set the property to `false` to define a custom style for objects. The example also demonstrates how to set the and properties. To run the example, paste the following code into a form and call the `InitializeListView` method in form's constructor or event-handling method. - + control, you can set this property to `false`. When this property is set to `true`, any changes made to the subitem's , , and properties are ignored, and the values of the item are used instead. You can use this property if you need to specify a different text color, background color, or font to be used for a subitem to highlight the item when subitems are displayed in the control. + + + +## Examples + The following code example demonstrates how to set the property to `false` to define a custom style for objects. The example also demonstrates how to set the and properties. To run the example, paste the following code into a form and call the `InitializeListView` method in form's constructor or event-handling method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ListView/TopItem/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ListViewItemStyle/VB/form1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/MainMenu.xml b/xml/System.Windows.Forms/MainMenu.xml index 9897e11b845..653ff952bed 100644 --- a/xml/System.Windows.Forms/MainMenu.xml +++ b/xml/System.Windows.Forms/MainMenu.xml @@ -36,31 +36,31 @@ Represents the menu structure of a form. - + This class is not available in .NET Core 3.1 and later versions. Use instead, which replaces and extends the control. - instead. - The control represents the container for the menu structure of a form. A menu is composed of objects that represent the individual menu commands in the menu structure. Each can be a command for your application or a parent menu for other submenu items. To bind the to the that will display it, assign the to the property of the . - - For applications that will have support for multiple languages, you can use the property to display the text of the menu from right to left to support languages such as Arabic. - - You can create different objects to represent different menu structures for your form. If you want to reuse the menu structure contained in a specific , you can use its method to create a copy. Once you have a copy of the menu structure, you can make the appropriate modifications for your new menu structure. - + The control represents the container for the menu structure of a form. A menu is composed of objects that represent the individual menu commands in the menu structure. Each can be a command for your application or a parent menu for other submenu items. To bind the to the that will display it, assign the to the property of the . + + For applications that will have support for multiple languages, you can use the property to display the text of the menu from right to left to support languages such as Arabic. + + You can create different objects to represent different menu structures for your form. If you want to reuse the menu structure contained in a specific , you can use its method to create a copy. Once you have a copy of the menu structure, you can make the appropriate modifications for your new menu structure. + > [!NOTE] > Cutting and pasting menu items from one form to another in the designer might not work as expected if the form you are pasting into has no menu items defined. - -## Examples - The following code example creates a , assigns two objects to the and binds it to a form. This example requires that you have a created that is named `Form1`. - + +## Examples + The following code example creates a , assigns two objects to the and binds it to a form. This example requires that you have a created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Form/Menu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -69,7 +69,7 @@ This class is not available in .NET Core 3.1 and later versions. Use - MenuStrip Control (Windows Forms) + MenuStrip Control (Windows Forms) @@ -99,20 +99,20 @@ This class is not available in .NET Core 3.1 and later versions. Use Initializes a new instance of the class without any specified menu items. - without any specified objects. To add menu items to the control use the other version of this constructor that accepts an array of objects as its parameter or use the method of the property. - - - -## Examples - The following code example creates a , assigns two objects to the and binds it to a form. This example requires that you have a created that is named `Form1`. - + without any specified objects. To add menu items to the control use the other version of this constructor that accepts an array of objects as its parameter or use the method of the property. + + + +## Examples + The following code example creates a , assigns two objects to the and binds it to a form. This example requires that you have a created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Form/Menu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -166,20 +166,20 @@ This class is not available in .NET Core 3.1 and later versions. Use An array of objects that will be added to the . Initializes a new instance of the with a specified set of objects. - objects to the at the time of its creation. After the has been created you can add additional objects to the using the method of the property. - - - -## Examples - The following code example creates a , and assigns two objects to the using this version of the constructor. The example then binds the to a . This example requires that you have a created that is named `Form1`. - + objects to the at the time of its creation. After the has been created you can add additional objects to the using the method of the property. + + + +## Examples + The following code example creates a , and assigns two objects to the using this version of the constructor. The example then binds the to a . This example requires that you have a created that is named `Form1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/.ctor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.MainMenu1 Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -208,20 +208,20 @@ This class is not available in .NET Core 3.1 and later versions. Use Creates a new that is a duplicate of the current . A that represents the cloned menu. - . You can use this method to reuse the menu structure stored in a as the foundation for a new . For example, if you want to create a menu structure that has the same menu items as an existing but will also have additional objects added to it, you can use the method to create a copy of the original and then add the new objects to the cloned . - - - -## Examples - The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The code then sets the property to true on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. - + . You can use this method to reuse the menu structure stored in a as the foundation for a new . For example, if you want to create a menu structure that has the same menu items as an existing but will also have additional objects added to it, you can use the method to create a copy of the original and then add the new objects to the cloned . + + + +## Examples + The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The code then sets the property to true on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/CloneMenu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -246,21 +246,21 @@ This class is not available in .NET Core 3.1 and later versions. Use Occurs when the main menu collapses. - 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 type named `MainMenu1`. Then 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 type named `MainMenu1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet483"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet483"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet483"::: + ]]> @@ -315,14 +315,14 @@ This class is not available in .NET Core 3.1 and later versions. Use to release both managed and unmanaged resources; to release only unmanaged resources. Disposes of the resources, other than memory, used by the . - when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. - + when you are finished using the . The method leaves the in an unusable state. After calling , you must release all references to the so the memory it was occupying can be reclaimed by garbage collection. + > [!NOTE] -> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. - +> Always call before you release your last reference to the . Otherwise, the resources the is using will not be freed until garbage collection calls the object's destructor. + ]]> @@ -350,20 +350,20 @@ This class is not available in .NET Core 3.1 and later versions. Use Gets the that contains this control. A that is the container for this control. Returns if the is not currently hosted on a form. - is parented to a form. The property is typically used when multiple objects are being used on a form and you need to determine which one is currently being used by a form. - - - -## Examples - The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The code then sets the property to true on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. - + is parented to a form. The property is typically used when multiple objects are being used on a form and you need to determine which one is currently being used by a form. + + + +## Examples + The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The code then sets the property to true on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/CloneMenu/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.GetForm Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -393,13 +393,13 @@ This class is not available in .NET Core 3.1 and later versions. Use 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. + ]]> @@ -439,23 +439,23 @@ This class is not available in .NET Core 3.1 and later versions. Use Gets or sets whether the text displayed by the control is displayed from right to left. One of the values. - [!NOTE] -> For more information about how enabling right-to-left alignment affects Windows Forms controls, see the property. - - - -## Examples - The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The example code then sets the property to `RightToLeft.Yes` on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. - +> For more information about how enabling right-to-left alignment affects Windows Forms controls, see the property. + + + +## Examples + The following code example uses the method to determine if a is currently parented to the form. If the call in the example code to does not return `null`, the code then clones the menu structure of the using the method. The example code then sets the property to `RightToLeft.Yes` on the new copy of the to create a that can be used for languages that support right to left text. This example requires that you have a created that is named `mainMenu1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MainMenu/RightToLeft/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic MainMenu.RightToLeft Example/VB/source.vb" id="Snippet1"::: + ]]> The value assigned to the property is not a valid member of the enumeration. @@ -484,11 +484,11 @@ This class is not available in .NET Core 3.1 and later versions. Use Returns a string that represents the . A string that represents the current . - method if the is assigned to a form. - + method if the is assigned to a form. + ]]> diff --git a/xml/System.Windows.Forms/MaskedTextBox.xml b/xml/System.Windows.Forms/MaskedTextBox.xml index 519c07204ee..b776e8eddce 100644 --- a/xml/System.Windows.Forms/MaskedTextBox.xml +++ b/xml/System.Windows.Forms/MaskedTextBox.xml @@ -57,73 +57,73 @@ Uses a mask to distinguish between proper and improper user input. - class is an enhanced control that supports a declarative syntax for accepting or rejecting user input. Using the property, you can specify the following input without writing any custom validation logic in your application: - -- Required input characters. - -- Optional input characters. - -- The type of input expected at a given position in the mask; for example, a digit, or an alphabetic or alphanumeric character. - -- Mask literals, or characters that should appear directly in the ; for example, the hyphens (-) in a phone number, or the currency symbol in a price. - -- Special processing for input characters; for example, to convert alphabetic characters to uppercase. - - When a control is displayed at run time, it represents the mask as a series of prompt characters and optional literal characters. Each editable mask position, representing a required or optional input, is shown with a single prompt character. For example, the number sign (#) is often used as a placeholder for a numeric character input. You can use the property to specify a custom prompt character. The property determines if the user sees the prompt characters when the control loses input focus. - - As the user types input into the masked text box, valid input characters replace their respective prompt characters in a sequential fashion. If the user types an invalid input character, no replacement occurs, but instead a beep is issued if the property is set to `true`, and the event is raised. You can provide your own custom error logic by handing this event. - - When the current insertion point is at a literal character, the user has a number of options: - -- If a character other than the prompt character is typed, the literal will automatically be skipped and the input character will be applied to the next editable position, represented by the next prompt character. - -- If the prompt character is typed and the property is true, the input will overtype the prompt character and insertion point will be moved to the next position in the mask. - -- As is always the case, the arrow keys can be used to navigate to a previous or subsequent position. - - You can use the property to verify whether or not the user has entered all of the required input. The property will always retrieve the user's input formatted according to the mask and the property. - - The control actually defers all mask processing to the class specified by the property. This standard provider supports all Unicode characters except for surrogates and vertically combined characters; however, the property can be used to restrict input to the characters sets a-z, A-Z, and 0-9. - - Masks do not necessarily guarantee that a user's input will represent a valid value for a given type; for example, -9 could be entered for an age in years. You can verify that a user's input represents a valid value by assigning an instance of that value's type to the property. You can detect whether the user removes focus from when it contains an invalid value by monitoring for the event. If type validation succeeds, the object representing the value will be available through the property of the parameter. - - As with the control, several common keyboard shortcuts do not work with . In particular, CTRL-R (right justify text), CTRL-L (left justify text), and CTRL-L (center text) have no effect. - -## Compatibility with Visual Basic 6.0 - was designed to retain most of the functionality of the Masked Edit control in Visual Basic 6.0. The following table lists common properties on the Masked Edit control and gives their equivalents on . - -|Masked Edit control (Visual Basic 6.0) property|Equivalent MaskedTextBox (.NET Framework) property| -|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| -|`AllowPrompt` property|| -|`AutoTab` property|None| -|`ClipMode` property|| -|`ClipText` property| (when is set to )| -|`Format` property|None| -|`FormattedText` property| (when is set to )| -|`Mask` property|| -|`PromptChar` property|| -|`PromptInclude` property|| -|`ValidationError` event|| - + class is an enhanced control that supports a declarative syntax for accepting or rejecting user input. Using the property, you can specify the following input without writing any custom validation logic in your application: + +- Required input characters. + +- Optional input characters. + +- The type of input expected at a given position in the mask; for example, a digit, or an alphabetic or alphanumeric character. + +- Mask literals, or characters that should appear directly in the ; for example, the hyphens (-) in a phone number, or the currency symbol in a price. + +- Special processing for input characters; for example, to convert alphabetic characters to uppercase. + + When a control is displayed at run time, it represents the mask as a series of prompt characters and optional literal characters. Each editable mask position, representing a required or optional input, is shown with a single prompt character. For example, the number sign (#) is often used as a placeholder for a numeric character input. You can use the property to specify a custom prompt character. The property determines if the user sees the prompt characters when the control loses input focus. + + As the user types input into the masked text box, valid input characters replace their respective prompt characters in a sequential fashion. If the user types an invalid input character, no replacement occurs, but instead a beep is issued if the property is set to `true`, and the event is raised. You can provide your own custom error logic by handing this event. + + When the current insertion point is at a literal character, the user has a number of options: + +- If a character other than the prompt character is typed, the literal will automatically be skipped and the input character will be applied to the next editable position, represented by the next prompt character. + +- If the prompt character is typed and the property is true, the input will overtype the prompt character and insertion point will be moved to the next position in the mask. + +- As is always the case, the arrow keys can be used to navigate to a previous or subsequent position. + + You can use the property to verify whether or not the user has entered all of the required input. The property will always retrieve the user's input formatted according to the mask and the property. + + The control actually defers all mask processing to the class specified by the property. This standard provider supports all Unicode characters except for surrogates and vertically combined characters; however, the property can be used to restrict input to the characters sets a-z, A-Z, and 0-9. + + Masks do not necessarily guarantee that a user's input will represent a valid value for a given type; for example, -9 could be entered for an age in years. You can verify that a user's input represents a valid value by assigning an instance of that value's type to the property. You can detect whether the user removes focus from when it contains an invalid value by monitoring for the event. If type validation succeeds, the object representing the value will be available through the property of the parameter. + + As with the control, several common keyboard shortcuts do not work with . In particular, CTRL-R (right justify text), CTRL-L (left justify text), and CTRL-L (center text) have no effect. + +## Compatibility with Visual Basic 6.0 + was designed to retain most of the functionality of the Masked Edit control in Visual Basic 6.0. The following table lists common properties on the Masked Edit control and gives their equivalents on . + +|Masked Edit control (Visual Basic 6.0) property|Equivalent MaskedTextBox (.NET Framework) property| +|-------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------| +|`AllowPrompt` property|| +|`AutoTab` property|None| +|`ClipMode` property|| +|`ClipText` property| (when is set to )| +|`Format` property|None| +|`FormattedText` property| (when is set to )| +|`Mask` property|| +|`PromptChar` property|| +|`PromptInclude` property|| +|`ValidationError` event|| + > [!CAUTION] -> The control does not support multiline configuration or undo functionality. However, while the members associated with these features have been retained for compatibility with the base class, their implementations perform no actions. - - - -## Examples - The following code example initializes the to accept a date, and uses both the and events to alert the user to invalid input. - +> The control does not support multiline configuration or undo functionality. However, while the members associated with these features have been retained for compatibility with the base class, their implementations perform no actions. + + + +## Examples + The following code example initializes the to accept a date, and uses both the and events to alert the user to invalid input. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: + ]]> - MaskedTextBox Control (Windows Forms) + MaskedTextBox Control (Windows Forms) @@ -157,11 +157,11 @@ Initializes a new instance of the class using defaults. - constructor sets the property to a null mask, represented by the string "<>". A null mask will accept any combination of characters as input. - + constructor sets the property to a null mask, represented by the string "<>". A null mask will accept any combination of characters as input. + ]]> @@ -194,13 +194,13 @@ A custom mask language provider, derived from the class. Initializes a new instance of the class using the specified custom mask language provider. - . It is responsible for parsing the mask and determining whether user input conforms to the current mask position. You can derive a new class from to define your own custom masking language, and use the constructor to replace the standard . - - If you want to use the default masking language and supply your own input mask, you do not need to use this constructor. Instead, you can either use the constructor, or use the parameterless constructor then set the property. - + . It is responsible for parsing the mask and determining whether user input conforms to the current mask position. You can derive a new class from to define your own custom masking language, and use the constructor to replace the standard . + + If you want to use the default masking language and supply your own input mask, you do not need to use this constructor. Instead, you can either use the constructor, or use the parameterless constructor then set the property. + ]]> @@ -236,13 +236,13 @@ A representing the input mask. The initial value of the property. Initializes a new instance of the class using the specified input mask. - constructor uses the standard with the input `mask` to parse user input into the . - - If you assign a new mask to the property, it will override the value set by this constructor. - + constructor uses the standard with the input `mask` to parse user input into the . + + If you assign a new mask to the property, it will override the value set by this constructor. + ]]> @@ -296,11 +296,11 @@ in all cases. - property is inherited from the base class. However, because the control does not support multiline configuration, this property is not supported. - + property is inherited from the base class. However, because the control does not support multiline configuration, this property is not supported. + ]]> @@ -356,11 +356,11 @@ Occurs when the value of the property has changed. This event is not raised by . - event is inherited from the base class. However, because the control does not support multiline configuration, this event is not supported. - + event is inherited from the base class. However, because the control does not support multiline configuration, this event is not supported. + ]]> @@ -401,13 +401,13 @@ if the user can enter the prompt character into the control; otherwise, . The default is . - is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. For example, if is "*", and the current location in the mask demands the user enter a digit, entering an asterisk (\*) will fail and cause the event to occur. - - The property takes precedence over . - + is `true`, the prompt character must be valid for the current location in the mask in order to be accepted. For example, if is "*", and the current location in the mask demands the user enter a digit, entering an asterisk (\*) will fail and cause the event to occur. + + The property takes precedence over . + ]]> @@ -456,11 +456,11 @@ if only ASCII is accepted; if the control can accept any arbitrary Unicode character. The default is . - restricts user input to the characters a-z and A-Z. ASCII control characters are not allowed. - + restricts user input to the characters a-z and A-Z. ASCII control characters are not allowed. + ]]> @@ -500,11 +500,11 @@ if the control should beep on invalid input; otherwise, . The default is . - event will still occur if the property is set to `true`. - + event will still occur if the property is set to `true`. + ]]> @@ -556,11 +556,11 @@ in all cases. - property is inherited from the base class. However, because does not support undo functionality, this property always has a value of `false`. - + property is inherited from the base class. However, because does not support undo functionality, this property always has a value of `false`. + ]]> @@ -599,11 +599,11 @@ Clears information about the most recent operation from the undo buffer of the text box. This method is not supported by . - method is inherited from the base class. However, does not support undo functionality. - + method is inherited from the base class. However, does not support undo functionality. + ]]> @@ -778,14 +778,14 @@ Gets or sets a value that determines whether literals and prompt characters are copied to the clipboard. One of the values. The default is . - property determines how text, selected within the control, is interpreted when it is copied to the clipboard or retrieved through the property. Specifically, it determines whether literal characters, prompt characters, or both are included when selected text is accessed. When prompt characters are excluded, they are transformed into spaces in the copied string. - + property determines how text, selected within the control, is interpreted when it is copied to the clipboard or retrieved through the property. Specifically, it determines whether literal characters, prompt characters, or both are included when selected text is accessed. When prompt characters are excluded, they are transformed into spaces in the copied string. + > [!NOTE] -> The property serves a similar purpose with respect to how the property is interpreted. - +> The property serves a similar purpose with respect to how the property is interpreted. + ]]> Property set with a value that is not valid. @@ -849,11 +849,11 @@ Gets or sets the to use when performing type validation. An object that implements the interface. - determines which symbols are used for the currency, date, and other culture-specific mask placeholders when type validation occurs and the control has a non-null property. - + determines which symbols are used for the currency, date, and other culture-specific mask placeholders when type validation occurs and the control has a non-null property. + ]]> @@ -962,11 +962,11 @@ Retrieves the index of the first character of a given line. This method is not supported by . This method will always return 0. - method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. - + method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. + ]]> @@ -1007,11 +1007,11 @@ Retrieves the index of the first character of the current line. This method is not supported by . This method will always return 0. - method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. - + method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. + ]]> @@ -1055,11 +1055,11 @@ Retrieves the line number from the specified character position within the text of the control. This method is not supported by . This method will always return 0. - method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. - + method is inherited from the base class. However, because the control does not support multiline configuration, this method is not supported. + ]]> @@ -1183,15 +1183,15 @@ Gets or sets the text insertion mode of the masked text box control. An value that indicates the current insertion mode. The default is . - property controls the character insertion behavior of the control. The state of this property is defined by the enumeration, which can be always on, always off or set to respect the setting of the user's keyboard. This property supersedes the insertion mode of the keyboard. For example, if the keyboard is set to overwrite, but is set to `Insert`, the will operate in insert mode. The property will access the true insertion mode of the . - - If changing changes the value of , will raise the event. - - This property has no effect if no mask has been set. - + property controls the character insertion behavior of the control. The state of this property is defined by the enumeration, which can be always on, always off or set to respect the setting of the user's keyboard. This property supersedes the insertion mode of the keyboard. For example, if the keyboard is set to overwrite, but is set to `Insert`, the will operate in insert mode. The property will access the true insertion mode of the . + + If changing changes the value of , will raise the event. + + This property has no effect if no mask has been set. + ]]> An invalid value was supplied when setting this property. @@ -1265,13 +1265,13 @@ if will overwrite existing characters as the user enters new ones; if will shift existing characters forward. The default is . - takes into account both the value of the property and the state of the user's keyboard. If is set to either or , will return `false` or `true`, respectively. If is set to , it will return the state of the INSERT key. - - When is `false`, will reject as invalid any character entry that would result in a violation anywhere in the mask. In explanation, if inserting a character would cause a character to be shifted over into a mask position where it would not be valid, the character insertion will be rejected. - + takes into account both the value of the property and the state of the user's keyboard. If is set to either or , will return `false` or `true`, respectively. If is set to , it will return the state of the INSERT key. + + When is `false`, will reject as invalid any character entry that would result in a violation anywhere in the mask. In explanation, if inserting a character would cause a character to be shifted over into a mask position where it would not be valid, the character insertion will be rejected. + ]]> @@ -1310,23 +1310,23 @@ Occurs after the insert mode has changed. - event is raised after value of the property is changed. - - This event is required to properly bind data to a control. - - - -## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. - + event is raised after value of the property is changed. + + This event is required to properly bind data to a control. + + + +## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet484"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet484"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet484"::: + ]]> @@ -1377,11 +1377,11 @@ Gets or sets the lines of text in multiline configurations. This property is not supported by . An array of type that contains a single line. - property is inherited from the base class. However, because the control does not support multiline configuration, this property is not supported. - + property is inherited from the base class. However, because the control does not support multiline configuration, this property is not supported. + ]]> @@ -1445,53 +1445,53 @@ Gets or sets the input mask to use at run time. A representing the current mask. The default value is the empty string which allows any input. - is the default property for the class. - - must be a string composed of one or more of the masking elements, as shown in the following table. The masking language used by is defined by its associated . The standard provider specifies a masking language based upon the one used by the Masked Edit control in Visual Basic 6.0, and should be very familiar to users migrating from that platform. - -|Masking element|Description| -|---------------------|-----------------| -|0|Digit, required. This element will accept any single digit between 0 and 9.| -|9|Digit or space, optional.| -|#|Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the property. Plus (+) and minus (-) signs are allowed.| -|L|Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.| -|?|Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.| -|&|Character, required. If the property is set to true, this element behaves like the "L" element.| -|C|Character, optional. Any non-control character. If the property is set to `true`, this element behaves like the "?" element.| -|A|Alphanumeric, required. If the property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element.| -|a|Alphanumeric, optional. If the property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element.| -|.|Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's property.| -|,|Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's property.| -|:|Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's property.| -|/|Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's property.| -|$|Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's property.| -|\<|Shift down. Converts all characters that follow to lowercase.| -|>|Shift up. Converts all characters that follow to uppercase.| -|||Disable a previous shift up or shift down.| -|\|Escape. Escapes a mask character, turning it into a literal. "\\\\" is the escape sequence for a backslash.| -|All other characters|Literals. All non-mask elements will appear as themselves within . Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.| - - If you change a mask when already contains user input filtered by a previous mask, will attempt to migrate that input into the new mask definition. If it fails, it will clear the existing input. Assigning a zero-length string as the mask will preserve any existing data in the control. When used with a zero-length mask, behaves like a single-line control. - - The decimal (.), thousandths (,), time (:), date (/), and currency ($) symbols default to displaying those symbols as defined by the application's culture. You can force them to display symbols for another culture by using the property. - - Character insertion into the mask at run time is controlled by the property. Users can navigate through the mask by using the left and right arrow keys or the mouse cursor, and can skip optional positions in the mask by entering a space. - + is the default property for the class. + + must be a string composed of one or more of the masking elements, as shown in the following table. The masking language used by is defined by its associated . The standard provider specifies a masking language based upon the one used by the Masked Edit control in Visual Basic 6.0, and should be very familiar to users migrating from that platform. + +|Masking element|Description| +|---------------------|-----------------| +|0|Digit, required. This element will accept any single digit between 0 and 9.| +|9|Digit or space, optional.| +|#|Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the property. Plus (+) and minus (-) signs are allowed.| +|L|Letter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.| +|?|Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.| +|&|Character, required. If the property is set to true, this element behaves like the "L" element.| +|C|Character, optional. Any non-control character. If the property is set to `true`, this element behaves like the "?" element.| +|A|Alphanumeric, required. If the property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element.| +|a|Alphanumeric, optional. If the property is set to `true`, the only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element.| +|.|Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's property.| +|,|Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's property.| +|:|Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's property.| +|/|Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's property.| +|$|Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's property.| +|\<|Shift down. Converts all characters that follow to lowercase.| +|>|Shift up. Converts all characters that follow to uppercase.| +|||Disable a previous shift up or shift down.| +|\|Escape. Escapes a mask character, turning it into a literal. "\\\\" is the escape sequence for a backslash.| +|All other characters|Literals. All non-mask elements will appear as themselves within . Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.| + + If you change a mask when already contains user input filtered by a previous mask, will attempt to migrate that input into the new mask definition. If it fails, it will clear the existing input. Assigning a zero-length string as the mask will preserve any existing data in the control. When used with a zero-length mask, behaves like a single-line control. + + The decimal (.), thousandths (,), time (:), date (/), and currency ($) symbols default to displaying those symbols as defined by the application's culture. You can force them to display symbols for another culture by using the property. + + Character insertion into the mask at run time is controlled by the property. Users can navigate through the mask by using the left and right arrow keys or the mouse cursor, and can skip optional positions in the mask by entering a space. + > [!IMPORTANT] -> supports all Unicode characters except for surrogates and vertically combined characters. - - The following table shows example masks. - -|Mask|Behavior| -|----------|--------------| -|`00/00/0000`|A date (day, numeric month, year) in international date format. The "/" character is a logical date separator, and will appear to the user as the date separator appropriate to the application's current culture.| -|`00->L supports all Unicode characters except for surrogates and vertically combined characters. + + The following table shows example masks. + +|Mask|Behavior| +|----------|--------------| +|`00/00/0000`|A date (day, numeric month, year) in international date format. The "/" character is a logical date separator, and will appear to the user as the date separator appropriate to the application's current culture.| +|`00->L The string supplied to the property is not a valid mask. Invalid masks include masks containing non-printable characters. @@ -1534,21 +1534,21 @@ Occurs after the input mask is changed. - event is raised after the value of the property is changed. This event is also raised if the is indirectly altered by a member such as , , , and . - - - -## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. - + event is raised after the value of the property is changed. This event is also raised if the is indirectly altered by a member such as , , , and . + + + +## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet485"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet485"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet485"::: + ]]> @@ -1589,11 +1589,11 @@ if all required input has been entered into the mask; otherwise, . - checks only required input elements. To determine whether all required and optional input elements have been filled in, use the property instead. - + checks only required input elements. To determine whether all required and optional input elements have been filled in, use the property instead. + ]]> @@ -1647,13 +1647,13 @@ Gets a clone of the mask provider associated with this instance of the masked text box control. A masking language provider of type . - property defines the mask-parsing engine and the masking language used by the control. The default provider is the class; however, a custom provider can be specified using the constructor. - - cannot be set directly. However, setting some of the properties of - such as , , , and - may internally cause the creation of a new . - + property defines the mask-parsing engine and the masking language used by the control. The default provider is the class; however, a custom provider can be specified using the constructor. + + cannot be set directly. However, setting some of the properties of - such as , , , and - may internally cause the creation of a new . + ]]> @@ -1693,19 +1693,19 @@ if all required and optional inputs have been entered; otherwise, . - property within the event handler to determine if the user's input was rejected because there are no remaining inputs in the mask. To determine whether only required input elements have been entered, use the property. - - - -## Examples - The following code example handles the event, and uses a to alert the user if an attempt is made to enter data after all positions in the mask have been used. - + property within the event handler to determine if the user's input was rejected because there are no remaining inputs in the mask. To determine whether only required input elements have been entered, use the property. + + + +## Examples + The following code example handles the event, and uses a to alert the user if an attempt is made to enter data after all positions in the mask have been used. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MaskInputRejectedSample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1747,37 +1747,37 @@ Occurs when the user's input or assigned character does not match the corresponding format element of the input mask. - is the default event for the class. - - The event occurs when a character is rejected by the input mask. The input mask, represented by the property, is interpreted by the masked text provider associated with the control through the property. is raised in the following situations: - -- An input character does not match the corresponding format element. For example, the user enters an alphabetic character when a digit is required. This is probably the most common reason why this event is raised. - -- The user is trying to input extraneous characters beyond the end of the mask either because the mask has already been filled or the current caret position has been moved to the very end of the displayed input mask string. - -- A paste operation either inserts a character that does not match its associated format element, or if the property is `false`, it shifts existing characters into new positions where they do not match their format elements. - -- A cut operation shifts existing characters to the left, and one or more characters do not match their newly associated format elements. - -- An assignment was made to the property and the assigned string caused one or more mask violations. - - If a string was assigned to the control that causes to occur, no part of the string will appear in . - - The default handling for will play a beep sound if the property is set to `true`. This event is often handled to implement custom error handling, for example, to move to the next user input control if the mask is full, or to display a custom error dialog box or ToolTip if the input character is invalid. - - - -## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. - + is the default event for the class. + + The event occurs when a character is rejected by the input mask. The input mask, represented by the property, is interpreted by the masked text provider associated with the control through the property. is raised in the following situations: + +- An input character does not match the corresponding format element. For example, the user enters an alphabetic character when a digit is required. This is probably the most common reason why this event is raised. + +- The user is trying to input extraneous characters beyond the end of the mask either because the mask has already been filled or the current caret position has been moved to the very end of the displayed input mask string. + +- A paste operation either inserts a character that does not match its associated format element, or if the property is `false`, it shifts existing characters into new positions where they do not match their format elements. + +- A cut operation shifts existing characters to the left, and one or more characters do not match their newly associated format elements. + +- An assignment was made to the property and the assigned string caused one or more mask violations. + + If a string was assigned to the control that causes to occur, no part of the string will appear in . + + The default handling for will play a beep sound if the property is set to `true`. This event is often handled to implement custom error handling, for example, to move to the next user input control if the mask is full, or to display a custom error dialog box or ToolTip if the input character is invalid. + + + +## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet486"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet486"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet486"::: + ]]> @@ -1832,11 +1832,11 @@ Gets or sets the maximum number of characters the user can type or paste into the text box control. This property is not supported by . This property always returns 0. - property and the property in the class for information about how to determine the maximum length of a string in a . - + property and the property in the class for information about how to determine the maximum length of a string in a . + ]]> @@ -1887,11 +1887,11 @@ Gets or sets a value indicating whether this is a multiline text box control. This property is not fully supported by . This property always returns . - property is inherited from the base class. However, because the control does not support multiline configuration, this property is not fully supported; it cannot be set and it always resolves to `false`. - + property is inherited from the base class. However, because the control does not support multiline configuration, this property is not fully supported; it cannot be set and it always resolves to `false`. + ]]> @@ -1947,11 +1947,11 @@ Typically occurs when the value of the property has changed; however, this event is not raised by . - event is inherited from the base class. However, because the control does not support multiline configuration, this event is not implemented in . - + event is inherited from the base class. However, because the control does not support multiline configuration, this event is not implemented in . + ]]> @@ -2081,13 +2081,13 @@ An that contains 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. + ]]> @@ -2228,13 +2228,13 @@ An that contains 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. + ]]> @@ -2305,11 +2305,11 @@ An that contains event data. Typically raises the event, but disabled for . - method is inherited from the base class. However, because the control does not support multiline configuration, this method is overridden to perform no actions. - + method is inherited from the base class. However, because the control does not support multiline configuration, this method is overridden to perform no actions. + ]]> @@ -2345,13 +2345,13 @@ An that contains 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. + ]]> @@ -2390,13 +2390,13 @@ An that contains 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. + ]]> @@ -2441,18 +2441,18 @@ A that contains event data. Raises the event. - method causes the input string to be validated against the property, if a has been specified for this property. It will then also raise the event. - + method causes the input string to be validated against the property, if a has been specified for this property. It will then also raise the event. + > [!NOTE] -> To ensure consistency with text-based controls, validation will occur even if the is read-only (its property is set to `true`). - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - +> To ensure consistency with text-based controls, validation will occur even if the is read-only (its property is set to `true`). + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> A critical exception occurred during the parsing of the input string. @@ -2504,16 +2504,16 @@ Gets or sets the character to be displayed in substitute for user input. The value used as the password character. - property is set to a non-null character, will display this character for all input into the control. Setting this property to `null` will disable this functionality. - - If you want to use the operating system supplied password character, which is defined in COMCTL32.dll, use the property instead. If both the and properties are activated, the latter takes precedence. - + property is set to a non-null character, will display this character for all input into the control. Setting this property to `null` will disable this functionality. + + If you want to use the operating system supplied password character, which is defined in COMCTL32.dll, use the property instead. If both the and properties are activated, the latter takes precedence. + > [!IMPORTANT] -> As a security consideration, the control disables cut and copy operations on password-protected strings. - +> As a security consideration, the control disables cut and copy operations on password-protected strings. + ]]> The character specified when setting this property is not a valid password character, as determined by the method of the class. @@ -2590,11 +2590,11 @@ if the message was processed by the control; otherwise, . - overrides its base control's implementation of to properly handle character events when the user is entering characters using an Input Method Editor (IME), such as is used for entering Japanese, Chinese, and other complex non-Latin scripts. detects any WM_CHAR messages that occur after it receives a WM_IME_CHAR message and suppresses them in order to prevent these characters from showing up in the control. If you derive from this control and override this message, you should duplicate this behavior if you wish your new control to work with IMEs. - + overrides its base control's implementation of to properly handle character events when the user is entering characters using an Input Method Editor (IME), such as is used for entering Japanese, Chinese, and other complex non-Latin scripts. detects any WM_CHAR messages that occur after it receives a WM_IME_CHAR message and suppresses them in order to prevent these characters from showing up in the control. If you derive from this control and override this message, you should duplicate this behavior if you wish your new control to work with IMEs. + ]]> @@ -2643,13 +2643,13 @@ Gets or sets the character used to represent the absence of user input in . The character used to prompt the user for input. The default is an underscore (_). - will be displayed in for any mask position that the user has not yet filled in. - - Use the property to specify whether the prompt is displayed when does not have focus. - + will be displayed in for any mask position that the user has not yet filled in. + + Use the property to specify whether the prompt is displayed when does not have focus. + ]]> The character specified when setting this property is not a valid prompt character, as determined by the method of the class. @@ -2723,21 +2723,21 @@ if processing of the input string should be terminated at the first parsing error; otherwise, if processing should ignore all errors. The default is . - in a single input operation, typically by copying and pasting a string. If the entire string only contains valid characters, according to their paste position in the input mask, then the entire operation will succeed. However, when a parsing error occurs, the behavior of depends on the value of , as follows: - -- If this property is `true`, then processing of the input string stops at the invalid character. All subsequent characters are ignored. A single event is raised. - -- If this property is `false`, then the invalid character is rejected, but parsing continues with the next character in the input string. A event is raised for every invalid character in the input string. - - The , and properties can also influence the interpretation of the user input. - - If the property is `false`, then any characters already in the input mask to the right of the insertion point will be displaced by the accepted number of characters. This shifting may cause additional parsing errors. - - A pasting operation can be mimicked programmatically by setting the property. - + in a single input operation, typically by copying and pasting a string. If the entire string only contains valid characters, according to their paste position in the input mask, then the entire operation will succeed. However, when a parsing error occurs, the behavior of depends on the value of , as follows: + +- If this property is `true`, then processing of the input string stops at the invalid character. All subsequent characters are ignored. A single event is raised. + +- If this property is `false`, then the invalid character is rejected, but parsing continues with the next character in the input string. A event is raised for every invalid character in the input string. + + The , and properties can also influence the interpretation of the user input. + + If the property is `false`, then any characters already in the input mask to the right of the insertion point will be displaced by the accepted number of characters. This shifting may cause additional parsing errors. + + A pasting operation can be mimicked programmatically by setting the property. + ]]> @@ -2781,20 +2781,20 @@ if the prompt character entered as input causes the current editable position in the mask to be reset; otherwise, to indicate that the prompt character is to be processed as a normal input character. The default is . - can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Assuming that the property is set to non-`null`, then setting the property to `true` will result in special processing for the prompt character. When the user enters the prompt character into the mask, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character. - - takes precedence over the property, as shown in the following table. - -|ResetOnPrompt value|AllowPromptAsInput value|Resulting behavior| -|-------------------------|------------------------------|------------------------| -|`true`|`true`|The prompt character can be entered and it causes the current mask position to be reset. This is the default.| -|`true`|`false`|The prompt character can be entered and it causes the current mask position to be reset.| -|`false`|`true`|The prompt character is processed as a standard input character.| -|`false`|`false`|The prompt character is not valid and raises a event.| - + can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Assuming that the property is set to non-`null`, then setting the property to `true` will result in special processing for the prompt character. When the user enters the prompt character into the mask, it causes the current mask character position to be cleared and the current position to be advanced to the next editable character. + + takes precedence over the property, as shown in the following table. + +|ResetOnPrompt value|AllowPromptAsInput value|Resulting behavior| +|-------------------------|------------------------------|------------------------| +|`true`|`true`|The prompt character can be entered and it causes the current mask position to be reset. This is the default.| +|`true`|`false`|The prompt character can be entered and it causes the current mask position to be reset.| +|`false`|`true`|The prompt character is processed as a standard input character.| +|`false`|`false`|The prompt character is not valid and raises a event.| + ]]> @@ -2836,13 +2836,13 @@ if the space input character causes the current editable position in the mask to be reset; otherwise, to indicate that it is to be processed as a normal input character. The default is . - can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Setting the property to `true` will result in the current mask character position to be cleared and the current position to be advanced to the next editable character. - - The type of character input will determine whether the masking engine moves forward to the next character in the mask, or stays at the current position and waits for a matching character. If the input character is a space, and does not match the current non-editable character in the mask, the masking engine will skip ahead to the next character in the mask. If the input character is not a space, and does not match the current non-editable character in the mask, the masking engine will remain at the current mask position, and attempt to match the next input character against it. - + can treat two categories of characters - spaces and prompt characters - specially. Typically, each input character will be tested against the mask and either accepted or rejected. Setting the property to `true` will result in the current mask character position to be cleared and the current position to be advanced to the next editable character. + + The type of character input will determine whether the masking engine moves forward to the next character in the mask, or stays at the current position and waits for a matching character. If the input character is a space, and does not match the current non-editable character in the mask, the masking engine will skip ahead to the next character in the mask. If the input character is not a space, and does not match the current non-editable character in the mask, the masking engine will remain at the current mask position, and attempt to match the next input character against it. + ]]> @@ -2880,11 +2880,11 @@ Scrolls the contents of the control to the current caret position. This method is not supported by . - method is inherited from the base class. However, because the control does not support multiline configuration, this method is overridden to perform no actions. - + method is inherited from the base class. However, because the control does not support multiline configuration, this method is overridden to perform no actions. + ]]> @@ -2916,11 +2916,11 @@ Gets or sets the current selection in the control. The currently selected text as a . If no text is currently selected, this property resolves to an empty string. - , , and . Selections set using this property behave like a Paste operation: each character is matched against the mask, and the event is raised for invalid characters. If is `true`, literals and prompt characters are allowed when setting , and will be removed silently unless they violate the mask. - + , , and . Selections set using this property behave like a Paste operation: each character is matched against the mask, and the event is raised for invalid characters. If is `true`, literals and prompt characters are allowed when setting , and will be removed silently unless they violate the mask. + ]]> @@ -2963,23 +2963,23 @@ to allow literals to be reentered; otherwise, to prevent the user from overwriting literal characters. The default is . - at runtime, the current character position will sometimes fall on a literal. The property describes how user input for the next character is to be handled, as follows: - -- If this property is `true`, the user can either redundantly enter the same character as the literal at the current position, or can enter the next editable character, thereby jumping the current position to that position. - -- If this property is `false`, the user can only enter the next editable character. If the next position in the mask will not accept the literal character (for example, the user types "/" and the next position only accepts digits), the control will raise the event. - - As an example, in the "90/90/0000" date entry mask, the forward slash characters are literals. Assume that the user has entered two initial digits, "11", so the current position in the mask is at the first forward slash (/) literal. If is `true`, then the user has the following valid choices: - -- The user can enter a "/" character. This results in the position being moved to the next character, which in this example is the fourth position, a 9 masking element. - -- The user can enter the next editable character, which in this example is a digit. The digit would be validated and the current position would automatically be moved to the fifth position, which is a 0 masking element. - - If is `false`, then only a valid data input is allowed, which in this example would be a digit. - + at runtime, the current character position will sometimes fall on a literal. The property describes how user input for the next character is to be handled, as follows: + +- If this property is `true`, the user can either redundantly enter the same character as the literal at the current position, or can enter the next editable character, thereby jumping the current position to that position. + +- If this property is `false`, the user can only enter the next editable character. If the next position in the mask will not accept the literal character (for example, the user types "/" and the next position only accepts digits), the control will raise the event. + + As an example, in the "90/90/0000" date entry mask, the forward slash characters are literals. Assume that the user has entered two initial digits, "11", so the current position in the mask is at the first forward slash (/) literal. If is `true`, then the user has the following valid choices: + +- The user can enter a "/" character. This results in the position being moved to the next character, which in this example is the fourth position, a 9 masking element. + +- The user can enter the next editable character, which in this example is a digit. The digit would be validated and the current position would automatically be moved to the fifth position, which is a 0 masking element. + + If is `false`, then only a valid data input is allowed, which in this example would be a digit. + ]]> @@ -3041,26 +3041,26 @@ Gets or sets the text as it is currently displayed to the user. A containing the text currently displayed by the control. The default is an empty string. - is the default binding property for the class. - - Strings retrieved using this property are formatted according to the control's formatting properties, such as and . - - You can assign a string with or without literal characters to depending on the values of , , and . - - is the default binding property for . - - will raise the event whenever the formatted text value changes. Different properties may or may not cause this value to change. For example, changing the property will not raise the event, but changing the property will. - - - -## Examples - The following code example demonstrates the use of the property. - - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TestMaskedTextBox/VB/form1.vb" id="Snippet3"::: - + is the default binding property for the class. + + Strings retrieved using this property are formatted according to the control's formatting properties, such as and . + + You can assign a string with or without literal characters to depending on the values of , , and . + + is the default binding property for . + + will raise the event whenever the formatted text value changes. Different properties may or may not cause this value to change. For example, changing the property will not raise the event, but changing the property will. + + + +## Examples + The following code example demonstrates the use of the property. + + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TestMaskedTextBox/VB/form1.vb" id="Snippet3"::: + ]]> @@ -3112,11 +3112,11 @@ Gets or sets how text is aligned in a masked text box control. One of the enumeration values that specifies how text is aligned relative to the control. The default is . - property to align the displayed text within a to match the layout of visual elements on your form. For example, if your controls are all located on the right side of the form, you can set the property to , and the text will be aligned with the right side of the control instead of the default left alignment. - + property to align the displayed text within a to match the layout of visual elements on your form. For example, if your controls are all located on the right side of the form, you can set the property to , and the text will be aligned with the right side of the control instead of the default left alignment. + ]]> The value assigned to this property is not of type . @@ -3158,21 +3158,21 @@ Occurs when the text alignment is changed. - event is raised after the property is changed. - - - -## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. - + event is raised after the property is changed. + + + +## 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 type named `MaskedTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet487"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet487"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet487"::: + ]]> @@ -3253,14 +3253,14 @@ Gets or sets a value that determines whether literals and prompt characters are included in the formatted string. One of the values. The default is . - property determines how the literal and prompt characters in the mask are processed when the generating the formatted string. More specifically, it determines whether literal characters, prompt characters, or both are included in the property. When prompt characters are excluded, they are transformed into spaces in the formatted string. - + property determines how the literal and prompt characters in the mask are processed when the generating the formatted string. More specifically, it determines whether literal characters, prompt characters, or both are included in the property. When prompt characters are excluded, they are transformed into spaces in the formatted string. + > [!NOTE] -> The property serves a similar purpose with respect to how the property is interpreted. - +> The property serves a similar purpose with respect to how the property is interpreted. + ]]> Property set with a value that is not valid. @@ -3298,15 +3298,15 @@ Returns a string that represents the current masked text box. This method overrides . A that contains information about the current . The string includes the type, a simplified view of the input string, and the formatted input string. - method calls the base class implementation of this method, , then appends the input string after processing by the mask. This method honors properties that alter the appearance of the formatted string, with the following exceptions: - -- The returned string always includes prompt and literal characters, regardless of the values of the property. - -- Password characters are ignored, so that the actual user-typed characters are returned. In other words, the values of the and properties are ignored. - + method calls the base class implementation of this method, , then appends the input string after processing by the mask. This method honors properties that alter the appearance of the formatted string, with the following exceptions: + +- The returned string always includes prompt and literal characters, regardless of the values of the property. + +- Password characters are ignored, so that the actual user-typed characters are returned. In other words, the values of the and properties are ignored. + ]]> @@ -3347,37 +3347,37 @@ Occurs when has finished parsing the current value using the property. - control will optionally validate user input against the type defined by its property. When this property is not `null`, the following series of events occurs: - -1. The validation sequence begins when one of the following occurs: - - - control looses focus. - - - The property is retrieved. - - - The method is called. - -2. Any of these events result in a call to the `Parse` method of the type specified with the property. `Parse` is responsible for the conversion of the formatted input string to the target type. A successful conversion equates to a successful validation. - -3. After `Parse` returns, the event is raised. The event handler for this event is most commonly implemented to perform type or mask validation processing. It receives a parameter containing information about the conversion; for example, the member indicates whether the conversion was successful. - -4. After the event handler for the event returns, the standard validation event, , is raised. A handler can be implemented to perform standard validation, perhaps including canceling the event. - -5. If the event is not canceled in step 3, the standard control validation event is raised. - - If the property is set to `true` in the event handler, the event will be canceled and the control retains focus, unless the subsequent event sets its version of the property back to `false`. - - - -## Examples - The following code example attempts to parse the user's input as a valid object. If it fails, the event handler displays an error message to the user. If the value is a valid , the code verifies that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a control named `MaskedTextBox1` and a control named `ToolTip1`. - + control will optionally validate user input against the type defined by its property. When this property is not `null`, the following series of events occurs: + +1. The validation sequence begins when one of the following occurs: + + - control looses focus. + + - The property is retrieved. + + - The method is called. + +2. Any of these events result in a call to the `Parse` method of the type specified with the property. `Parse` is responsible for the conversion of the formatted input string to the target type. A successful conversion equates to a successful validation. + +3. After `Parse` returns, the event is raised. The event handler for this event is most commonly implemented to perform type or mask validation processing. It receives a parameter containing information about the conversion; for example, the member indicates whether the conversion was successful. + +4. After the event handler for the event returns, the standard validation event, , is raised. A handler can be implemented to perform standard validation, perhaps including canceling the event. + +5. If the event is not canceled in step 3, the standard control validation event is raised. + + If the property is set to `true` in the event handler, the event will be canceled and the control retains focus, unless the subsequent event sets its version of the property back to `false`. + + + +## Examples + The following code example attempts to parse the user's input as a valid object. If it fails, the event handler displays an error message to the user. If the value is a valid , the code verifies that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a control named `MaskedTextBox1` and a control named `ToolTip1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/TypeValidationCompleted/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3418,11 +3418,11 @@ Undoes the last edit operation in the text box. This method is not supported by . - method is inherited from the base class. However, does not support undo functionality. - + method is inherited from the base class. However, does not support undo functionality. + ]]> @@ -3470,14 +3470,14 @@ if the system password should be used as the prompt character; otherwise, . The default is . - property determines whether user-supplied input should be displayed in the as multiple occurrences of a password character defined by the operating system. functions similarly to the property, but instead of using a programmer-supplied character for the prompt, uses a prompt defined by the operating system. This property has precedence over . - + property determines whether user-supplied input should be displayed in the as multiple occurrences of a password character defined by the operating system. functions similarly to the property, but instead of using a programmer-supplied character for the prompt, uses a prompt defined by the operating system. This property has precedence over . + > [!IMPORTANT] -> As a security consideration, the control disables cut and copy operations on password-protected strings. - +> As a security consideration, the control disables cut and copy operations on password-protected strings. + ]]> The password character specified is the same as the current prompt character, . The two are required to be different. @@ -3520,13 +3520,13 @@ Converts the user input string to an instance of the validating type. If successful, an of the type specified by the property; otherwise, to indicate conversion failure. - method attempts to convert the formatted string contained in the property to an instance of the type that is specified by the property. Prompt characters are ignored in the formatted string, but literals are handled in accordance with the current value of the property. - - raises the event after the conversion is attempted, regardless of its success. - + method attempts to convert the formatted string contained in the property to an instance of the type that is specified by the property. Prompt characters are ignored in the formatted string, but literals are handled in accordance with the current value of the property. + + raises the event after the conversion is attempted, regardless of its success. + ]]> A critical exception occurred during the parsing of the input string. @@ -3581,37 +3581,37 @@ Gets or sets the data type used to verify the data input by the user. A representing the data type used in validation. The default is . - to verify whether the data entered by the user falls within the correct range - in the previously mentioned case, by assigning it an instance of the type. The current text in the control will be validated either when the user leaves the control. You can determine whether or not the data fails validation by monitoring for the event. will only perform the check against if is `true`. - - If you want to use your own custom data types with , you must implement a static `Parse` method that takes a string as a parameter. This method must be implemented with one or both of the following signatures: - - `public static Object Parse(string)` - - `public static Object Parse(string, IFormatProvider)` - - - -## Examples - The following code example attempts to parse the user's input as a valid . If it fails, the event handler displays an error message to the user. If the value is a valid , the code performs an additional check to ensure that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a control named `MaskedTextBox1` and a control named `ToolTip1`. - + to verify whether the data entered by the user falls within the correct range - in the previously mentioned case, by assigning it an instance of the type. The current text in the control will be validated either when the user leaves the control. You can determine whether or not the data fails validation by monitoring for the event. will only perform the check against if is `true`. + + If you want to use your own custom data types with , you must implement a static `Parse` method that takes a string as a parameter. This method must be implemented with one or both of the following signatures: + + `public static Object Parse(string)` + + `public static Object Parse(string, IFormatProvider)` + + + +## Examples + The following code example attempts to parse the user's input as a valid . If it fails, the event handler displays an error message to the user. If the value is a valid , the code performs an additional check to ensure that the date supplied is not prior to today's date. This code example requires that your Windows Forms project contains a control named `MaskedTextBox1` and a control named `ToolTip1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MaskedTextBox/TypeValidationCompleted/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ValidatingTypeSample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3695,11 +3695,11 @@ maskedTextBox1.Mask = "99/99/9999"; Gets or sets a value indicating whether a multiline text box control automatically wraps words to the beginning of the next line when necessary. This property is not supported by . The property always returns . - does not support multiple lines of input, the property is ignored. - + does not support multiple lines of input, the property is ignored. + ]]> diff --git a/xml/System.Windows.Forms/MdiClient.xml b/xml/System.Windows.Forms/MdiClient.xml index 092bd71a6fb..31daf29d9c5 100644 --- a/xml/System.Windows.Forms/MdiClient.xml +++ b/xml/System.Windows.Forms/MdiClient.xml @@ -46,15 +46,15 @@ Represents the container for multiple-document interface (MDI) child forms. This class cannot be inherited. - control. A form creates and uses the when you set the property to `true`. - + control. A form creates and uses the when you set the property to `true`. + ]]> - How To: Create an MDI Window List with MenuStrip (Windows Forms) - How to: Create an MDI Form with Menu Merging and ToolStrip Controls + How To: Create an MDI Window List with MenuStrip (Windows Forms) + How to: Create an MDI Form with Menu Merging and ToolStrip Controls @@ -120,11 +120,11 @@ Gets or sets the background image displayed in the control. The image to display in the background of the control. - property to get and set the background image of a form's MDI client area. - + property to get and set the background image of a form's MDI client area. + ]]> @@ -256,11 +256,11 @@ One of the enumeration values that defines the layout of MDI child forms. Arranges the multiple-document interface (MDI) child forms within the MDI parent form. - method to arrange MDI child forms on a parent form. - + method to arrange MDI child forms on a parent form. + ]]> @@ -293,11 +293,11 @@ Gets the child multiple-document interface (MDI) forms of the control. A array that contains the child MDI forms of the . - property to get the child MDI forms of the . - + property to get the child MDI forms of the . + ]]> diff --git a/xml/System.Windows.Forms/MenuStrip.xml b/xml/System.Windows.Forms/MenuStrip.xml index 29defbab9e0..ba90af89193 100644 --- a/xml/System.Windows.Forms/MenuStrip.xml +++ b/xml/System.Windows.Forms/MenuStrip.xml @@ -37,36 +37,36 @@ Provides a menu system for a form. - is the top-level container that supersedes . It also provides key handling and multiple document interface (MDI) features. Functionally, and work along with , although they are derived from . - - The following items are specifically designed to work seamlessly with both and in all orientations. They are available by default at design time for the control: - -- - -- - -- - - The control represents the container for the menu structure of a form. You can add objects to the that represent the individual menu commands in the menu structure. Each can be a command for your application or a parent menu for other submenu items. - + is the top-level container that supersedes . It also provides key handling and multiple document interface (MDI) features. Functionally, and work along with , although they are derived from . + + The following items are specifically designed to work seamlessly with both and in all orientations. They are available by default at design time for the control: + +- + +- + +- + + The control represents the container for the menu structure of a form. You can add objects to the that represent the individual menu commands in the menu structure. Each can be a command for your application or a parent menu for other submenu items. + The replaces and extends the control, which was removed in .NET Core 3.1. -## Examples - The following code example demonstrates a in a multiple-document interface (MDI) scenario. - +## Examples + The following code example demonstrates a in a multiple-document interface (MDI) scenario. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet10"::: + ]]> - MenuStrip Control (Windows Forms) - How to: Configure MenuStrip Check Margins and Image Margins - How to: Provide Standard Menu Items to a Form + MenuStrip Control (Windows Forms) + How to: Configure MenuStrip Check Margins and Image Margins + How to: Provide Standard Menu Items to a Form @@ -91,17 +91,17 @@ The replaces and extends the Initializes a new instance of the class. - to which you can add objects. -## Examples - The following code example demonstrates the constructor. This example is part of a larger example provided for the class. - +## Examples + The following code example demonstrates the constructor. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: + ]]> @@ -143,11 +143,11 @@ The replaces and extends the if the supports overflow functionality; otherwise, . The default is . - . When you set the property to `true`, you must also enable overflow for specific menu items by setting the property. By default, menu items are not displayed if they cannot fit within the available space. - + . When you set the property to `true`, you must also enable overflow for specific menu items by setting the property. By default, menu items are not displayed if they cannot fit within the available space. + ]]> @@ -179,16 +179,16 @@ The replaces and extends the 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. - - For a code example of using , see . - +> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + + For a code example of using , see . + ]]> @@ -228,11 +228,11 @@ The replaces and extends the Creates a with the specified text, image, and event handler on a new . A , or a if the parameter is a hyphen (-). - method to add a with commonly used characteristics to a . - + method to add a with commonly used characteristics to a . + ]]> @@ -292,11 +292,11 @@ The replaces and extends the Gets the spacing, in pixels, between the left, right, top, and bottom edges of the from the edges of the form. A that represents the spacing. The default is {Left=6, Top=2, Right=0, Bottom=2}. - property to set the interior space between controls. When a control is a container of items, padding represents the space from the edge of the container. - + property to set the interior space between controls. When a control is a container of items, padding represents the space from the edge of the container. + ]]> @@ -328,11 +328,11 @@ The replaces and extends the in all cases. - property always returns `false` because typically, ToolTips are not used for menus or menu items. - + property always returns `false` because typically, ToolTips are not used for menus or menu items. + ]]> @@ -448,19 +448,19 @@ The replaces and extends the Gets or sets the that is used to display a list of Multiple-document interface (MDI) child forms. A that represents the menu item displaying a list of MDI child forms that are open in the application. - property to designate or discover which displays MDI children. - + property to designate or discover which displays MDI children. + Use the and events on child menus to reflect changes to the value of . -## Examples - The following code example demonstrates the property. This example is part of a larger example provided for the class. - +## Examples + The following code example demonstrates the property. This example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet12"::: + ]]> @@ -491,21 +491,21 @@ The replaces and extends the Occurs when the user accesses the menu with the keyboard or mouse. - or typically neither take nor remove the focus from the control that currently has the focus. If there is a control hosted within the or a drop-down of the , the control gains focus when the user presses the TAB key. In general, the , , , and events of might not be raised when they are activated by the keyboard. In such cases, use the and events instead. - + or typically neither take nor remove the focus from the control that currently has the focus. If there is a control hosted within the or a drop-down of the , the control gains focus when the user presses the TAB key. In general, the , , , and events of might not be raised when they are activated by the keyboard. In such cases, use the and events instead. + 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 type named `MenuStrip1`. Then ensure that the event handler is associated with the event. - +## 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 type named `MenuStrip1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet489"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet489"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet489"::: + ]]> @@ -536,21 +536,21 @@ The replaces and extends the Occurs when the is deactivated. - or typically neither take nor remove the focus from the control that currently has the focus. If there is a control hosted within the or a drop-down of the , the control gains focus when the user presses the TAB key. In general, the , , , and events of might not be raised when they are activated by the keyboard. In such cases, use the and events instead. - + or typically neither take nor remove the focus from the control that currently has the focus. If there is a control hosted within the or a drop-down of the , the control gains focus when the user presses the TAB key. In general, the , , , and events of might not be raised when they are activated by the keyboard. In such cases, use the and events instead. + 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 type named `MenuStrip1`. Then ensure that the event handler is associated with the event. - +## 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 type named `MenuStrip1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet490"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet490"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet490"::: + ]]> @@ -584,13 +584,13 @@ The replaces and extends the 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. + ]]> @@ -627,13 +627,13 @@ The replaces and extends the 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. + ]]> @@ -709,11 +709,11 @@ The replaces and extends the if ToolTips are shown for the ; otherwise, . The default is . - property returns `false` by default because typically, ToolTips are not used for menus or menu items. - + property returns `false` by default because typically, ToolTips are not used for menus or menu items. + ]]> @@ -782,22 +782,22 @@ The replaces and extends the The Windows to process. Processes Windows messages. - method after getting filtered through the method. - + method after getting filtered through the method. + The method corresponds exactly to the Windows `WindowProc` function. For more information about processing Windows messages, see [WindowProc callback function](https://msdn.microsoft.com/library/windows/desktop/ms633573). - - - -## Examples - The following code example demonstrates overriding the method to handle operating system messages identified in the structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at to understand the available , , and values. Actual constant values can be found in the windows.h header file included in the Platform SDK (Core SDK section) download, which is also available on Docs. - + + + +## Examples + The following code example demonstrates overriding the method to handle operating system messages identified in the structure. The WM_ACTIVATEAPP operating system message is handled in this example to know when another application is becoming active. Refer to the Platform SDK documentation reference located at to understand the available , , and values. Actual constant values can be found in the windows.h header file included in the Platform SDK (Core SDK section) download, which is also available on Docs. + :::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/MessageBoxOptions.xml b/xml/System.Windows.Forms/MessageBoxOptions.xml index 62ffbf39eb0..8ef70707127 100644 --- a/xml/System.Windows.Forms/MessageBoxOptions.xml +++ b/xml/System.Windows.Forms/MessageBoxOptions.xml @@ -29,22 +29,22 @@ Specifies options on a . - class. +## Remarks -If you do not want to specify an argument when calling methods on , you can pass in 0 instead. +This enumeration is used by the class. + +If you do not want to specify an argument when calling methods on , you can pass in 0 instead. ## Examples -The following example demonstrates how to display a with the options supported by the overloads of that include an `options` parameter. After verifying that a string variable, `ServerName`, is empty, the example displays a with a question box icon, offering the user the option to cancel the operation. The example uses the `MessageBoxOptions.RightAlign` enumeration member to align the text to the right edge of the dialog box. If the method's return value evaluates to , the form that displayed the is closed. - +The following example demonstrates how to display a with the options supported by the overloads of that include an `options` parameter. After verifying that a string variable, `ServerName`, is empty, the example displays a with a question box icon, offering the user the option to cancel the operation. The example uses the `MessageBoxOptions.RightAlign` enumeration member to align the text to the right edge of the dialog box. If the method's return value evaluates to , the form that displayed the is closed. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/MessageBox.Show Variations/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DialogResult/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MessageBox.Show Variations/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MessageBox.Show Variations/VB/form1.vb" id="Snippet2"::: + ]]> @@ -74,7 +74,7 @@ The following example demonstrates how to display a 131072 - The message box is displayed on the active desktop. This constant is similar to `ServiceNotification`, except that the system displays the message box only on the default desktop of the interactive window station. The application that displayed the message box loses focus, and the message box is displayed without using visual styles. For more information, see Rendering Controls with Visual Styles. + The message box is displayed on the active desktop. This constant is similar to `ServiceNotification`, except that the system displays the message box only on the default desktop of the interactive window station. The application that displayed the message box loses focus, and the message box is displayed without using visual styles. For more information, see Rendering Controls with Visual Styles.
diff --git a/xml/System.Windows.Forms/MonthCalendar.xml b/xml/System.Windows.Forms/MonthCalendar.xml index 9aa9995c2ad..c21f139f61e 100644 --- a/xml/System.Windows.Forms/MonthCalendar.xml +++ b/xml/System.Windows.Forms/MonthCalendar.xml @@ -90,10 +90,10 @@ ]]> - How to: Change the Windows Forms MonthCalendar Control's Appearance - How to: Display More than One Month in the Windows Forms MonthCalendar Control - How to: Display Specific Days in Bold with the Windows Forms MonthCalendar Control - How to: Select a Range of Dates in the Windows Forms MonthCalendar Control + How to: Change the Windows Forms MonthCalendar Control's Appearance + How to: Display More than One Month in the Windows Forms MonthCalendar Control + How to: Display Specific Days in Bold with the Windows Forms MonthCalendar Control + How to: Select a Range of Dates in the Windows Forms MonthCalendar Control diff --git a/xml/System.Windows.Forms/MouseEventArgs.xml b/xml/System.Windows.Forms/MouseEventArgs.xml index c08a73b330a..259e271bd07 100644 --- a/xml/System.Windows.Forms/MouseEventArgs.xml +++ b/xml/System.Windows.Forms/MouseEventArgs.xml @@ -30,35 +30,35 @@ Provides data for the , , and events. - event occurs when the user presses the mouse button while the pointer is over a control. The event occurs when the user releases the mouse button while the pointer remains over the control. The event occurs when the user moves the mouse pointer over a control. A specifies which mouse button is pressed, how many times the mouse button was pressed and released, the coordinates of the mouse, and the amount the mouse wheel moved. - - It is possible to receive a event without a corresponding , if the user switches focus to another application before releasing the mouse button. - - These three events exist for the , , and classes. - - For information about the event model, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example handles the event on a control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a control that is named `textBox1`. - + event occurs when the user presses the mouse button while the pointer is over a control. The event occurs when the user releases the mouse button while the pointer remains over the control. The event occurs when the user moves the mouse pointer over a control. A specifies which mouse button is pressed, how many times the mouse button was pressed and released, the coordinates of the mouse, and the amount the mouse wheel moved. + + It is possible to receive a event without a corresponding , if the user switches focus to another application before releasing the mouse button. + + These three events exist for the , , and classes. + + For information about the event model, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example handles the event on a control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a control that is named `textBox1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: - - The following code example uses the `Location` property to track clicks of the left mouse button and to draw a series of straight line segments in response to user input. The example does not redraw the lines if you hide the form and then redisplay it; this code has been omitted for simplicity. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: + + The following code example uses the `Location` property to track clicks of the left mouse button and to draw a series of straight line segments in response to user input. The example does not redraw the lines if you hide the form and then redisplay it; this code has been omitted for simplicity. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: - - The following code example uses the and properties to display the current position of the mouse pointer in a window. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: + + The following code example uses the and properties to display the current position of the mouse pointer in a window. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]> @@ -150,14 +150,14 @@ Gets which mouse button was pressed. One of the values. - event on a control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a control named `textBox1`. - + event on a control so that clicking the right mouse button selects all the text in the control. This example requires that you have a form that contains a control named `textBox1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet1"::: + ]]> @@ -199,21 +199,21 @@ Gets the number of times the mouse button was pressed and released. An that contains the number of times the mouse button was pressed and released. - event. This report helps you 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 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"::: + ]]> @@ -253,23 +253,23 @@ Gets a signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. A detent is one notch of the mouse wheel. A signed count of the number of detents the mouse wheel has rotated, multiplied by the WHEEL_DELTA constant. - event. This report helps you 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 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"::: + ]]> @@ -302,21 +302,21 @@ Gets the location of the mouse during the generating mouse event. A that contains the x- and y- mouse coordinates, in pixels, relative to the upper-left corner of the control. - property to track left mouse clicks and draw a series of straight line segments in response to user input. The example does not persist the drawn lines if you hide the form and then redisplay it; this code was omitted for simplicity. - + property to track left mouse clicks and draw a series of straight line segments in response to user input. The example does not persist the drawn lines if you hide the form and then redisplay it; this code was omitted for simplicity. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet2"::: + ]]> - Windows Forms Coordinates - Mouse Events in Windows Forms + Windows Forms Coordinates + Mouse Events in Windows Forms @@ -352,19 +352,19 @@ Gets the x-coordinate of the mouse during the generating mouse event. The x-coordinate of the mouse, in pixels. - event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse-coordinate values that are relative to the form origin or the screen origin. - - - -## Examples - The following code example uses the and properties to display the current position of the mouse pointer in a window. - + event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse-coordinate values that are relative to the form origin or the screen origin. + + + +## Examples + The following code example uses the and properties to display the current position of the mouse pointer in a window. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]> @@ -405,19 +405,19 @@ Gets the y-coordinate of the mouse during the generating mouse event. The y-coordinate of the mouse, in pixels. - event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse coordinate values that are relative to the form origin or the screen origin. - - - -## Examples - The following code example uses the and properties to display the current position of the mouse pointer in a window. To use this code, call `TrackCoordinates` from the form constructor. - + event is handled, the mouse coordinate values are relative to the coordinates of the control that raised the event. Some events related to drag-and-drop operations have associated mouse coordinate values that are relative to the form origin or the screen origin. + + + +## Examples + The following code example uses the and properties to display the current position of the mouse pointer in a window. To use this code, call `TrackCoordinates` from the form constructor. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/MouseEventArgs/Overview/Form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/MouseEventArgs/VB/Form1.vb" id="Snippet3"::: + ]]> diff --git a/xml/System.Windows.Forms/Padding.xml b/xml/System.Windows.Forms/Padding.xml index 1d76fb35859..131d6050421 100644 --- a/xml/System.Windows.Forms/Padding.xml +++ b/xml/System.Windows.Forms/Padding.xml @@ -56,37 +56,37 @@ Represents padding or margin information associated with a user interface (UI) element. - structure represents the padding or margin associated with a rectangular UI element such as a control. The padding is the internal space between the body of the UI element and its edge. In contrast, a margin is the distance separating the adjoining edges of two adjacent UI elements. Because of structural similarities, is used to represent both padding and margins. - - For a diagram that illustrates the and properties on a control, see [Margin and Padding in Windows Forms Controls](/dotnet/framework/winforms/controls/margin-and-padding-in-windows-forms-controls). - - Padding has a different effect on controls that are containers than on controls that are not. For example, in a control, the property defines the spacing between the border of the and its child controls. For a control, the property defines the spacing between the border of the control and its contained text. - - In addition to typical methods and properties, also defines the following type-level members: - -- The field, which represents a predefined with no padding. - -- A set of operators for performing common arithmetic operations for the class, such as adding two objects together. For languages that do not support operator overloading, you can invoke these members by using alternative method syntax. - -- The , , and properties, which provide combined values that are convenient for use in custom layout calculations. - - - -## Examples - The following code example demonstrates how to use the Padding property to create an outline around a control. - - For a full code listing, see [How to: Create a Border Around a Windows Forms Control Using Padding](/dotnet/framework/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding). - + structure represents the padding or margin associated with a rectangular UI element such as a control. The padding is the internal space between the body of the UI element and its edge. In contrast, a margin is the distance separating the adjoining edges of two adjacent UI elements. Because of structural similarities, is used to represent both padding and margins. + + For a diagram that illustrates the and properties on a control, see [Margin and Padding in Windows Forms Controls](/dotnet/desktop/winforms/controls/margin-and-padding-in-windows-forms-controls). + + Padding has a different effect on controls that are containers than on controls that are not. For example, in a control, the property defines the spacing between the border of the and its child controls. For a control, the property defines the spacing between the border of the control and its contained text. + + In addition to typical methods and properties, also defines the following type-level members: + +- The field, which represents a predefined with no padding. + +- A set of operators for performing common arithmetic operations for the class, such as adding two objects together. For languages that do not support operator overloading, you can invoke these members by using alternative method syntax. + +- The , , and properties, which provide combined values that are convenient for use in custom layout calculations. + + + +## Examples + The following code example demonstrates how to use the Padding property to create an outline around a control. + + For a full code listing, see [How to: Create a Border Around a Windows Forms Control Using Padding](/dotnet/desktop/winforms/controls/how-to-create-a-border-around-a-windows-forms-control-using-padding). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Padding/Overview/Form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Padding/VB/Form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.Padding/VB/Form1.vb" id="Snippet2"::: + ]]> - Margin and Padding in Windows Forms Controls + Margin and Padding in Windows Forms Controls @@ -127,16 +127,16 @@ The number of pixels to be used for padding for all edges. Initializes a new instance of the class using the supplied padding size for all edges. - , , , and properties to the value of the `all` parameter. - + , , , and properties to the value of the `all` parameter. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -174,19 +174,19 @@ The padding size, in pixels, for the bottom edge. Initializes a new instance of the class using a separate padding size for each edge. - property will reflect this common value. - + property will reflect this common value. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -230,8 +230,8 @@ Computes the sum of the two specified values. A that contains the sum of the two specified values. To be added. - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -277,21 +277,21 @@ Gets or sets the padding value for all the edges. The padding, in pixels, for all edges if the same; otherwise, -1. - , , , and properties. - + , , , and properties. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -337,19 +337,19 @@ Gets or sets the padding value for the bottom edge. The padding, in pixels, for the bottom edge. - property. - + property. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -380,18 +380,18 @@ Provides a object with no padding. - , , and padding properties set to 0. - - This immutable field is useful for comparison operations and initializations. - + , , and padding properties set to 0. + + This immutable field is useful for comparison operations and initializations. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -436,17 +436,17 @@ if the objects are equivalent; otherwise, . - (or a derived type) can be equal to the current . In addition, the corresponding , , and properties for both objects must be the same. - + (or a derived type) can be equal to the current . In addition, the corresponding , , and properties for both objects must be the same. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -528,21 +528,21 @@ Generates a hash code for the current . A 32-bit signed integer hash code. - method uses the , , , and values to generate a 32-bit hash code that represents the current . - - A hash code is a number that corresponds to the value of an object (so two objects that have the same value should generate the same hash code). Hash codes are used to sort and store collections of objects. For example, a represents a collection of key-and-value pairs that are organized based on the hash code of the key. - - For more information on hash codes and hash functions, see the method. - + method uses the , , , and values to generate a 32-bit hash code that represents the current . + + A hash code is a number that corresponds to the value of an object (so two objects that have the same value should generate the same hash code). Hash codes are used to sort and store collections of objects. For example, a represents a collection of key-and-value pairs that are organized based on the hash code of the key. + + For more information on hash codes and hash functions, see the method. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -584,17 +584,17 @@ Gets the combined padding for the right and left edges. Gets the sum, in pixels, of the and padding values. - - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -640,19 +640,19 @@ Gets or sets the padding value for the left edge. The padding, in pixels, for the left edge. - property. - + property. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -690,18 +690,18 @@ Performs vector addition on the two specified objects, resulting in a new . A new that results from adding and . - property of the result is the sum of the properties of the two operands. - - This operation is transitive. - + property of the result is the sum of the properties of the two operands. + + This operation is transitive. + The equivalent method for this operator is ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -740,17 +740,17 @@ if the two objects are equal; otherwise, . - objects are equal if the padding values for each of the four edges - , , , and - are the same for both objects. - + objects are equal if the padding values for each of the four edges - , , , and - are the same for both objects. + The equivalent method for this operator is ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -789,16 +789,16 @@ if the two objects are different; otherwise, . - . - + . + The equivalent method for this operator is the negation of ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -836,16 +836,16 @@ Performs vector subtraction on the two specified objects, resulting in a new . The result of subtracting from . - property of the result is the difference between the properties of two operands. - + property of the result is the difference between the properties of two operands. + The equivalent method for this operator is ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -891,19 +891,19 @@ Gets or sets the padding value for the right edge. The padding, in pixels, for the right edge. - property. - + property. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -949,21 +949,21 @@ Gets the padding information in the form of a . A containing the padding information. - property performs a type conversion from to . The property corresponds to the property, and the property corresponds to the property. - - is convenient for use in many layout calculations. - + property performs a type conversion from to . The property corresponds to the property, and the property corresponds to the property. + + is convenient for use in many layout calculations. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -1007,8 +1007,8 @@ Subtracts one specified value from another. A that contains the result of the subtraction of one specified value from another. To be added. - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -1058,19 +1058,19 @@ Gets or sets the padding value for the top edge. The padding, in pixels, for the top edge. - property. - + property. + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -1110,18 +1110,18 @@ Returns a string that represents the current . A that represents the current . - . - + . + ]]> - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls @@ -1163,17 +1163,17 @@ Gets the combined padding for the top and bottom edges. Gets the sum, in pixels, of the and padding values. - - How to: Outline a Windows Forms Control Using Padding - Margin and Padding in Windows Forms Controls + How to: Outline a Windows Forms Control Using Padding + Margin and Padding in Windows Forms Controls diff --git a/xml/System.Windows.Forms/PictureBox.xml b/xml/System.Windows.Forms/PictureBox.xml index 0c0dc26e618..4d3920201c2 100644 --- a/xml/System.Windows.Forms/PictureBox.xml +++ b/xml/System.Windows.Forms/PictureBox.xml @@ -94,7 +94,7 @@ ]]> - Images, Bitmaps, and Metafiles + Images, Bitmaps, and Metafiles Working with Images, Bitmaps, Icons, and Metafiles diff --git a/xml/System.Windows.Forms/PrintDialog.xml b/xml/System.Windows.Forms/PrintDialog.xml index c9b7910caf9..b1c801aed8c 100644 --- a/xml/System.Windows.Forms/PrintDialog.xml +++ b/xml/System.Windows.Forms/PrintDialog.xml @@ -42,27 +42,27 @@ Lets users select a printer and choose which sections of the document to print from a Windows Forms application. - , the read/write properties are set to initial values. For a list of these values, see the constructor. To get printer settings that are modified by the user with the , use the property. - - For more information about printing with Windows Forms, see the namespace overview. If you want to print from a Windows Presentation Foundation application, see the namespace. - - - -## Examples - The following code example demonstrates how to use the control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. - + , the read/write properties are set to initial values. For a list of these values, see the constructor. To get printer settings that are modified by the user with the , use the property. + + For more information about printing with Windows Forms, see the namespace overview. If you want to print from a Windows Presentation Foundation application, see the namespace. + + + +## Examples + The following code example demonstrates how to use the control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]> - PrintDialog Component (Windows Forms) + PrintDialog Component (Windows Forms) @@ -88,24 +88,24 @@ Initializes a new instance of the class. - , the following read/write properties are set to initial values. - -|Property|Initial Value| -|--------------|-------------------| -||`false`| -||`true`| -||`false`| -||`null`| -||`null`| -||`false`| -||`false`| -||`true`| - - You can change the value for any one of these properties through a separate call to the property. - + , the following read/write properties are set to initial values. + +|Property|Initial Value| +|--------------|-------------------| +||`false`| +||`true`| +||`false`| +||`null`| +||`null`| +||`false`| +||`false`| +||`true`| + + You can change the value for any one of these properties through a separate call to the property. + ]]> @@ -154,11 +154,11 @@ if the **Current Page** option button is displayed; otherwise, . The default is . - property has no effect. - + property has no effect. + ]]> @@ -298,15 +298,15 @@ if the **Pages** option button is enabled; otherwise, . The default is . - control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. - + control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -355,15 +355,15 @@ Gets or sets a value indicating the used to obtain . The used to obtain . The default is . - control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. - + control to set the , , and properties. To run this example, paste the following code into a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event-handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -414,11 +414,11 @@ Gets or sets the printer settings the dialog box modifies. The the dialog box modifies. - property must be set before you call or an exception will occur. - + property must be set before you call or an exception will occur. + ]]> @@ -572,20 +572,20 @@ if the **Help** button is displayed; otherwise, . The default is . - control setting the , , and properties. To run this example paste the following code in a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event handling methods defined in this example. - + control setting the , , and properties. To run this example paste the following code in a form that contains a control named `PrintDialog1` and a button named `Button1`. This example requires that the button's event and the event of `docToPrint` have been connected to the event handling methods defined in this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/PrintDialog/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.PrintDialogExample/VB/form1.vb" id="Snippet1"::: + ]]> @@ -633,11 +633,11 @@ if the **Network** button is displayed; otherwise, . The default is . - @@ -684,11 +684,11 @@ to indicate the dialog should be shown with the Windows XP style, otherwise . The default is . - and will be ignored as these properties were made obsolete for Windows 2000 and later versions of Windows. - + and will be ignored as these properties were made obsolete for Windows 2000 and later versions of Windows. + ]]> diff --git a/xml/System.Windows.Forms/ProfessionalColorTable.xml b/xml/System.Windows.Forms/ProfessionalColorTable.xml index b177c78c161..56429063ecf 100644 --- a/xml/System.Windows.Forms/ProfessionalColorTable.xml +++ b/xml/System.Windows.Forms/ProfessionalColorTable.xml @@ -29,15 +29,15 @@ Provides colors used for Microsoft Office display elements. - . - + . + ]]> - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms @@ -832,11 +832,11 @@ Gets the starting color of the gradient used in the image margin of a . A that is the starting color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -867,11 +867,11 @@ Gets the end color of the gradient used in the image margin of a . A that is the end color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -908,11 +908,11 @@ Gets the middle color of the gradient used in the image margin of a . A that is the middle color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -949,11 +949,11 @@ Gets the starting color of the gradient used in the image margin of a when an item is revealed. A that is the starting color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -990,11 +990,11 @@ Gets the end color of the gradient used in the image margin of a when an item is revealed. A that is the end color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -1031,11 +1031,11 @@ Gets the middle color of the gradient used in the image margin of a when an item is revealed. A that is the middle color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -2050,11 +2050,11 @@ to use ; otherwise, . The default is . - uses the colors in . - + uses the colors in . + ]]> diff --git a/xml/System.Windows.Forms/ProfessionalColors.xml b/xml/System.Windows.Forms/ProfessionalColors.xml index fcd4e2f93f0..c8811dc6545 100644 --- a/xml/System.Windows.Forms/ProfessionalColors.xml +++ b/xml/System.Windows.Forms/ProfessionalColors.xml @@ -34,7 +34,7 @@ Provides structures that are colors of a Windows display element. This class cannot be inherited. To be added. - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms @@ -679,11 +679,11 @@ Gets the starting color of the gradient used in the image margin of a . A that is the starting color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -714,11 +714,11 @@ Gets the end color of the gradient used in the image margin of a . A that is the end color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -749,11 +749,11 @@ Gets the middle color of the gradient used in the image margin of a . A that is the middle color of the gradient used in the image margin of a . - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -784,11 +784,11 @@ Gets the starting color of the gradient used in the image margin of a when an item is revealed. A that is the starting color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -819,11 +819,11 @@ Gets the end color of the gradient used in the image margin of a when an item is revealed. A that is the end color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> @@ -854,11 +854,11 @@ Gets the middle color of the gradient used in the image margin of a when an item is revealed. A that is the middle color of the gradient used in the image margin of a when an item is revealed. - must be set to `true` for this color to be displayed. - + must be set to `true` for this color to be displayed. + ]]> diff --git a/xml/System.Windows.Forms/ProgressBarRenderer.xml b/xml/System.Windows.Forms/ProgressBarRenderer.xml index 05d9f58416f..4347b2c3c61 100644 --- a/xml/System.Windows.Forms/ProgressBarRenderer.xml +++ b/xml/System.Windows.Forms/ProgressBarRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a progress bar control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a progress bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a progress bar, use the or methods to draw the empty bar, and then use the or methods to draw the elements that fill in the bar. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the progress bar with the current visual style. Otherwise, the methods and properties of this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. - - This class wraps the functionality of a that is set to one of the elements exposed by the , , , and classes. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the and methods to draw a vertical progress bar. The control uses a to redraw the progress bar with an added piece each second. The `SetupProgressBar` method uses the and properties to calculate the height of each progressively larger rectangle that is drawn. - + class provides a set of `static` methods that can be used to render a progress bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a progress bar, use the or methods to draw the empty bar, and then use the or methods to draw the elements that fill in the bar. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the progress bar with the current visual style. Otherwise, the methods and properties of this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. + + This class wraps the functionality of a that is set to one of the elements exposed by the , , , and classes. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the and methods to draw a vertical progress bar. The control uses a to redraw the progress bar with an added piece each second. The `SetupProgressBar` method uses the and properties to calculate the height of each progressively larger rectangle that is drawn. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -83,32 +83,32 @@ Gets the width, in pixels, of the space between each inner piece of the progress bar. The width, in pixels, of the space between each inner piece of the progress bar. - property returns `true`. - - - -## Examples - The following code example uses the property to determine the size of each rectangle that represents an increment of the progress bar drawn by the method. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the property to determine the size of each rectangle that represents an increment of the progress bar drawn by the method. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -138,32 +138,32 @@ Gets the width, in pixels, of a single inner piece of the progress bar. The width, in pixels, of a single inner piece of the progress bar. - property returns `true`. - - - -## Examples - The following code example uses the property to determine the size of each rectangle that represents an increment of the progress bar drawn by the method. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the property to determine the size of each rectangle that represents an increment of the progress bar drawn by the method. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -198,21 +198,21 @@ The that specifies the bounds of the progress bar. Draws an empty progress bar control that fills in horizontally. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -247,23 +247,23 @@ The that specifies the bounds to be filled by progress bar pieces. Draws a set of progress bar pieces that fill a horizontal progress bar. - and properties. - - Before using this method, you should verify that the property returns `true`. - + and properties. + + Before using this method, you should verify that the property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -298,30 +298,30 @@ The that specifies the bounds of the progress bar. Draws an empty progress bar control that fills in vertically. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw an empty progress bar. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw an empty progress bar. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -356,32 +356,32 @@ The that specifies the bounds to be filled by progress bar pieces. Draws a set of progress bar pieces that fill a vertical progress bar. - and . - - Before using this method, you should verify that the property returns `true`. - - - -## Examples - The following code example uses the method in a event handler to draw each increment of a progress bar. This code example is part of a larger example provided for the class. - + and . + + Before using this method, you should verify that the property returns `true`. + + + +## Examples + The following code example uses the method in a event handler to draw each increment of a progress bar. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet6"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -412,20 +412,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, . - . - - - -## Examples - The following code example uses the property to determine whether to call the method. This code example is part of a larger example provided for the class. - + . + + + +## Examples + The following code example uses the property to determine whether to call the method. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ProgressBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ProgressBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/RadioButtonRenderer.xml b/xml/System.Windows.Forms/RadioButtonRenderer.xml index c32b3617e79..fc72f97cc11 100644 --- a/xml/System.Windows.Forms/RadioButtonRenderer.xml +++ b/xml/System.Windows.Forms/RadioButtonRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render an option button control (also known as a radio button) with or without visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render an option button control. Rendering a control refers to drawing the user interface of a control. To draw an option button, use one of the methods. These methods provide a variety of options, such as drawing text or an image with the option button. - - If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the option button with the current visual style. Otherwise, will draw the option button with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to write a custom control that uses the method to draw an option button that responds to mouse clicks. - + class provides a set of `static` methods that can be used to render an option button control. Rendering a control refers to drawing the user interface of a control. To draw an option button, use one of the methods. These methods provide a variety of options, such as drawing text or an image with the option button. + + If visual styles are enabled in the operating system and visual styles are applied to the current application, will draw the option button with the current visual style. Otherwise, will draw the option button with the classic Windows style. This is useful if you are drawing a custom control that should automatically match the current visual style setting of the operating system. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to write a custom control that uses the method to draw an option button that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -92,11 +92,11 @@ The control whose parent's background will be drawn. Draws the background of a control's parent in the specified area. - @@ -144,11 +144,11 @@ One of the values that specifies the visual state of the option button. Draws an option button control (also known as a radio button) in the specified state and location. - @@ -210,20 +210,20 @@ One of the values that specifies the visual state of the option button. Draws an option button control (also known as a radio button) in the specified state and location, with the specified text, and with an optional focus rectangle. - method in a custom control's method to draw an option button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + method in a custom control's method to draw an option button in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet4"::: + ]]> @@ -281,11 +281,11 @@ One of the values that specifies the visual state of the option button. Draws an option button control (also known as a radio button) in the specified state and location, with the specified text and text formatting, and with an optional focus rectangle. - @@ -358,11 +358,11 @@ One of the values that specifies the visual state of the option button. Draws an option button control (also known as a radio button) in the specified state and location, with the specified text and image, and with an optional focus rectangle. - @@ -431,11 +431,11 @@ One of the values that specifies the visual state of the option button. Draws an option button control (also known as a radio button) in the specified state and location; with the specified text, text formatting, and image; and with an optional focus rectangle. - @@ -472,20 +472,20 @@ Returns the size, in pixels, of the option button (also known as a radio button) glyph. A that represents the size, in pixels, of the option button glyph. - method to determine the bounds of the option button text. This code example is part of a larger example provided for the class. - + method to determine the bounds of the option button text. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet2"::: + ]]> @@ -561,19 +561,19 @@ if the application state is used to determine rendering style; otherwise, . The default is . - property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. - - - -## Examples - The following code example uses the property to show the render style is changed depending on the application state. This code example is part of a larger example provided for the class. - + property is `true`, the uses the setting from the property to determine the rendering style. If is `false`, the renderer will always render using visual styles. + + + +## Examples + The following code example uses the property to show the render style is changed depending on the application state. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/RadioButtonRenderer/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.RadioButtonRenderer/VB/form1.vb" id="Snippet3"::: + ]]> diff --git a/xml/System.Windows.Forms/ScrollBarRenderer.xml b/xml/System.Windows.Forms/ScrollBarRenderer.xml index e0325bc9115..018f95f8a89 100644 --- a/xml/System.Windows.Forms/ScrollBarRenderer.xml +++ b/xml/System.Windows.Forms/ScrollBarRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a scroll bar control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a scroll bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a scroll bar, use a combination of the methods in this class to render each part of the scroll bar. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the scroll bar with the current visual style. Otherwise, the methods of this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the methods to draw a scroll bar that responds to mouse clicks. - + class provides a set of `static` methods that can be used to render a scroll bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a scroll bar, use a combination of the methods in this class to render each part of the scroll bar. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the scroll bar with the current visual style. Otherwise, the methods of this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the methods to draw a scroll bar that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -90,30 +90,30 @@ One of the values that specifies the visual state of the scroll arrow. Draws a scroll arrow with visual styles. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a scroll arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a scroll arrow in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -150,30 +150,30 @@ One of the values that specifies the visual state of the scroll box. Draws a horizontal scroll box (also known as the thumb) with visual styles. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a scroll box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a scroll box in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -210,30 +210,30 @@ One of the values that specifies the visual state of the scroll box grip. Draws a grip on a horizontal scroll box (also known as the thumb) with visual styles. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a scroll box grip in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a scroll box grip in the state determined by the location of the mouse pointer. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -270,30 +270,30 @@ One of the values that specifies the visual state of the scroll bar track. Draws a horizontal scroll bar track with visual styles. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw the left side of a scroll bar track in the pressed state. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw the left side of a scroll bar track in the pressed state. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -330,21 +330,21 @@ One of the values that specifies the visual state of the scroll bar track. Draws a vertical scroll bar track with visual styles. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -381,30 +381,30 @@ One of the values that specifies the visual state of the scroll bar track. Draws a horizontal scroll bar track with visual styles. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw the scroll bar track. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw the scroll bar track. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -441,21 +441,21 @@ One of the values that specifies the visual state of the sizing handle. Draws a scroll bar sizing handle with visual styles. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -492,21 +492,21 @@ One of the values that specifies the visual state of the scroll bar track. Draws a vertical scroll bar track with visual styles. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -543,21 +543,21 @@ One of the values that specifies the visual state of the scroll box. Draws a vertical scroll box (also known as the thumb) with visual styles. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -594,21 +594,21 @@ One of the values that specifies the visual state of the scroll box grip. Draws a grip on a vertical scroll box (also known as the thumb) with visual styles. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -644,23 +644,23 @@ Returns the size of the sizing handle. A that specifies the size of the sizing handle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -696,23 +696,23 @@ Returns the size of the scroll box grip. A that specifies the size of the scroll box grip. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -743,20 +743,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client areas of application windows; otherwise, . - . - - - -## Examples - The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. - + . + + + +## Examples + The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ScrollBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ScrollBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/SplitContainer.xml b/xml/System.Windows.Forms/SplitContainer.xml index 36b795d2b6b..321a181ba32 100644 --- a/xml/System.Windows.Forms/SplitContainer.xml +++ b/xml/System.Windows.Forms/SplitContainer.xml @@ -62,38 +62,38 @@ Represents a control consisting of a movable bar that divides a container's display area into two resizable panels. - controls to existing panels to create many resizable display areas. - - Use the control to divide the display area of a container (such as a ) and allow the user to resize controls that are added to the panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the control can be resized. - + controls to existing panels to create many resizable display areas. + + Use the control to divide the display area of a container (such as a ) and allow the user to resize controls that are added to the panels. When the user passes the mouse pointer over the splitter, the cursor changes to indicate that the controls inside the control can be resized. + > [!NOTE] -> Previous versions of the .NET Framework only support the control. - - also eases control placement at design time. For example, to create a window similar to Windows Explorer, add a control to a and set its property to `DockStyle.Fill`. Add a control to the and set its property to `DockStyle.Fill`. To complete the layout, add a control and set its property to `DockStyle.Fill` to have the occupy the remaining space on the . At run time, the user can then resize the width of both controls using the splitter. Use the property to specify that a control should not be resized along with the or other container. - - Use to specify where the splitter starts on your form. Use to specify how many pixels the splitter moves at a time. The default for is one pixel. - - Use and to specify how close the splitter bar can be moved to the outside edge of a panel. The default minimum size of a panel is 25 pixels. - - Use the property to specify horizontal orientation. The default orientation of the is vertical. - - Use the property to specify the border style of the and coordinate its border style with the border style of controls that you add to the . - - - -## Examples - The following code example shows both a vertical and horizontal . The vertical splitter moves in 10-pixel increments. The left panel of the vertical contains a control, and its right panel contains a horizontal . Both panels of the horizontal are filled with controls, and the top panel is defined as a so that it does not resize when you resize the container. Moving the vertical splitter raises the event, signified in this example by a change to the cursor style. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - +> Previous versions of the .NET Framework only support the control. + + also eases control placement at design time. For example, to create a window similar to Windows Explorer, add a control to a and set its property to `DockStyle.Fill`. Add a control to the and set its property to `DockStyle.Fill`. To complete the layout, add a control and set its property to `DockStyle.Fill` to have the occupy the remaining space on the . At run time, the user can then resize the width of both controls using the splitter. Use the property to specify that a control should not be resized along with the or other container. + + Use to specify where the splitter starts on your form. Use to specify how many pixels the splitter moves at a time. The default for is one pixel. + + Use and to specify how close the splitter bar can be moved to the outside edge of a panel. The default minimum size of a panel is 25 pixels. + + Use the property to specify horizontal orientation. The default orientation of the is vertical. + + Use the property to specify the border style of the and coordinate its border style with the border style of controls that you add to the . + + + +## Examples + The following code example shows both a vertical and horizontal . The vertical splitter moves in 10-pixel increments. The left panel of the vertical contains a control, and its right panel contains a horizontal . Both panels of the horizontal are filled with controls, and the top panel is defined as a so that it does not resize when you resize the container. Moving the vertical splitter raises the event, signified in this example by a change to the cursor style. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet1"::: + ]]> - SplitContainer Control (Windows Forms) + SplitContainer Control (Windows Forms) @@ -165,11 +165,11 @@ if scroll bars to automatically appear when controls are placed outside the client area; otherwise, . The default is . - @@ -218,15 +218,15 @@ Gets or sets the size of the auto-scroll margin. This property is not relevant to this class. This property is not relevant to this class. A value that represents the height and width, in pixels, of the auto-scroll margin. - size is added to the size of any child controls contained in the scrollable control to determine if scroll bars are needed. The property is evaluated when the parent scrollable control is resized or the individual child controls are brought into view, and is used to determine if scroll bars must be displayed. Docked controls are excluded from the calculations that determine if scroll bars must be displayed. - - If the distance from the edge of a child control to the parent scrollable control is less than the value assigned to the property and the property is set to `true`, the appropriate scroll bar is displayed. - - This property is not relevant to this class. - + size is added to the size of any child controls contained in the scrollable control to determine if scroll bars are needed. The property is evaluated when the parent scrollable control is resized or the individual child controls are brought into view, and is used to determine if scroll bars must be displayed. Docked controls are excluded from the calculations that determine if scroll bars must be displayed. + + If the distance from the edge of a child control to the parent scrollable control is less than the value assigned to the property and the property is set to `true`, the appropriate scroll bar is displayed. + + This property is not relevant to this class. + ]]> @@ -276,13 +276,13 @@ Gets or sets the minimum size of the scroll bar. This property is not relevant to this class. A that represents the minimum height and width of the scroll bar, in pixels. - property to manage the screen size allocated to the automatic scroll bar. - - This property is not relevant to this class. - + property to manage the screen size allocated to the automatic scroll bar. + + This property is not relevant to this class. + ]]> @@ -328,11 +328,11 @@ This property is not relevant to this class. A value. - @@ -381,11 +381,11 @@ This property is not relevant to this class. A value. - @@ -435,11 +435,11 @@ if the is automatically resized; otherwise, . - property is set to `true`, the will resize automatically to encompass its contents, although it will never be resized to be smaller than its original . This operation will maintain the control's . This property is not relevant to this class. - + property is set to `true`, the will resize automatically to encompass its contents, although it will never be resized to be smaller than its original . This operation will maintain the control's . This property is not relevant to this class. + ]]> @@ -481,13 +481,13 @@ Occurs when the value of the property changes. This property is not relevant to this class. - @@ -529,17 +529,17 @@ 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`. - +> 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`. + ]]> @@ -582,23 +582,23 @@ Occurs when 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 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 type named `SplitContainer1`. Then 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 type named `SplitContainer1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet546"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet546"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet546"::: + ]]> @@ -641,11 +641,11 @@ This property is not relevant to this class. An value. - @@ -686,11 +686,11 @@ Occurs when the property changes. This event is not relevant to this class. - @@ -802,11 +802,11 @@ Gets or sets the style of border for the . One of the values. The default is . - property to coordinate the border of the splitter and the outer edges of the panels with the border of the control or controls that the contains. - + property to coordinate the border of the splitter and the outer edges of the panels with the border of the control or controls that the contains. + ]]> The value of the property is not one of the values. @@ -849,11 +849,11 @@ This event is not relevant to this class. - @@ -894,11 +894,11 @@ This event is not relevant to this class. - @@ -947,11 +947,11 @@ Gets a collection of child controls. This property is not relevant to this class. An object of type that contains the child controls. - @@ -1044,11 +1044,11 @@ Gets the default size of the . A that represents the size of the . - property in a derived class to specify a default size for . This is more efficient than setting the size in the constructor. - + property in a derived class to specify a default size for . This is more efficient than setting the size in the constructor. + ]]> @@ -1080,29 +1080,29 @@ Gets or sets which borders are attached to the edges of the container. One of the values. The default value is . - to any edge of its container, or you can dock a to all edges of the container so that the entirely fills the container. For example, set this property to to attach the left edge of the to the left edge of its container. Controls are docked in z-order. - + to any edge of its container, or you can dock a to all edges of the container so that the entirely fills the container. For example, set this property to to attach the left edge of the to the left edge of its container. Controls are docked in z-order. + > [!NOTE] -> The z-order corresponds to the depth dimension of the screen, and the x-order and y-order corresponds to the horizontal and vertical dimensions, respectively. Z-order defines which object appears in front of which, in cases where controls or windows can overlap or occupy the same space on the screen. A control or window at the top of the z-order appears on top of all other controls or windows and is referenced by an index of 0 in the property. A control or window at the bottom of the z-order appears underneath all other controls or windows and is referenced by an index of `(Controls.Count-1)` in the property. - - For more information about anchoring and docking controls, see [How to: Create a Multipane User Interface with Windows Forms](/dotnet/framework/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms). - - - -## Examples - The following code example shows a vertical splitter whose property is set to `Fill`. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - +> The z-order corresponds to the depth dimension of the screen, and the x-order and y-order corresponds to the horizontal and vertical dimensions, respectively. Z-order defines which object appears in front of which, in cases where controls or windows can overlap or occupy the same space on the screen. A control or window at the top of the z-order appears on top of all other controls or windows and is referenced by an index of 0 in the property. A control or window at the bottom of the z-order appears underneath all other controls or windows and is referenced by an index of `(Controls.Count-1)` in the property. + + For more information about anchoring and docking controls, see [How to: Create a Multipane User Interface with Windows Forms](/dotnet/desktop/winforms/controls/how-to-create-a-multipane-user-interface-with-windows-forms). + + + +## Examples + The following code example shows a vertical splitter whose property is set to `Fill`. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> - How to: Create a Multipane User Interface with Windows Forms + How to: Create a Multipane User Interface with Windows Forms @@ -1171,20 +1171,20 @@ Gets or sets which panel remains the same size when the container is resized. One of the values of . The default value is . - panel stays the same size when a user resizes the container. - - - -## Examples - The following code example shows a horizontal splitter whose top panel is defined as a so that it does not resize along with the container. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the class. - + panel stays the same size when a user resizes the container. + + + +## Examples + The following code example shows a horizontal splitter whose top panel is defined as a so that it does not resize along with the container. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: + ]]> The assigned value is not one of the values. @@ -1237,11 +1237,11 @@ if the splitter is fixed; otherwise, . The default is . - property to enable or disable splitter movement. For example, you might programmatically set to `true` when refreshing the display, when some other control has the focus, or when an event is occurring for which the display areas divided by the must remain constant, and set to `false` when those circumstances do not apply. - + property to enable or disable splitter movement. For example, you might programmatically set to `true` when refreshing the display, when some other control has the focus, or when an event is occurring for which the display areas divided by the must remain constant, and set to `false` when those circumstances do not apply. + ]]> @@ -1275,13 +1275,13 @@ 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. + ]]> @@ -1320,15 +1320,15 @@ A that contains the event data. Raises the event. - event handler allows the user to move the splitter down when the DOWN arrow key is pressed. The event handler also draws the to show the current position of the splitter while it is moving. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event handler allows the user to move the splitter down when the DOWN arrow key is pressed. The event handler also draws the to show the current position of the splitter while it is moving. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1367,15 +1367,15 @@ A that contains the event data. Raises the event. - event handler allows the user to move the splitter up when the UP arrow key is pressed. The event handler also draws the to show the current position of the splitter while it is moving. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event handler allows the user to move the splitter up when the UP arrow key is pressed. The event handler also draws the to show the current position of the splitter while it is moving. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1414,13 +1414,13 @@ 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. + ]]> @@ -1458,13 +1458,13 @@ 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. + ]]> @@ -1534,15 +1534,15 @@ A that contains the event data. Raises the event. - event handler allows the user to track the splitter position while it is moved down with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event handler allows the user to track the splitter position while it is moved down with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1582,13 +1582,13 @@ 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. + ]]> @@ -1632,15 +1632,15 @@ A that contains the event data. Raises the event. - event handler allows the user to track the splitter position while it is moved with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event handler allows the user to track the splitter position while it is moved with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1680,15 +1680,15 @@ A that contains the event data. Raises the event. - event handler allows the user to track the splitter position while it is moved up with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event handler allows the user to track the splitter position while it is moved up with the mouse. also draws the to show the current position of the splitter while it is moving. The keeps track of the initial in case the user cancels the move. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1728,13 +1728,13 @@ The data for the event. 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. + ]]> @@ -1771,13 +1771,13 @@ 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. + ]]> @@ -1852,22 +1852,22 @@ A that contains the event data. Raises the event. - event is raised after the splitter has been moved. When the is in the process of moving, use the event and the event handler. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + event is raised after the splitter has been moved. When the is in the process of moving, use the event and the event handler. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]> @@ -1905,22 +1905,22 @@ A that contains the event data. Raises the event. - event is raised while the splitter is in the process of moving. After the has moved, use the event and the event handler. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + event is raised while the splitter is in the process of moving. After the has moved, use the event and the event handler. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]> @@ -1969,20 +1969,20 @@ Gets or sets a value indicating the horizontal or vertical orientation of the panels. One of the values. The default is . - property to change the from vertical to horizontal or from horizontal to vertical. - - - -## Examples - The following code example shows a horizontal splitter whose top and bottom panels contain controls. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the class. - + property to change the from vertical to horizontal or from horizontal to vertical. + + + +## Examples + The following code example shows a horizontal splitter whose top and bottom panels contain controls. Other basic properties of a horizontal splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet3"::: + ]]> The assigned value is not one of the values. @@ -2033,11 +2033,11 @@ Gets or sets the interior spacing, in pixels, between the edges of a and its contents. This property is not relevant to this class. An object of type representing the interior spacing. - @@ -2078,11 +2078,11 @@ This event is not relevant to this class. - @@ -2135,18 +2135,18 @@ Gets the left or top panel of the , depending on . If is , the left panel of the . If is , the top panel of the . - property to configure the left panel of a vertical or the top panel of a horizontal . For example, you can specify the minimum size of the panel by changing the value of the property, set the property to `Panel1` so that the panel remains the same size when the container is resized, or you can get or set the panel's and properties. - - You cannot remove from the . - + property to configure the left panel of a vertical or the top panel of a horizontal . For example, you can specify the minimum size of the panel by changing the value of the property, set the property to `Panel1` so that the panel remains the same size when the container is resized, or you can get or set the panel's and properties. + + You cannot remove from the . + > [!NOTE] -> If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. - - If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. - +> If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. + + If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. + ]]> @@ -2237,22 +2237,22 @@ Gets or sets the minimum distance in pixels of the splitter from the left or top edge of . An representing the minimum distance in pixels of the splitter from the left or top edge of . The default value is 25 pixels, regardless of . - property to prevent the splitter from moving too close to the left or top edge of the container. For example, you might want to prevent some of the display area of a from being covered. - - If the property is `Vertical` (the default), returns the minimum distance in pixels of the splitter from the left edge of . If the property is `Horizontal`, returns the minimum distance in pixels of the splitter from the top edge of . - - - -## Examples - The following code example shows a vertical splitter where the minimum size of (the left panel) is set to 30 pixels, which is now the minimum distance the splitter can be from the left edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - + property to prevent the splitter from moving too close to the left or top edge of the container. For example, you might want to prevent some of the display area of a from being covered. + + If the property is `Vertical` (the default), returns the minimum distance in pixels of the splitter from the left edge of . If the property is `Horizontal`, returns the minimum distance in pixels of the splitter from the top edge of . + + + +## Examples + The following code example shows a vertical splitter where the minimum size of (the left panel) is set to 30 pixels, which is now the minimum distance the splitter can be from the left edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> The specified value is incompatible with the orientation. @@ -2308,16 +2308,16 @@ Gets the right or bottom panel of the , depending on . If is , the right panel of the . If is , the bottom panel of the . - property to configure the right panel of a vertical or the bottom panel of a horizontal . For example, you can specify the minimum size of the panel by changing the value of the property, set the property to `Panel2` so that the panel remains the same size when the container is resized, or you can get or set the panel's and properties. - - You cannot remove from the . - + property to configure the right panel of a vertical or the bottom panel of a horizontal . For example, you can specify the minimum size of the panel by changing the value of the property, set the property to `Panel2` so that the panel remains the same size when the container is resized, or you can get or set the panel's and properties. + + You cannot remove from the . + > [!NOTE] -> If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. - +> If or contains no control that can receive the focus, the focus remains on the splitter when it is clicked. To change the focus to or , set the property of to 0 and the property of to 1. + ]]> @@ -2408,22 +2408,22 @@ Gets or sets the minimum distance in pixels of the splitter from the right or bottom edge of . An representing the minimum distance in pixels of the splitter from the right or bottom edge of . The default value is 25 pixels, regardless of . - property to prevent the splitter from moving too close to the right or bottom edge of the container. For example, you might want to prevent some of the display area of a from being covered. - - If the property is `Vertical` (the default), returns the minimum distance in pixels that the splitter can be from the right edge of . If the property is `Horizontal`, returns the minimum distance in pixels that the splitter can be from the bottom edge of . - - - -## Examples - The following code example shows a vertical splitter where the minimum size of (the right panel) is set to 20 pixels, which is now the minimum distance the splitter can be from the right edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - + property to prevent the splitter from moving too close to the right or bottom edge of the container. For example, you might want to prevent some of the display area of a from being covered. + + If the property is `Vertical` (the default), returns the minimum distance in pixels that the splitter can be from the right edge of . If the property is `Horizontal`, returns the minimum distance in pixels that the splitter can be from the bottom edge of . + + + +## Examples + The following code example shows a vertical splitter where the minimum size of (the right panel) is set to 20 pixels, which is now the minimum distance the splitter can be from the right edge of the container. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> The specified value is incompatible with the orientation. @@ -2462,11 +2462,11 @@ 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 box keys. The run time calls this method only 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 box keys. The run time calls this method only when the control is hosted in a Windows Forms application or as an ActiveX control. + ]]> @@ -2509,21 +2509,21 @@ if a control is selected; otherwise, . - controls the tab focus order in the following manner: - -- From the first control outside the to the first control on . - -- All controls on . - -- The splitter (so that the user can use the arrow keys to move the splitter). - -- All controls on . - -- The second control outside the that is next in the tab order. - + controls the tab focus order in the following manner: + +- From the first control outside the to the first control on . + +- All controls on . + +- The splitter (so that the user can use the arrow keys to move the splitter). + +- All controls on . + +- The second control outside the that is next in the tab order. + ]]> @@ -2686,20 +2686,20 @@ Gets or sets the location of the splitter, in pixels, from the left or top edge of the . An representing the location of the splitter, in pixels, from the left or top edge of the . The default value is 50 pixels. - property to determine or specify the distance in pixels of the splitter from the left or top edge of the container. You can both specify an initial distance and change the distance at design time or run time. If is `Horizontal`, is calculated in pixels from the top edge of the . If is `Vertical`, is calculated in pixels from the left edge of the . - - - -## Examples - The following code example specifies that the initial distance of the vertical splitter from the left edge of the container is 79 pixels. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - + property to determine or specify the distance in pixels of the splitter from the left or top edge of the container. You can both specify an initial distance and change the distance at design time or run time. If is `Horizontal`, is calculated in pixels from the top edge of the . If is `Vertical`, is calculated in pixels from the left edge of the . + + + +## Examples + The following code example specifies that the initial distance of the vertical splitter from the left edge of the container is 79 pixels. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> The value is less than zero. @@ -2747,20 +2747,20 @@ Gets or sets a value representing the increment of splitter movement in pixels. An representing the increment of splitter movement in pixels. The default value is one pixel. - property to create a snapping splitter that moves in larger increments than one pixel. - - - -## Examples - The following code example specifies that the vertical splitter moves in 10-pixel increments. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - + property to create a snapping splitter that moves in larger increments than one pixel. + + + +## Examples + The following code example specifies that the vertical splitter moves in 10-pixel increments. Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> The value is less than one. @@ -2792,20 +2792,20 @@ Occurs when the splitter control is moved. - event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]> @@ -2840,22 +2840,22 @@ Occurs when the splitter control is in the process of moving. - property value programmatically. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. - + property value programmatically. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example raises the event, signified in this example by a change to the cursor style when you move the splitter. The event is raised when you stop moving the splitter. This is signified in this example by the cursor style reverting to the default. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SplitContainerEvents/CPP/splitcontainerevents.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/OnSplitterMoved/splitcontainerevents.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SplitContainerEvents/VB/splitcontainerevents.vb" id="Snippet1"::: + ]]> @@ -2896,20 +2896,20 @@ Gets the size and location of the splitter relative to the . A that specifies the size and location of the splitter relative to the . - to get the width and height of the splitter relative to the . The , , , , and event handlers draw the to show the current position of the splitter while it is moving. - - The meaning of the values vary depending on the . The output of is in the format `{X, Y, Width, Height}`. The following table shows the meaning of the values for vertical and horizontal splitters. - -|Dimension|Vertical Splitter|Horizontal Splitter| -|---------------|-----------------------|-------------------------| -|X|The distance in pixels of the splitter from the left edge of the .|This value is always 0 for a horizontal splitter, indicating that the splitter is flush with the left edge of the .| -|Y|This value is always 0 for a vertical splitter, indicating that the splitter is flush with the top edge of the .|The distance in pixels of the splitter from the top edge of the .| -|Width|The width of the splitter.|The height of the splitter, which is equivalent to the height of the control.| -|Height|The height of the splitter, which is equivalent to the height of the control.|The width of the splitter.| - + to get the width and height of the splitter relative to the . The , , , , and event handlers draw the to show the current position of the splitter while it is moving. + + The meaning of the values vary depending on the . The output of is in the format `{X, Y, Width, Height}`. The following table shows the meaning of the values for vertical and horizontal splitters. + +|Dimension|Vertical Splitter|Horizontal Splitter| +|---------------|-----------------------|-------------------------| +|X|The distance in pixels of the splitter from the left edge of the .|This value is always 0 for a horizontal splitter, indicating that the splitter is flush with the left edge of the .| +|Y|This value is always 0 for a vertical splitter, indicating that the splitter is flush with the top edge of the .|The distance in pixels of the splitter from the top edge of the .| +|Width|The width of the splitter.|The height of the splitter, which is equivalent to the height of the control.| +|Height|The height of the splitter, which is equivalent to the height of the control.|The width of the splitter.| + ]]> @@ -2955,20 +2955,20 @@ Gets or sets the width of the splitter in pixels. An representing the width of the splitter, in pixels. The default is four pixels. - property to change the width of the splitter itself, not the . - - - -## Examples - The following code example specifies that the initial width of the vertical splitter is 6 pixels (the default). Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. - + property to change the width of the splitter itself, not the . + + + +## Examples + The following code example specifies that the initial width of the vertical splitter is 6 pixels (the default). Other basic properties of a vertical splitter are also shown. This example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/BasicSplitContainer/CPP/basicsplitcontainer.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/Overview/basicsplitcontainer.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/BasicSplitContainer/VB/basicsplitcontainer.vb" id="Snippet2"::: + ]]> The value is less than one or is incompatible with the orientation. @@ -3015,16 +3015,16 @@ if the user can give the focus to the splitter using the TAB key; otherwise, . The default is . - to `true` to give input focus to a splitter so that it can be moved with the arrow keys as well as with the mouse. Starting in the .NET Framework 4, setting to `false` excludes the splitter and any of the controls that are contained in the from the collection of controls in the tab order. To enable controls to get focus by using the TAB key, create a control that inherits from . Create a new property named `TabStop` and override the method. The following example demonstrates how to accomplish this. - + to `true` to give input focus to a splitter so that it can be moved with the arrow keys as well as with the mouse. Starting in the .NET Framework 4, setting to `false` excludes the splitter and any of the controls that are contained in the from the collection of controls in the tab order. To enable controls to get focus by using the TAB key, create a control that inherits from . Create a new property named `TabStop` and override the method. The following example demonstrates how to accomplish this. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/SplitContainer/TabStop/program.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/splitcontainertabstop/vb/module1.vb" id="Snippet1"::: - - You can manipulate the tab order by setting the control's property value. - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/splitcontainertabstop/vb/module1.vb" id="Snippet1"::: + + You can manipulate the tab order by setting the control's property value. + ]]> @@ -3074,11 +3074,11 @@ This property is not relevant to this class. A string. - @@ -3119,11 +3119,11 @@ This event is not relevant to this class. - @@ -3157,13 +3157,13 @@ 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://learn.microsoft.com/previous-versions/windows/desktop/legacy/ms633573(v=vs.85)). - + 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://learn.microsoft.com/previous-versions/windows/desktop/legacy/ms633573(v=vs.85)). + ]]> diff --git a/xml/System.Windows.Forms/StatusStrip.xml b/xml/System.Windows.Forms/StatusStrip.xml index 96dec3e6a74..7f0cb1ed674 100644 --- a/xml/System.Windows.Forms/StatusStrip.xml +++ b/xml/System.Windows.Forms/StatusStrip.xml @@ -71,8 +71,8 @@ The following items are specifically designed to work seamlessly with both StatusStrip Items Collection Editor StatusStrip Tasks Dialog Box - StatusStrip Control - How to: Use the Spring Property Interactively in a StatusStrip + StatusStrip Control + How to: Use the Spring Property Interactively in a StatusStrip diff --git a/xml/System.Windows.Forms/TabControl.xml b/xml/System.Windows.Forms/TabControl.xml index b97bd4c7194..68f702fb28f 100644 --- a/xml/System.Windows.Forms/TabControl.xml +++ b/xml/System.Windows.Forms/TabControl.xml @@ -58,54 +58,54 @@ Manages a related set of tab pages. - contains tab pages, which are represented by objects that you add through the property. The order of tab pages in this collection reflects the order the tabs appear in the control. - - The user can change the current by clicking one of the tabs in the control. You can also programmatically change the current by using one of the following properties: - -- - -- - - In .NET Framework 2.0, you can also use one of the following methods: - -- - -- - - In .NET Framework 2.0, you can respond when the current tab changes by handling one of the following events: - -- - -- - -- - -- - - The tabs in a are part of the , but not parts of the individual controls. Members of the class, such as the property, affect only the client rectangle of the tab page, but not the tabs. Additionally, the method of the will not hide the tab. To hide the tab, you must remove the control from the collection. - - In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. - - 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 of the tab page, the raises the appropriate event. - - Controls contained in a are not created until the tab page is shown, and any data bindings in these controls are not activated until the tab page is shown. - - When visual styles are enabled, and the property is set to a value other than , the tab contents might not render correctly. To work around this issue, you can paint the tab contents yourself using owner drawing. For more information, see [How to: Display Side-Aligned Tabs with TabControl](/dotnet/framework/winforms/controls/how-to-display-side-aligned-tabs-with-tabcontrol). - - When the property is set to a value other than and the property is set to a value other than , the tab page contents might not render correctly. - - - -## Examples - The following code example uses the Visual Studio Windows Forms Designer to create a with three tab pages. Each tab page contains several controls. - + contains tab pages, which are represented by objects that you add through the property. The order of tab pages in this collection reflects the order the tabs appear in the control. + + The user can change the current by clicking one of the tabs in the control. You can also programmatically change the current by using one of the following properties: + +- + +- + + In .NET Framework 2.0, you can also use one of the following methods: + +- + +- + + In .NET Framework 2.0, you can respond when the current tab changes by handling one of the following events: + +- + +- + +- + +- + + The tabs in a are part of the , but not parts of the individual controls. Members of the class, such as the property, affect only the client rectangle of the tab page, but not the tabs. Additionally, the method of the will not hide the tab. To hide the tab, you must remove the control from the collection. + + In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. + + 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 of the tab page, the raises the appropriate event. + + Controls contained in a are not created until the tab page is shown, and any data bindings in these controls are not activated until the tab page is shown. + + When visual styles are enabled, and the property is set to a value other than , the tab contents might not render correctly. To work around this issue, you can paint the tab contents yourself using owner drawing. For more information, see [How to: Display Side-Aligned Tabs with TabControl](/dotnet/desktop/winforms/controls/how-to-display-side-aligned-tabs-with-tabcontrol). + + When the property is set to a value other than and the property is set to a value other than , the tab page contents might not render correctly. + + + +## Examples + The following code example uses the Visual Studio Windows Forms Designer to create a with three tab pages. Each tab page contains several controls. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic TabControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic TabControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic TabControl Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -133,15 +133,15 @@ Initializes a new instance of the class. - with one . The constructor creates an instance of `tabControl1`. - + with one . The constructor creates an instance of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabControl_constructor/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/.ctor/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl_constructor/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl_constructor/VB/form1.vb" id="Snippet1"::: + ]]> @@ -195,27 +195,27 @@ Gets or sets the area of the control (for example, along the top) where the tabs are aligned. One of the values. The default is . - property is set to or , the property is automatically set to `true`. - - When you set the property to , it only appears as such when the property is set to . Otherwise, the property displays as if set to the value. - - When you set the property to , you must also set the property to so that the buttons display correctly. - + property is set to or , the property is automatically set to `true`. + + When you set the property to , it only appears as such when the property is set to . Otherwise, the property displays as if set to the value. + + When you set the property to , you must also set the property to so that the buttons display correctly. + > [!NOTE] -> When you set the property to `Buttons`, you must also set the property to `Top` so that the tab page contents display correctly. Additionally, when visual styles are enabled, and the property is set to a value other than , the tab contents may not render correctly. - - - -## Examples - The following code example creates a with three objects. The property is set to `Left`, which positions the tabs of `tabControl1` on the left side. - +> When you set the property to `Buttons`, you must also set the property to `Top` so that the tab page contents display correctly. Additionally, when visual styles are enabled, and the property is set to a value other than , the tab contents may not render correctly. + + + +## Examples + The following code example creates a with three objects. The property is set to `Left`, which positions the tabs of `tabControl1` on the left side. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabAlignment/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Alignment/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabAlignment/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabAlignment/VB/form1.vb" id="Snippet1"::: + ]]> The property value is not a valid value. @@ -261,23 +261,23 @@ Gets or sets the visual appearance of the control's tabs. One of the values. The default is . - property to `FlatButtons`, it only appears as such when the property is set to `Top`. Otherwise, the property appears as if set to the `Buttons` value. - + property to `FlatButtons`, it only appears as such when the property is set to `Top`. Otherwise, the property appears as if set to the `Buttons` value. + > [!NOTE] -> When you set the property to `Buttons`, you must also set the property to `Top` so that the tab page contents display correctly. - - - -## Examples - The following code example creates a with two objects. This example sets the property to `Buttons`, which displays the tabs of the tab pages as buttons. - +> When you set the property to `Buttons`, you must also set the property to `Top` so that the tab page contents display correctly. + + + +## Examples + The following code example creates a with two objects. This example sets the property to `Buttons`, which displays the tabs of the tab pages as buttons. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Appearance/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Appearance/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Appearance/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Appearance/VB/form1.vb" id="Snippet1"::: + ]]> The property value is not a valid value. @@ -452,11 +452,11 @@ Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -539,11 +539,11 @@ Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -723,33 +723,33 @@ Occurs when a tab is deselected. - , the following events occur in the following order. - -- - -- - -- - -- - - These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . - - The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. - - - -## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. - + , the following events occur in the following order. + +- + +- + +- + +- + + These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . + + The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. + + + +## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet560"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet560"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet560"::: + ]]> @@ -794,33 +794,33 @@ Occurs before a tab is deselected, enabling a handler to cancel the tab change. - , the following events occur in the following order. - -- - -- - -- - -- - - These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . - - The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. - - - -## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. - + , the following events occur in the following order. + +- + +- + +- + +- + + These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . + + The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. + + + +## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet559"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet559"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet559"::: + ]]> @@ -879,11 +879,11 @@ The index in the collection of the tab to deselect. Makes the tab following the tab with the specified index the current tab. - . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]> @@ -927,17 +927,17 @@ The of the tab to deselect. Makes the tab following the tab with the specified name the current tab. - . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]> - The argument is . - - -or- - + The argument is . + + -or- + The argument does not match the property of any in the collection. @@ -978,18 +978,18 @@ The to deselect. Makes the tab following the specified the current tab. - . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. - + . If there are at least two tabs in the control, the tab following the specified tab becomes the current tab. If the specified tab is the last tab in the control, the first tab becomes the current tab. + ]]> - is less than 0 or greater than the number of controls in the collection minus 1. - - -or- - + is less than 0 or greater than the number of controls in the collection minus 1. + + -or- + is not in the collection. The argument is . @@ -1029,15 +1029,15 @@ Gets the display area of the control's tab pages. A that represents the display area of the tab pages. - with one . This example uses the property to draw a representing the tab page display area of `tabControl1`. Notice that the example uses the method; otherwise, the drawing code overwrites the drawn in the `DrawOnTabPage` method. - + with one . This example uses the property to draw a representing the tab page display area of `tabControl1`. Notice that the example uses the method; otherwise, the drawing code overwrites the drawn in the `DrawOnTabPage` method. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DisplayRectangle1/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DisplayRectangle/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DisplayRectangle1/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DisplayRectangle1/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1143,24 +1143,24 @@ Occurs when the needs to paint each of its tabs if the property is set to . - property to , the raises the event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the event. - - The does not support variable tab sizes with owner drawing. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example creates a with one . This example declares an event handler that is used to draw a string and `Rectangle` on the tab of `tabPage1`. The event handler is bound to the `DrawItem` event. - + property to , the raises the event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the event. + + The does not support variable tab sizes with owner drawing. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example creates a with one . This example declares an event handler that is used to draw a string and `Rectangle` on the tab of `tabPage1`. The event handler is bound to the `DrawItem` event. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DrawItem/CPP/drawitem.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DrawItem/drawitem.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawItem/VB/drawitem.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawItem/VB/drawitem.vb" id="Snippet1"::: + ]]> @@ -1204,24 +1204,24 @@ Gets or sets the way that the control's tabs are drawn. One of the values. The default is . - property to , the raises the event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the event. - - The does not support variable tab sizes with owner drawing. - - - -## Examples - The following code example creates a with one . This example sets the property to `OwnerDrawFixed`, which specifies that the tabs are drawn by the parent object `Form1`. The value `OwnerDrawFixed` also enables access to the event, which, in this example, is used to draw `myTabRect` on the `tabPage1` tab. - - Use the and namespaces with this example. - + property to , the raises the event whenever it needs to paint one of its tabs. To customize the appearance of the tabs, provide your own painting code in a handler for the event. + + The does not support variable tab sizes with owner drawing. + + + +## Examples + The following code example creates a with one . This example sets the property to `OwnerDrawFixed`, which specifies that the tabs are drawn by the parent object `Form1`. The value `OwnerDrawFixed` also enables access to the event, which, in this example, is used to draw `myTabRect` on the `tabPage1` tab. + + Use the and namespaces with this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/DrawMode/CPP/drawmode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/DrawMode/drawmode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawMode/VB/drawmode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/DrawMode/VB/drawmode.vb" id="Snippet1"::: + ]]> The property value is not a valid value. @@ -1309,11 +1309,11 @@ Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -1463,23 +1463,23 @@ Returns the bounding rectangle for a specified tab in this tab control. A that represents the bounds of the specified tab. - with one . This example uses the method to get a `Rectangle` that represents the `tabPage1` tab area. The `myTabRect` `Rectangle` is drawn by the event. - - Use the and namespaces with this example. - + with one . This example uses the method to get a `Rectangle` that represents the `tabPage1` tab area. The `myTabRect` `Rectangle` is drawn by the event. + + Use the and namespaces with this example. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/GetTabRect/CPP/gettabrect.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/GetTabRect/gettabrect.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/GetTabRect/VB/gettabrect.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/GetTabRect/VB/gettabrect.vb" id="Snippet1"::: + ]]> - The index is less than zero. - - -or- - + The index is less than zero. + + -or- + The index is greater than or equal to . @@ -1552,20 +1552,20 @@ if the tabs change in appearance when the mouse passes over them; otherwise, . The default is . - with two objects. The property is set to `true`, which highlights the tab `myTabPage1` or `myTabPage2` when the mouse passes over the tabs. - + with two objects. The property is set to `true`, which highlights the tab `myTabPage1` or `myTabPage2` when the mouse passes over the tabs. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/HotTrack/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/HotTrack/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/HotTrack/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/HotTrack/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1620,20 +1620,20 @@ Gets or sets the images to display on the control's tabs. An that specifies the images to display on the tabs. - property of that . The acts as the index into the . - - - -## Examples - The following code example creates a with one . This example uses the property to display images, from the collection defined by the named `myImages`, on the tabs of `tabControl1`. - + property of that . The acts as the index into the . + + + +## Examples + The following code example creates a with one . This example uses the property to display images, from the collection defined by the named `myImages`, on the tabs of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabControl.ImageList/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ImageList/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl.ImageList/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabControl.ImageList/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1671,11 +1671,11 @@ if the specified key is a regular input key; otherwise, . - @@ -1713,20 +1713,20 @@ Gets or sets the size of the control's tabs. A that represents the size of the tabs. The default automatically sizes the tabs to fit the icons and labels on the tabs. - property of the property, the property must be set to `Fixed`. - - - -## Examples - The following code example creates a with two objects. To define the dimensions of the tabs, set the property equal to a structure. In this example, defines the tabs 90 pixels wide and 50 pixels high. You cannot change the width of the tabs unless the property is set to the value. - + property of the property, the property must be set to `Fixed`. + + + +## Examples + The following code example creates a with two objects. To define the dimensions of the tabs, set the property equal to a structure. In this example, defines the tabs 90 pixels wide and 50 pixels high. You cannot change the width of the tabs unless the property is set to the value. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ItemSize/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ItemSize/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ItemSize/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ItemSize/VB/form1.vb" id="Snippet1"::: + ]]> The width or height of the is less than 0. @@ -1767,22 +1767,22 @@ if more than one row of tabs can be displayed; otherwise, . The default is . - is `false`, only one row of tabs is displayed, even if all the tabs do not fit in the available space. In that case, however, arrows are displayed that enable the user to navigate to the undisplayed tabs. - - If the property is changed to `false` while the property is set to `Left` or `Right`, the property is automatically reset to `Top`. - - - -## Examples - The following code example creates a with four objects. The property is set to `true`, which displays two rows of tabs instead of one. - + is `false`, only one row of tabs is displayed, even if all the tabs do not fit in the available space. In that case, however, arrows are displayed that enable the user to navigate to the undisplayed tabs. + + If the property is changed to `false` while the property is set to `Left` or `Right`, the property is automatically reset to `Top`. + + + +## Examples + The following code example creates a with four objects. The property is set to `true`, which displays two rows of tabs instead of one. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Multiline/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Multiline/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Multiline/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Multiline/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1817,13 +1817,13 @@ 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. + ]]> @@ -1861,13 +1861,13 @@ 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. + ]]> @@ -1906,13 +1906,13 @@ 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. + ]]> @@ -1953,15 +1953,15 @@ An that contains the event data. Raises the event of the . - event of the current . In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. - - 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. - + event of the current . In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. + + 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. + ]]> @@ -2000,13 +2000,13 @@ 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. + ]]> @@ -2104,13 +2104,13 @@ 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. + ]]> @@ -2150,18 +2150,18 @@ A that contains the event data. Raises the event. - control enables the user to use the keyboard to switch between controls. The following table describes how the switches between the selected controls, depending on which keys are pressed. - -|Key|Description| -|---------|-----------------| -| + |Selects the next .| -| + + |Selects the previous .| -| + |Selects the next .| -| + |Selects the previous .| - + control enables the user to use the keyboard to switch between controls. The following table describes how the switches between the selected controls, depending on which keys are pressed. + +|Key|Description| +|---------|-----------------| +| + |Selects the next .| +| + + |Selects the previous .| +| + |Selects the next .| +| + |Selects the previous .| + ]]> @@ -2199,15 +2199,15 @@ An that contains the event data. Raises the event of the . - event of the current . In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. - - 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. - + event of the current . In .NET Framework 2.0, the tab is considered part of the tab page for determining when the and events of the occur. In earlier versions of the .NET Framework, the and events of the do not occur when focus enters or leaves a tab, but only when focus enters or leaves the client rectangle of the tab page. + + 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. + ]]> @@ -2311,13 +2311,13 @@ 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. + ]]> @@ -2355,13 +2355,13 @@ 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. + ]]> @@ -2400,13 +2400,13 @@ 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. + ]]> @@ -2443,13 +2443,13 @@ 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. + ]]> @@ -2527,15 +2527,15 @@ Gets or sets the amount of space around each item on the control's tab pages. A that specifies the amount of space around each item. The default is (6,3). - with two objects. The property is used to create a cushion of 22 pixels around the tab `myTabPage1` and `myTabPage2`. - + with two objects. The property is used to create a cushion of 22 pixels around the tab `myTabPage1` and `myTabPage2`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Padding/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/Padding/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Padding/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Padding/VB/form1.vb" id="Snippet1"::: + ]]> The width or height of the is less than 0. @@ -2646,11 +2646,11 @@ Removes all the tab pages and additional controls from this tab control. - @@ -2696,15 +2696,15 @@ if right-to-left mirror placement is turned on; for standard child control placement. The default is . - property is primarily useful for developing forms for worldwide audiences. Many containers are designed so that controls are laid out in the container in a left-to-right fashion. These containers are compatible with languages that follow this writing direction. However, when you display the same containers to users of right-to-left languages, it is often preferable to reverse the order of the controls on the form. If both the and properties are `true`, mirroring will be turned on for the container and control placement and text flow will be right-to-left. - - Changing the value of this property raises the event. - - For more information about globalization issues, see [Best Practices for Developing World-Ready Applications](/dotnet/standard/globalization-localization/best-practices-for-developing-world-ready-apps). - + property is primarily useful for developing forms for worldwide audiences. Many containers are designed so that controls are laid out in the container in a left-to-right fashion. These containers are compatible with languages that follow this writing direction. However, when you display the same containers to users of right-to-left languages, it is often preferable to reverse the order of the controls on the form. If both the and properties are `true`, mirroring will be turned on for the container and control placement and text flow will be right-to-left. + + Changing the value of this property raises the event. + + For more information about globalization issues, see [Best Practices for Developing World-Ready Applications](/dotnet/standard/globalization-localization/best-practices-for-developing-world-ready-apps). + ]]> @@ -2744,21 +2744,21 @@ 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 type named `TabControl1`. Then 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet555"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet555"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet555"::: + ]]> @@ -2805,20 +2805,20 @@ Gets the number of rows that are currently being displayed in the control's tab strip. The number of rows that are currently being displayed in the tab strip. - property when the property is `true` and you want to know the number of rows that the tabs occupy. - - - -## Examples - The following code example creates a with five objects. This example uses the property to get the number of rows currently in the `tabControl1` tab strip. - + property when the property is `true` and you want to know the number of rows that the tabs occupy. + + + +## Examples + The following code example creates a with five objects. This example uses the property to get the number of rows currently in the `tabControl1` tab strip. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/RowCount/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/RowCount/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RowCount/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/RowCount/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2895,33 +2895,33 @@ Occurs when a tab is selected. - , the following events occur in the following order. - -- - -- - -- - -- - - These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . - - The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. - - - -## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. - + , the following events occur in the following order. + +- + +- + +- + +- + + These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . + + The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. + + + +## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet558"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet558"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet558"::: + ]]> @@ -2971,15 +2971,15 @@ Gets or sets the index of the currently selected tab page. The zero-based index of the currently selected tab page. The default is -1, which is also the value if no tab page is selected. - with two objects. The property sets `tabPage2` as the currently selected tab page using its index value. - + with two objects. The property sets `tabPage2` as the currently selected tab page using its index value. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SelectedIndex/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SelectedIndex/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedIndex/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedIndex/VB/form1.vb" id="Snippet1"::: + ]]> The value is less than -1. @@ -3026,23 +3026,23 @@ Occurs when the property has changed. - property to determine its new value. Alternatively, you can handle the event and use the property to determine the index of the selected tab page. - - 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. - + property to determine its new value. Alternatively, you can handle the event and use the property to determine the index of the selected tab page. + + 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet556"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet556"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet556"::: + ]]> @@ -3101,20 +3101,20 @@ Gets or sets the currently selected tab page. A that represents the selected tab page. If no tab page is selected, the value is . - collection to make it the current tab page. - - - -## Examples - The following code example creates a with two objects. The property sets `tabPage2` as the currently selected tab page. - + collection to make it the current tab page. + + + +## Examples + The following code example creates a with two objects. The property sets `tabPage2` as the currently selected tab page. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SelectedTab/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SelectedTab/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedTab/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SelectedTab/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3160,33 +3160,33 @@ Occurs before a tab is selected, enabling a handler to cancel the tab change. - , the following events occur in the following order. - -- - -- - -- - -- - - These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . - - The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. - - - -## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. - + , the following events occur in the following order. + +- + +- + +- + +- + + These events let you perform tasks such as canceling a tab change if a is in an invalid state or updating the state of a newly displayed . + + The current tab changes when the user clicks a tab, when you call the or method, or when you change the value of the or property. + + + +## 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 type named `TabControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet557"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet557"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet557"::: + ]]> @@ -3245,11 +3245,11 @@ The index in the collection of the tab to select. Makes the tab with the specified index the current tab. - . - + . + ]]> @@ -3293,17 +3293,17 @@ The of the tab to select. Makes the tab with the specified name the current tab. - . - + . + ]]> - The argument is . - - -or- - + The argument is . + + -or- + The argument does not match the property of any in the collection. @@ -3344,18 +3344,18 @@ The to select. Makes the specified the current tab. - . - + . + ]]> - is less than 0 or greater than the number of controls in the collection minus 1. - - -or- - + is less than 0 or greater than the number of controls in the collection minus 1. + + -or- + is not in the collection. The argument is . @@ -3406,20 +3406,20 @@ if ToolTips are shown for the tabs that have them; otherwise, . The default is . - property of the . - - - -## Examples - The following code example creates a with two objects. For tab page ToolTips to display, the property must equal to `true`, as in this example. The property is used to assign string values to the ToolTips. - + property of the . + + + +## Examples + The following code example creates a with two objects. For tab page ToolTips to display, the property must equal to `true`, as in this example. The property is used to assign string values to the ToolTips. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTipText/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/ShowToolTips/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTipText/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTipText/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3470,15 +3470,15 @@ Gets or sets the way that the control's tabs are sized. One of the values. The default is . - with five . This example sets the property to `FillToRight`, which sizes the tabs so that each row fills the entire width of `tabControl1`. - + with five . This example sets the property to `FillToRight`, which sizes the tabs so that each row fills the entire width of `tabControl1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/SizeMode/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/SizeMode/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SizeMode/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/SizeMode/VB/form1.vb" id="Snippet1"::: + ]]> The property value is not a valid value. @@ -3530,15 +3530,15 @@ Gets the number of tabs in the tab strip. The number of tabs in the tab strip. - with five objects. This example uses the property to get the number of tabs currently in the `tabControl1` tab strip. - + with five objects. This example uses the property to get the number of tabs currently in the `tabControl1` tab strip. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabCount/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl/TabCount/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabCount/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabCount/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3600,20 +3600,20 @@ Gets the collection of tab pages in this tab control. A that contains the objects in this . - with one . This example uses the method to add a single tab page to the `tabControl1` tab control. Notice the property is used to get the `tabControl1` controls collection to add the `tabPage1` to this collection. - + with one . This example uses the method to add a single tab page to the `tabControl1` tab control. Notice the property is used to get the `tabControl1` controls collection to add the `tabPage1` to this collection. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TabPageCollection.Add/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabControl+TabPageCollection/Add/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabPageCollection.Add/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TabPageCollection.Add/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3704,11 +3704,11 @@ Occurs when the value of the property changes. - property is not meaningful for this control, although you can change its value and handle the event to detect the change. - + property is not meaningful for this control, although you can change its value and handle the event to detect the change. + ]]> @@ -3741,11 +3741,11 @@ Returns a string that represents the control. A string that represents the current . - property of the control. If there is at least one control on the , this method returns a string that includes the string returned by the method for the first . - + property of the control. If there is at least one control on the , this method returns a string that includes the string returned by the method for the first . + ]]> @@ -3789,11 +3789,11 @@ to change focus to the next ; otherwise, . Sets the property to for the appropriate control in the collection. - is visible. If you want the tab control to set the property to `true` for the next in the tab order, call this method with `updateFocus` set to `true`. - + is visible. If you want the tab control to set the property to `true` for the next in the tab order, call this method with `updateFocus` set to `true`. + ]]> diff --git a/xml/System.Windows.Forms/TabRenderer.xml b/xml/System.Windows.Forms/TabRenderer.xml index 755dff0cb74..5123ec49404 100644 --- a/xml/System.Windows.Forms/TabRenderer.xml +++ b/xml/System.Windows.Forms/TabRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a tab control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a tab control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a tab control, use the method to draw the page, and use the method to draw each tab. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the tab control with the current visual style. Otherwise, the methods and properties of this class will throw an . To determine whether the members of this class can be used, check the value of the property. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the and methods to draw a basic tab control with two tabs. - + class provides a set of `static` methods that can be used to render a tab control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a tab control, use the method to draw the page, and use the method to draw each tab. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods of this class will draw the tab control with the current visual style. Otherwise, the methods and properties of this class will throw an . To determine whether the members of this class can be used, check the value of the property. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the and methods to draw a basic tab control with two tabs. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -99,21 +99,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -153,21 +153,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, and with an optional focus rectangle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows.
@@ -222,21 +222,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, and with the specified text. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -280,21 +280,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, with the specified image, and with an optional focus rectangle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -352,30 +352,30 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, with the specified text, and with an optional focus rectangle. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a tab item. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a tab item. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -429,21 +429,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, with the specified text and text formatting, and with an optional focus rectangle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -512,21 +512,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds, with the specified text and image, and with an optional focus rectangle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -591,21 +591,21 @@ One of the values that specifies the visual state of the tab. Draws a tab in the specified state and bounds; with the specified text, text formatting, and image; and with an optional focus rectangle. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -640,30 +640,30 @@ The that specifies the bounds of the tab page. Draws a tab page in the specified bounds. - property returns `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a tab page. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a tab page. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -694,20 +694,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, . - and methods will throw an . - - - -## Examples - The following code example uses the property to determine whether to use the and methods. This code example is part of a larger example provided for the class. - + and methods will throw an . + + + +## Examples + The following code example uses the property to determine whether to use the and methods. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TabRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TabRenderer/VB/form1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/TableLayoutPanel.xml b/xml/System.Windows.Forms/TableLayoutPanel.xml index 8557491c2f5..7a683c873c7 100644 --- a/xml/System.Windows.Forms/TableLayoutPanel.xml +++ b/xml/System.Windows.Forms/TableLayoutPanel.xml @@ -85,66 +85,66 @@ Represents a panel that dynamically lays out its contents in a grid composed of rows and columns. - control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so it can respond to changes such as the parent control resizing or text length changing due to localization. - - Any Windows Forms control can be a child of the control, including other instances of . This allows you to construct sophisticated layouts that adapt to changes at runtime. - - The control can expand to accommodate new controls when they are added, depending on the value of the , , and properties. Setting either the or property to a value of 0 specifies that the will be unbound in the corresponding direction. - - You can also control the direction of expansion (horizontal or vertical) after the control is full of child controls. By default, the control expands downward by adding rows. - - If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the and properties. You can set the properties of rows or columns individually. - - The control adds the following properties to its child controls: `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan`. - - You can merge cells in the control by setting the `ColumnSpan` or `RowSpan` properties on a child control. - + control arranges its contents in a grid. Because the layout is performed both at design time and run time, it can change dynamically as the application environment changes. This gives the controls in the panel the ability to proportionally resize, so it can respond to changes such as the parent control resizing or text length changing due to localization. + + Any Windows Forms control can be a child of the control, including other instances of . This allows you to construct sophisticated layouts that adapt to changes at runtime. + + The control can expand to accommodate new controls when they are added, depending on the value of the , , and properties. Setting either the or property to a value of 0 specifies that the will be unbound in the corresponding direction. + + You can also control the direction of expansion (horizontal or vertical) after the control is full of child controls. By default, the control expands downward by adding rows. + + If you want rows and columns that behave differently from the default behavior, you can control the properties of rows and columns by using the and properties. You can set the properties of rows or columns individually. + + The control adds the following properties to its child controls: `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan`. + + You can merge cells in the control by setting the `ColumnSpan` or `RowSpan` properties on a child control. + > [!NOTE] -> To set the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the , , , , and methods. -> -> To read the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the , , , , and methods. - - The docking behavior of child controls is the same as other container controls. - - The anchoring behavior of child controls in a differs from the behavior in other container controls. If the value of the child control's property is set to or , the control will be placed against the left or right border of the cell, at a distance that is the sum of the control's property and the panel's property. If both the and values are set, the control will be sized to the width of the cell, with the and values taken into account. The behavior for and anchoring is analogous. For more information, see [How to: Anchor and Dock Child Controls in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control). - - If you need a child control to mimic the default anchoring behavior in other container controls, you can adjust the and properties to maintain a constant distance between the control's border and the cell's border. - - Setting the values of both the `Column` and `Row` properties of a child control to -1 will cause the control to be moved to the first empty cell in the control. The empty cell will be chosen in a search that proceeds from left to right and from top to bottom. This order is dependent on the culture, so it will behave correctly in right-to-left (RTL) layouts. - +> To set the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the , , , , and methods. +> +> To read the `Cell`, `Column`, `Row`, `ColumnSpan`, and `RowSpan` properties at run time, use the , , , , and methods. + + The docking behavior of child controls is the same as other container controls. + + The anchoring behavior of child controls in a differs from the behavior in other container controls. If the value of the child control's property is set to or , the control will be placed against the left or right border of the cell, at a distance that is the sum of the control's property and the panel's property. If both the and values are set, the control will be sized to the width of the cell, with the and values taken into account. The behavior for and anchoring is analogous. For more information, see [How to: Anchor and Dock Child Controls in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-anchor-and-dock-child-controls-in-a-tablelayoutpanel-control). + + If you need a child control to mimic the default anchoring behavior in other container controls, you can adjust the and properties to maintain a constant distance between the control's border and the cell's border. + + Setting the values of both the `Column` and `Row` properties of a child control to -1 will cause the control to be moved to the first empty cell in the control. The empty cell will be chosen in a search that proceeds from left to right and from top to bottom. This order is dependent on the culture, so it will behave correctly in right-to-left (RTL) layouts. + > [!NOTE] -> Only controls that have the property set to `true` participate in the control's layout computations. - - Also see: - -- [How to: Align and Stretch a Control in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-align-and-stretch-a-control-in-a-tablelayoutpanel-control) - -- [How to: Span Rows and Columns in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-span-rows-and-columns-in-a-tablelayoutpanel-control) - -- [How to: Edit Columns and Rows in a TableLayoutPanel Control](/dotnet/framework/winforms/controls/how-to-edit-columns-and-rows-in-a-tablelayoutpanel-control) - -- [Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel](/dotnet/framework/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-a-tablelayoutpanel) - - - -## Examples - The following code example demonstrates how to override the method to create a custom appearance for a cell. - +> Only controls that have the property set to `true` participate in the control's layout computations. + + Also see: + +- [How to: Align and Stretch a Control in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-align-and-stretch-a-control-in-a-tablelayoutpanel-control) + +- [How to: Span Rows and Columns in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-span-rows-and-columns-in-a-tablelayoutpanel-control) + +- [How to: Edit Columns and Rows in a TableLayoutPanel Control](/dotnet/desktop/winforms/controls/how-to-edit-columns-and-rows-in-a-tablelayoutpanel-control) + +- [Walkthrough: Arranging Controls on Windows Forms Using a TableLayoutPanel](/dotnet/desktop/winforms/controls/walkthrough-arranging-controls-on-windows-forms-using-a-tablelayoutpanel) + + + +## Examples + The following code example demonstrates how to override the method to create a custom appearance for a cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: + ]]> - Best Practices for the TableLayoutPanel Control - AutoSize Behavior in the TableLayoutPanel Control - How to: Anchor and Dock Child Controls in a TableLayoutPanel Control - How to: Design a Windows Forms Layout that Responds Well to Localization - How to: Create a Resizable Windows Form for Data Entry + Best Practices for the TableLayoutPanel Control + AutoSize Behavior in the TableLayoutPanel Control + How to: Anchor and Dock Child Controls in a TableLayoutPanel Control + How to: Design a Windows Forms Layout that Responds Well to Localization + How to: Create a Resizable Windows Form for Data Entry @@ -169,11 +169,11 @@ Initializes a new instance of the class. - , , , and properties to their default values. - + , , , and properties to their default values. + ]]> @@ -256,18 +256,18 @@ Gets or sets the style of the cell borders. One of the values describing the style of all the cell borders in the table. The default is . - property depending on the selected . - +## Examples + The following code example sets the value of the property depending on the selected . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet6"::: + ]]> .NET 6 and later versions only: The property value is not valid for the enumeration type. @@ -308,21 +308,21 @@ Setting this value causes the panel to redraw itself and its contents. Occurs when the cell is redrawn. - 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 type named `TableLayoutPanel1`. Then 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 run the example code, paste it into a project that contains an instance of type named `TableLayoutPanel1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet561"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet561"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet561"::: + ]]> @@ -363,17 +363,17 @@ Setting this value causes the panel to redraw itself and its contents. Gets or sets the maximum number of columns allowed in the table. The maximum number of columns in the control. The default is 0. - property does not create columns or allocate any backing memory. Memory allocation occurs when the columns are created, so you can set this property to . - - Setting this property causes the table to undergo another layout operation. - You can specify both the and the properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the property allows for such growth. If the value of is 0, the panel will grow by adding rows, and if the value of is 0, the panel will grow by adding columns. Specifying panel growth with the property is preferred to setting or to 0, however. - - Controls can be added or deleted from the table using the property. - + Setting this property causes the table to undergo another layout operation. + + You can specify both the and the properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the property allows for such growth. If the value of is 0, the panel will grow by adding rows, and if the value of is 0, the panel will grow by adding columns. Specifying panel growth with the property is preferred to setting or to 0, however. + + Controls can be added or deleted from the table using the property. + ]]> @@ -430,32 +430,32 @@ Setting this value causes the panel to redraw itself and its contents. Gets a collection of column styles for the . A containing a for each column in the control. - property to access the style properties of specific columns. You can use members of the class to set the characteristics of individual columns in the table. - - When the control arranges its columns, it assigns priorities to each in the following order: - -1. Columns with set to are considered first, and their fixed widths are allocated. - -2. Columns with set to are sized to their contents. - -3. Remaining space is divided among columns with set to . - - - -## Examples - The following code example sets the properties of each column when a is clicked. - + property to access the style properties of specific columns. You can use members of the class to set the characteristics of individual columns in the table. + + When the control arranges its columns, it assigns priorities to each in the following order: + +1. Columns with set to are considered first, and their fixed widths are allocated. + +2. Columns with set to are sized to their contents. + +3. Remaining space is divided among columns with set to . + + + +## Examples + The following code example sets the properties of each column when a is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet8"::: + ]]> - AutoSize Behavior in the TableLayoutPanel Control + AutoSize Behavior in the TableLayoutPanel Control @@ -498,19 +498,19 @@ Setting this value causes the panel to redraw itself and its contents. Gets the collection of controls contained within the . A containing the controls associated with the current . - property contains all of the controls associated with the table, including controls that may not be currently displayed because of , , or limitations. - - - -## Examples - The following code example enumerates all the child controls in the . - + property contains all of the controls associated with the table, including controls that may not be currently displayed because of , , or limitations. + + + +## Examples + The following code example enumerates all the child controls in the . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet2"::: + ]]> @@ -654,25 +654,25 @@ Setting this value causes the panel to redraw itself and its contents. Returns the column position of the specified child control. The column position of the specified child control, or -1 if the position of is determined by . - method will return the lowest column index. - - The column position value is zero based, so you can use it as an index for the array returned by . - - This method is called by the `Column` property, which the panel adds to its child controls at design time. - - To get the actual position of `control`, even when its position is determined by , call the method. - - - -## Examples - The following code example enumerates all the child controls in the and finds the column index for each control using the method. - + method will return the lowest column index. + + The column position value is zero based, so you can use it as an index for the array returned by . + + This method is called by the `Column` property, which the panel adds to its child controls at design time. + + To get the actual position of `control`, even when its position is determined by , call the method. + + + +## Examples + The following code example enumerates all the child controls in the and finds the column index for each control using the method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet3"::: + ]]> @@ -724,21 +724,21 @@ Setting this value causes the panel to redraw itself and its contents. Returns the number of columns spanned by the specified child control. The number of columns spanned by the child control. The default is 1. - and methods to set the width of a control in a . - + and methods to set the width of a control in a . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]> @@ -819,19 +819,19 @@ Setting this value causes the panel to redraw itself and its contents. Returns the child control occupying the specified position. The child control occupying the specified cell; otherwise, if no control exists at the specified column and row, or if the control has its property set to . - by looping through the columns and rows given by and , and then calling the method to retrieve the control at each cell. - + by looping through the columns and rows given by and , and then calling the method to retrieve the control at each cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet5"::: + ]]> Either or (or both) is less than 0. @@ -870,11 +870,11 @@ Setting this value causes the panel to redraw itself and its contents. Gets the that represents the row and the column of the cell that contains the control. A that represents the cell position. - method returns the actual current position of `control`, even if its position is determined by the . This method takes into account the entire control state, including column or row spanning and when the has placed a control with its `Column` and `Row` properties set to -1. This is equivalent to the situation in which and return -1. - + method returns the actual current position of `control`, even if its position is determined by the . This method takes into account the entire control state, including column or row spanning and when the has placed a control with its `Column` and `Row` properties set to -1. This is equivalent to the situation in which and return -1. + ]]> @@ -927,25 +927,25 @@ Setting this value causes the panel to redraw itself and its contents. Returns the row position of the specified child control. The row position of , or -1 if the position of is determined by . - method will return the lowest row index. - - The row position value is zero based, so you can use it as an index for the array returned by . - - This method is called by the `Row` property, which the panel adds to its child controls at design time. - - To get the actual position of `control`, even when its position is determined by , call the method. - - - -## Examples - The following code example enumerates all the child controls in the and finds the row index for each using the method. - + method will return the lowest row index. + + The row position value is zero based, so you can use it as an index for the array returned by . + + This method is called by the `Row` property, which the panel adds to its child controls at design time. + + To get the actual position of `control`, even when its position is determined by , call the method. + + + +## Examples + The following code example enumerates all the child controls in the and finds the row index for each using the method. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet4"::: + ]]> @@ -1036,21 +1036,21 @@ Setting this value causes the panel to redraw itself and its contents. Returns the number of rows spanned by the specified child control. The number of rows spanned by the child control. The default is 1. - and methods to set the width of a control in a . - + and methods to set the width of a control in a . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]> @@ -1091,22 +1091,22 @@ Setting this value causes the panel to redraw itself and its contents. Gets or sets a value indicating whether the control should expand to accommodate new cells when all existing cells are occupied. A indicating the growth scheme. The default is . - control expands downward by adding rows. - + control expands downward by adding rows. + > [!NOTE] -> If an attempt is made to add a control to a full control, and the value of is , then an is thrown. - - - -## Examples - The following code example sets the value of the property depending on the selected . At run time, when the user clicks on the button labeled **Test GrowStyle**, a control is added to the control. If the control is full, it expands by adding a row or column, or it raises an exception, depending on the value of . - +> If an attempt is made to add a control to a full control, and the value of is , then an is thrown. + + + +## Examples + The following code example sets the value of the property depending on the selected . At run time, when the user clicks on the button labeled **Test GrowStyle**, a control is added to the control. If the control is full, it expands by adding a row or column, or it raises an exception, depending on the value of . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet7"::: + ]]> The property value is invalid for the enumeration. @@ -1228,14 +1228,14 @@ Setting this value causes the panel to redraw itself and its contents. A that provides data for the event. Receives a call when the cell should be refreshed. - method to create a custom appearance for a cell. - + method to create a custom appearance for a cell. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet100"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet100"::: + ]]> @@ -1275,11 +1275,11 @@ Setting this value causes the panel to redraw itself and its contents. A that contains the event data. Raises the event. - @@ -1351,17 +1351,17 @@ Setting this value causes the panel to redraw itself and its contents. Gets or sets the maximum number of rows allowed in the table. The maximum number of rows in the control. The default is 0. - property does not create rows or allocate any backing memory. Memory allocation occurs when the rows are created, so you can set this property to . - - Setting this property causes the table to undergo another layout operation. - You can specify both the and the properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the property allows for such growth. If the value of is 0, the panel will grow by adding rows, and if the value of is 0, the panel will grow by adding columns. Specifying panel growth with the property is preferred to setting or to 0, however. - - Controls can be added or deleted from the table using the property. - + Setting this property causes the table to undergo another layout operation. + + You can specify both the and the properties for layouts with a known and fixed number of cells. You can also specify one property or the other if you expect the number of cells in your layout to grow, assuming that the property allows for such growth. If the value of is 0, the panel will grow by adding rows, and if the value of is 0, the panel will grow by adding columns. Specifying panel growth with the property is preferred to setting or to 0, however. + + Controls can be added or deleted from the table using the property. + ]]> @@ -1418,32 +1418,32 @@ Setting this value causes the panel to redraw itself and its contents. Gets a collection of row styles for the . A containing a for each row in the control. - property to access the style properties of specific rows. You can use members of the class to set the characteristics of individual rows in the table. - - When the control arranges its rows, it assigns priorities to each in the following order: - -1. Rows with set to are considered first, and their fixed heights are allocated. - -2. Rows with set to are sized to their contents. - -3. Remaining space is divided among rows with set to . - - - -## Examples - The following code example sets the properties of each row when a is clicked. - + property to access the style properties of specific rows. You can use members of the class to set the characteristics of individual rows in the table. + + When the control arranges its rows, it assigns priorities to each in the following order: + +1. Rows with set to are considered first, and their fixed heights are allocated. + +2. Rows with set to are sized to their contents. + +3. Remaining space is divided among rows with set to . + + + +## Examples + The following code example sets the properties of each row when a is clicked. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet9"::: + ]]> - AutoSize Behavior in the TableLayoutPanel Control + AutoSize Behavior in the TableLayoutPanel Control @@ -1516,11 +1516,11 @@ Setting this value causes the panel to redraw itself and its contents. The ratio by which to scale the control vertically. Performs the work of scaling the entire panel and any child controls. - method uses the `dx` and `dy` parameter values to scale both the height and width of the panel independently. - + method uses the `dx` and `dy` parameter values to scale both the height and width of the panel independently. + ]]> @@ -1589,23 +1589,23 @@ Setting this value causes the panel to redraw itself and its contents. The column to which will be moved. Sets the column position of the specified child control. - method moves the control to another column in the . The columns and rows have zero-based indexes. Setting the column position to -1 specifies that the control will flow to the first empty cell. - - This method reapplies the table layout to all controls in the . - - This method is called by the `Column` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the method to swap two controls contained within a control. The example assumes a control with at least two rows. - + method moves the control to another column in the . The columns and rows have zero-based indexes. Setting the column position to -1 specifies that the control will flow to the first empty cell. + + This method reapplies the table layout to all controls in the . + + This method is called by the `Column` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the method to swap two controls contained within a control. The example assumes a control with at least two rows. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet12"::: + ]]> @@ -1644,21 +1644,21 @@ Setting this value causes the panel to redraw itself and its contents. The number of columns to span. Sets the number of columns spanned by the child control. - and methods to set the width of a control in a . - + and methods to set the width of a control in a . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]> @@ -1700,23 +1700,23 @@ Setting this value causes the panel to redraw itself and its contents. The row to which will be moved. Sets the row position of the specified child control. - method moves the control to another row in the control. The columns and rows have zero-based indexes. Setting the row position to -1 specifies that the control will flow to the first empty cell. - - This method reapplies the table layout to all controls in the . - - This method is called by the `Row` property, which the panel adds to its child controls at design time. - - - -## Examples - The following code example uses the method to swap two controls contained within a control. The example assumes a control with at least two rows. - + method moves the control to another row in the control. The columns and rows have zero-based indexes. Setting the row position to -1 specifies that the control will flow to the first empty cell. + + This method reapplies the table layout to all controls in the . + + This method is called by the `Row` property, which the panel adds to its child controls at design time. + + + +## Examples + The following code example uses the method to swap two controls contained within a control. The example assumes a control with at least two rows. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet13"::: + ]]> @@ -1755,21 +1755,21 @@ Setting this value causes the panel to redraw itself and its contents. The number of rows to span. Sets the number of rows spanned by the child control. - and methods to set the width of a control in a . - + and methods to set the width of a control in a . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ColumnStyle/Overview/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TableLayoutPanel/VB/form1.vb" id="Snippet11"::: + ]]> @@ -1814,11 +1814,11 @@ Setting this value causes the panel to redraw itself and its contents. if this object can provide extender properties to the specified object; otherwise, . - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml b/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml index 3ef22e689c9..b86eea3a342 100644 --- a/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml +++ b/xml/System.Windows.Forms/TableLayoutPanelCellPosition.xml @@ -37,14 +37,14 @@ Represents a cell in a . - to set the position of a child control in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + to set the position of a child control in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> @@ -78,14 +78,14 @@ The row position of the cell. Initializes a new instance of the class. - to set the position of a child control in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + to set the position of a child control in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/TableLayoutSettings.xml b/xml/System.Windows.Forms/TableLayoutSettings.xml index f17f55cb04a..98e6470ccc8 100644 --- a/xml/System.Windows.Forms/TableLayoutSettings.xml +++ b/xml/System.Windows.Forms/TableLayoutSettings.xml @@ -41,27 +41,27 @@ Collects the characteristics associated with table layouts. - class collects and manages the characteristics associated with the table layout scheme. This class is used internally by the and classes, as well as the table layout engine. The class is used by the layout engine to determine how to lay out the container's child controls. - - The class manages the following information: - -- The being used. - -- The maximum number of columns and rows in the layout. - -- The collection of styles used for the contained columns and rows. - - - -## Examples - The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + class collects and manages the characteristics associated with the table layout scheme. This class is used internally by the and classes, as well as the table layout engine. The class is used by the layout engine to determine how to lay out the container's child controls. + + The class manages the following information: + +- The being used. + +- The maximum number of columns and rows in the layout. + +- The collection of styles used for the contained columns and rows. + + + +## Examples + The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> @@ -102,21 +102,21 @@ Gets or sets the maximum number of columns allowed in the table layout. The maximum number of columns allowed in the table layout. The default is 0. - property does not create columns or allocate any backing memory. Memory allocation occurs when the columns are created, so you can set this property to . - - Setting this property causes the table to undergo another layout operation. - - - -## Examples - The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + + Setting this property causes the table to undergo another layout operation. + + + +## Examples + The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> The property value is less than 0. @@ -160,11 +160,11 @@ Gets the collection of styles used to determine the look and feel of the table layout columns. A that contains the column styles for the layout table. - property to access the style properties of specific columns. The order of the styles in a matches the order of the corresponding columns in the layout table. - + property to access the style properties of specific columns. The order of the styles in a matches the order of the corresponding columns in the layout table. + ]]> @@ -208,14 +208,14 @@ Gets the that represents the row and the column of the cell. A that represents the cell position. - object to get a cell position in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + object to get a cell position in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> @@ -403,11 +403,11 @@ Gets or sets a value indicating how the table layout should expand to accommodate new cells when all existing cells are occupied. One of the values. The default is . - property determines how the layout engine should add a new cell to a full table. This property can be set to to indicate that rows should be added, to indicate that columns should be added, or to disallow expansion. - + property determines how the layout engine should add a new cell to a full table. This property can be set to to indicate that rows should be added, to indicate that columns should be added, or to disallow expansion. + ]]> .NET Framework only: The property value is not valid for the enumeration type. @@ -449,15 +449,15 @@ Gets the current table layout engine. The currently being used. - property is typically used in two contexts: - -- A container that uses a table layout. - -- A control contained within a table layout container, such as a button contained in a cell of a . - + property is typically used in two contexts: + +- A container that uses a table layout. + +- A control contained within a table layout container, such as a button contained in a cell of a . + ]]> @@ -496,21 +496,21 @@ Gets or sets the maximum number of rows allowed in the table layout. The maximum number of rows allowed in the table layout. The default is 0. - property does not create rows or allocate any backing memory. Memory allocation occurs when the rows are created, so you can set this property to . - - Setting this property causes the table to undergo another layout operation. - - - -## Examples - The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + + Setting this property causes the table to undergo another layout operation. + + + +## Examples + The following example shows how to initialize a object for a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> The property value is less than 0. @@ -554,11 +554,11 @@ Gets the collection of styles used to determine the look and feel of the table layout rows. A that contains the row styles for the layout table. - property to access the style properties of specific rows. The order of the styles in a matches the order of the corresponding rows in the layout table. - + property to access the style properties of specific rows. The order of the styles in a matches the order of the corresponding rows in the layout table. + ]]> @@ -603,14 +603,14 @@ A that represents the cell position. Sets the that represents the row and the column of the cell. - object to set a cell position in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + object to set a cell position in a control. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet2"::: + ]]> @@ -804,11 +804,11 @@ The destination context of the serialization. For a description of this member, see . - instance is cast to an interface. - + instance is cast to an interface. + ]]> diff --git a/xml/System.Windows.Forms/TableLayoutStyle.xml b/xml/System.Windows.Forms/TableLayoutStyle.xml index cd6f3de777d..f94929d1600 100644 --- a/xml/System.Windows.Forms/TableLayoutStyle.xml +++ b/xml/System.Windows.Forms/TableLayoutStyle.xml @@ -37,13 +37,13 @@ Implements the basic functionality that represents the appearance and behavior of a table layout. - class is a common base class for the and classes, which describe the appearance and behavior of columns and rows, respectively, in a . - - The series of styles that represent the current columns and rows in the current table layout are aggregated in a and , respectively. - + class is a common base class for the and classes, which describe the appearance and behavior of columns and rows, respectively, in a . + + The series of styles that represent the current columns and rows in the current table layout are aggregated in a and , respectively. + ]]> @@ -52,7 +52,7 @@ - AutoSize Behavior in the TableLayoutPanel Control + AutoSize Behavior in the TableLayoutPanel Control @@ -83,11 +83,11 @@ Initializes a new instance of the class. - class. It effectively sets the property to . - + class. It effectively sets the property to . + ]]> @@ -128,21 +128,21 @@ Gets or sets a flag indicating how a row or column should be sized relative to its containing table. One of the values that specifies how rows or columns of user interface (UI) elements should be sized relative to their container. The default is . - ). - -- As a percentage of the parent container (). - -- To share equal space with its peers (). - + ). + +- As a percentage of the parent container (). + +- To share equal space with its peers (). + ]]> - AutoSize Behavior in the TableLayoutPanel Control + AutoSize Behavior in the TableLayoutPanel Control diff --git a/xml/System.Windows.Forms/TextBoxRenderer.xml b/xml/System.Windows.Forms/TextBoxRenderer.xml index 23ed0631a93..35221b67959 100644 --- a/xml/System.Windows.Forms/TextBoxRenderer.xml +++ b/xml/System.Windows.Forms/TextBoxRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a text box control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render a text box control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a text box, use one of the methods. These methods provide a variety of options, such as applying text formatting or specifying text bounds. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, will draw the text box with the current visual style. Otherwise, will throw an . To determine whether the members of this class can be used, you can check the value of the property. - - This class wraps the functionality of a that is set to one of the elements of the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the method to draw a text box. The control also allows the user to select one of the values to apply to the text box text. - + class provides a set of `static` methods that can be used to render a text box control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. To draw a text box, use one of the methods. These methods provide a variety of options, such as applying text formatting or specifying text bounds. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, will draw the text box with the current visual style. Otherwise, will throw an . To determine whether the members of this class can be used, you can check the value of the property. + + This class wraps the functionality of a that is set to one of the elements of the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the method to draw a text box. The control also allows the user to select one of the values to apply to the text box text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -99,21 +99,21 @@ One of the values that specifies the visual state of the text box. Draws a text box control in the specified state and bounds. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -168,21 +168,21 @@ One of the values that specifies the visual state of the text box. Draws a text box control in the specified state and bounds, and with the specified text. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -239,21 +239,21 @@ One of the values that specifies the visual state of the text box. Draws a text box control in the specified state and bounds, and with the specified text and text bounds. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -304,21 +304,21 @@ One of the values that specifies the visual state of the text box. Draws a text box control in the specified state and bounds, and with the specified text and text formatting. - property returns `true`. - + property returns `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -371,30 +371,30 @@ One of the values that specifies the visual state of the text box. Draws a text box control in the specified state and bounds, and with the specified text, text bounds, and text formatting. - property returns `true`. - - - -## Examples - The following code example demonstrates how to use the method in a custom control's method to draw a text box. This code example is part of a larger example provided for the class. - + property returns `true`. + + + +## Examples + The following code example demonstrates how to use the method in a custom control's method to draw a text box. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -425,20 +425,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, . - method will throw an . - - - -## Examples - The following code example uses the property to determine whether to use the method. This code example is part of a larger example provided for the class. - + method will throw an . + + + +## Examples + The following code example uses the property to determine whether to use the method. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextBoxRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextBoxRenderer/VB/form1.vb" id="Snippet2"::: + ]]> diff --git a/xml/System.Windows.Forms/TextFormatFlags.xml b/xml/System.Windows.Forms/TextFormatFlags.xml index 94761327274..4bfe84c16f2 100644 --- a/xml/System.Windows.Forms/TextFormatFlags.xml +++ b/xml/System.Windows.Forms/TextFormatFlags.xml @@ -28,22 +28,22 @@ Specifies the display and layout information for text strings. - when drawing and measuring text. The does not support adding tab stops to drawn text, although you can expand existing tab stops using the `ExpandTabs` flag. - - - -## Examples - The following example demonstrates how to use the `TextFormatFlags` enumeration. To run this example, paste the following code into a Windows Form. Call `RenderText6` from the form's event handler, passing `e` as . - + when drawing and measuring text. The does not support adding tab stops to drawn text, although you can expand existing tab stops using the `ExpandTabs` flag. + + + +## Examples + The following example demonstrates how to use the `TextFormatFlags` enumeration. To run this example, paste the following code into a Windows Form. Call `RenderText6` from the form's event handler, passing `e` as . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TextFormatFlags/Overview/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextRendererExamples/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TextRendererExamples/VB/Form1.vb" id="Snippet7"::: + ]]> - Using Fonts and Text + Using Fonts and Text diff --git a/xml/System.Windows.Forms/ToolStrip.xml b/xml/System.Windows.Forms/ToolStrip.xml index 70932ee8486..accc213546a 100644 --- a/xml/System.Windows.Forms/ToolStrip.xml +++ b/xml/System.Windows.Forms/ToolStrip.xml @@ -109,7 +109,7 @@ - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -334,7 +334,7 @@ - How to: Enable Reordering of ToolStrip Items at Run Time in Windows Forms + How to: Enable Reordering of ToolStrip Items at Run Time in Windows Forms @@ -965,7 +965,7 @@ ]]> - How to: Manage ToolStrip Overflow in Windows Forms + How to: Manage ToolStrip Overflow in Windows Forms @@ -1859,7 +1859,7 @@ ]]> - How to: Define Z-Ordering of Docked ToolStrip Controls + How to: Define Z-Ordering of Docked ToolStrip Controls @@ -2167,7 +2167,7 @@ Returns the item located at the specified point in the client area of the . The at the specified location, or if the is not found. To be added. - Windows Forms Coordinates + Windows Forms Coordinates @@ -4313,10 +4313,10 @@ When overriding in a derived class, be sure to call the base class's method so that registered delegates receive the event. - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms - How to: Set the ToolStrip Renderer at Run Time - How to: Set the ToolStrip Renderer for an Application - How to: Create a Professionally Styled ToolStrip Control + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How to: Set the ToolStrip Renderer at Run Time + How to: Set the ToolStrip Renderer for an Application + How to: Create a Professionally Styled ToolStrip Control @@ -4783,10 +4783,10 @@ ]]> - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms - How to: Set the ToolStrip Renderer at Run Time - How to: Set the ToolStrip Renderer for an Application - How to: Create a Professionally Styled ToolStrip Control + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How to: Set the ToolStrip Renderer at Run Time + How to: Set the ToolStrip Renderer for an Application + How to: Create a Professionally Styled ToolStrip Control @@ -4836,10 +4836,10 @@ ]]> - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms - How to: Set the ToolStrip Renderer at Run Time - How to: Set the ToolStrip Renderer for an Application - How to: Create a Professionally Styled ToolStrip Control + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How to: Set the ToolStrip Renderer at Run Time + How to: Set the ToolStrip Renderer for an Application + How to: Create a Professionally Styled ToolStrip Control @@ -4885,10 +4885,10 @@ is set to without the property being assigned to a new instance of . - How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms - How to: Set the ToolStrip Renderer at Run Time - How to: Set the ToolStrip Renderer for an Application - How to: Create a Professionally Styled ToolStrip Control + How To: Create and Set a Custom Renderer for the ToolStrip Control in Windows Forms + How to: Set the ToolStrip Renderer at Run Time + How to: Set the ToolStrip Renderer for an Application + How to: Create a Professionally Styled ToolStrip Control @@ -5333,7 +5333,7 @@ ]]> - How to: Use ToolTips in ToolStrip Controls + How to: Use ToolTips in ToolStrip Controls diff --git a/xml/System.Windows.Forms/ToolStripButton.xml b/xml/System.Windows.Forms/ToolStripButton.xml index 2030f0d0791..ea16df920c0 100644 --- a/xml/System.Windows.Forms/ToolStripButton.xml +++ b/xml/System.Windows.Forms/ToolStripButton.xml @@ -33,29 +33,29 @@ Represents a selectable that can contain text and images. - to create a toolbar button that supports both text and images. Use the and properties to get or set the positioning of images and text. - - You can display a with various border styles, and you can use it to represent and activate operational states. You can also define it to have the focus by default. - - Although replaces and extends the control of previous versions, is retained for both backward compatibility and future use. - - - -## Examples - The following code example shows two controls with both image and text on a . Clicking the **New** displays a message box. - + to create a toolbar button that supports both text and images. Use the and properties to get or set the positioning of images and text. + + You can display a with various border styles, and you can use it to represent and activate operational states. You can also define it to have the focus by default. + + Although replaces and extends the control of previous versions, is retained for both backward compatibility and future use. + + + +## Examples + The following code example shows two controls with both image and text on a . Clicking the **New** displays a message box. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripButton/vb/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripButton/vb/Form1.vb" id="Snippet1"::: + ]]> - MenuStrip Control (Windows Forms) - ToolStrip Control (Windows Forms) + MenuStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -118,11 +118,11 @@ The image to display on the . Initializes a new instance of the class that displays the specified image. - that displays only an image on the . - + that displays only an image on the . + ]]> @@ -154,11 +154,11 @@ The text to display on the . Initializes a new instance of the class that displays the specified text. - that displays only text on the . - + that displays only text on the . + ]]> @@ -192,11 +192,11 @@ The image to display on the . Initializes a new instance of the class that displays the specified text and image. - that displays both an image and text. - + that displays both an image and text. + ]]> @@ -232,11 +232,11 @@ An event handler that raises the event. Initializes a new instance of the class that displays the specified text and image and that raises the event. - that displays both an image and text and raises the event when clicked. - + that displays both an image and text and raises the event when clicked. + ]]> @@ -274,11 +274,11 @@ The name of the . Initializes a new instance of the class with the specified name that displays the specified text and image and that raises the event. - with the specified name that displays both an image and text and raises the event when clicked. - + with the specified name that displays both an image and text and raises the event when clicked. + ]]> @@ -316,19 +316,19 @@ if default text is displayed; otherwise, . The default is . - property to `false` to display custom on a . - - - -## Examples - The following code example turns off the automatic text for a and sets custom . - + property to `false` to display custom on a . + + + +## Examples + The following code example turns off the automatic text for a and sets custom . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStrip/ShowItemToolTips/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripToolTip/vb/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripToolTip/vb/Form1.vb" id="Snippet1"::: + ]]> @@ -392,15 +392,15 @@ if the is pressed in or not pressed in; otherwise, . The default is . - property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. - + property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]> @@ -431,20 +431,20 @@ Occurs when the value of the property changes. - property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. - + property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]> @@ -490,15 +490,15 @@ if the should automatically appear pressed in and not pressed in when clicked; otherwise, . The default is . - property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. - + property to `true` and uses the property in a event to change the font of the button text to bold when the button is clicked. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet50"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet50"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet50"::: + ]]> @@ -539,11 +539,11 @@ Gets or sets a value indicating whether the is in the pressed or not pressed state by default, or is in an indeterminate state. One of the values. The default is . - to `Indeterminate` when you do not want to set a default state. - + to `Indeterminate` when you do not want to set a default state. + ]]> The value assigned is not one of the values. @@ -575,21 +575,21 @@ 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 type named `ToolStripButton1`. Then 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 type named `ToolStripButton1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet568"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet568"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet568"::: + ]]> @@ -627,14 +627,14 @@ Creates a new accessibility object for the . A new for the . - , it will be called when the property is referenced. - + , 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. - +> To get or set the property, you must add a reference to the `Accessibility` assembly installed with the .NET Framework. + ]]> @@ -730,13 +730,13 @@ 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. + ]]> @@ -773,13 +773,13 @@ 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. + ]]> @@ -816,13 +816,13 @@ 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. + ]]> @@ -859,13 +859,13 @@ 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. + ]]> diff --git a/xml/System.Windows.Forms/ToolStripComboBox.xml b/xml/System.Windows.Forms/ToolStripComboBox.xml index 4bb6c344873..67f8c5a7908 100644 --- a/xml/System.Windows.Forms/ToolStripComboBox.xml +++ b/xml/System.Windows.Forms/ToolStripComboBox.xml @@ -37,31 +37,31 @@ Represents a that is properly rendered in a . - is the optimized for hosting in a . A subset of the hosted control's properties and events are exposed at the level, but the underlying control is fully accessible through the property. - - A displays an editing field combined with a , allowing the user to select from the list or to enter new text. By default, a displays an edit field with a hidden drop-down list. The property determines the style of combo box to display. You can enter a value that allows for a simple drop-down, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down list box, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a control. - - To add objects to the list at run time, assign an array of object references with the method. The list then displays the default string value for each object. You can add individual objects with the method. - - In addition to display and selection functionality, the also provides features that enable you to efficiently add items to the and to find text within the items of the list. The and methods enable you to add a large number of items to the without the control being repainted each time an item is added to the list. The and methods enable you to search for an item in the list that contains a specific search string. - - Use the property to get or set the current item in the drop-down list, and use the property to get or set a reference to the current item in the drop-down list. - - - -## Examples - The following code example demonstrates a with various property settings, including automatic completion. - + is the optimized for hosting in a . A subset of the hosted control's properties and events are exposed at the level, but the underlying control is fully accessible through the property. + + A displays an editing field combined with a , allowing the user to select from the list or to enter new text. By default, a displays an edit field with a hidden drop-down list. The property determines the style of combo box to display. You can enter a value that allows for a simple drop-down, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down list box, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a control. + + To add objects to the list at run time, assign an array of object references with the method. The list then displays the default string value for each object. You can add individual objects with the method. + + In addition to display and selection functionality, the also provides features that enable you to efficiently add items to the and to find text within the items of the list. The and methods enable you to add a large number of items to the without the control being repainted each time an item is added to the list. The and methods enable you to search for an item in the list that contains a specific search string. + + Use the property to get or set the current item in the drop-down list, and use the property to get or set a reference to the current item in the drop-down list. + + + +## Examples + The following code example demonstrates a with various property settings, including automatic completion. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]> - ToolStrip Technology Summary - ToolStrip Control Architecture + ToolStrip Technology Summary + ToolStrip Control Architecture @@ -217,23 +217,23 @@ Gets or sets the custom string collection to use when the property is set to . An that contains the strings. - , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the property is optional, but you must set the property to in order to use . - - You must use the and properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the property is optional, but you must set the property to in order to use . + + You must use the and properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -280,19 +280,19 @@ Gets or sets a value that indicates the text completion behavior of the . One of the values. The default is . - property to get or set the behavior of automatic completion. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property to get or set the behavior of automatic completion. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -339,19 +339,19 @@ Gets or sets the source of complete strings used for automatic completion. One of the values. The default is . - property to get or set automatic completion strings. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property to get or set automatic completion strings. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -407,11 +407,11 @@ This property is not relevant to this class. The background image displayed in the control. - @@ -460,11 +460,11 @@ This property is not relevant to this class. One of the values of . - @@ -495,13 +495,13 @@ Maintains performance when items are added to the one at a time. - method is called. - - The preferred way to add items to the is to use the method through the property of the . This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the method, you can use the method to prevent the control from repainting the each time an item is added to the list. Once you have completed the task of adding items to the list, call the method to enable the to repaint. This way of adding items can prevent flicker during the drawing of the when a large number of items are being added to the list. - + method is called. + + The preferred way to add items to the is to use the method through the property of the . This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the method, you can use the method to prevent the control from repainting the each time an item is added to the list. Once you have completed the task of adding items to the list, call the method to enable the to repaint. This way of adding items can prevent flicker during the drawing of the when a large number of items are being added to the list. + ]]> @@ -546,11 +546,11 @@ Gets a in which the user can enter text, along with a list from which the user can select. A for a . - property to get properties, methods, and events that have not been wrapped into . - + property to get properties, methods, and events that have not been wrapped into . + ]]> @@ -603,11 +603,11 @@ Gets the default spacing, in pixels, between the and an adjacent item. A value. - property to configure a default size for your . This is more efficient than setting the size in the constructor. - + property to configure a default size for your . This is more efficient than setting the size in the constructor. + ]]> @@ -638,13 +638,13 @@ Gets the default size of the . The default of the in pixels. The default size is 100 x 20 pixels. - [!NOTE] -> In order to maintain better performance, you should not set the of a in its constructor. The preferred method is to override the property. - +> In order to maintain better performance, you should not set the of a in its constructor. The preferred method is to override the property. + ]]> @@ -692,11 +692,11 @@ This event is not relevant to this class. - @@ -733,21 +733,21 @@ Occurs when the drop-down portion of a is shown. - 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 type named `ToolStripComboBox1`. Then 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 type named `ToolStripComboBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet578"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet578"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet578"::: + ]]> @@ -784,21 +784,21 @@ Occurs when the drop-down portion of the has closed. - 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 type named `ToolStripComboBox1`. Then 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 type named `ToolStripComboBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet579"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet579"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet579"::: + ]]> @@ -843,19 +843,19 @@ Gets or sets the height, in pixels, of the drop-down portion box of a . The height, in pixels, of the drop-down box. - property resets the property to `false`. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property resets the property to `false`. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -900,19 +900,19 @@ Gets or sets a value specifying the style of the . One of the values. The default is . - property controls the interface that is presented to the user. You can enter a value that allows for a simple drop-down list box, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a control. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property controls the interface that is presented to the user. You can enter a value that allows for a simple drop-down list box, where the list always displays, a drop-down list box, where the text portion is not editable and you must select an arrow to view the drop-down, or the default drop-down list box, where the text portion is editable and the user must press the arrow key to view the list. To always display a list that the user cannot edit, use a control. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -949,21 +949,21 @@ Occurs when the property has changed. - 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 type named `ToolStripComboBox1`. Then 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 type named `ToolStripComboBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet580"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet580"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet580"::: + ]]> @@ -994,19 +994,19 @@ Gets or sets the width, in pixels, of the drop-down portion of a . The width, in pixels, of the drop-down box. - property to get or set the width of the drop-down portion of a . - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property to get or set the width of the drop-down portion of a . + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1080,11 +1080,11 @@ Resumes painting the control after painting is suspended by the method. - is to use the method through the property of the . This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the method, you can use the method to prevent the control from repainting the each time an item is added to the list. Once you have completed the task of adding items to the list, call the method to enable the to repaint. This way of adding items can prevent flicker during the drawing of the when a large number of items are being added to the list. - + is to use the method through the property of the . This enables you to add an array of items to the list at one time. However, if you want to add items one at a time using the method, you can use the method to prevent the control from repainting the each time an item is added to the list. Once you have completed the task of adding items to the list, call the method to enable the to repaint. This way of adding items can prevent flicker during the drawing of the when a large number of items are being added to the list. + ]]> @@ -1129,11 +1129,11 @@ Finds the first item in the that starts with the specified string. The zero-based index of the first item found; returns -1 if no match is found. - , use method to specify a starting index within the . If you want to perform a search for an exact word match instead of a partial match, use the method. - + , use method to specify a starting index within the . If you want to perform a search for an exact word match instead of a partial match, use the method. + ]]> @@ -1171,11 +1171,11 @@ Finds the first item after the given index which starts with the given string. The zero-based index of the first item found; returns -1 if no match is found. - , use this method to specify a starting index within the . If you want to perform a search for an exact word match instead of a partial match, use the method. - + , use this method to specify a starting index within the . If you want to perform a search for an exact word match instead of a partial match, use the method. + ]]> @@ -1220,11 +1220,11 @@ Finds the first item in the that exactly matches the specified string. The zero-based index of the first item found; -1 if no match is found. - , use method to specify a starting index within the . If you want to search for a partial match instead of the exact word, use the method. - + , use method to specify a starting index within the . If you want to search for a partial match instead of the exact word, use the method. + ]]> @@ -1262,11 +1262,11 @@ Finds the first item after the specified index that exactly matches the specified string. The zero-based index of the first item found; returns -1 if no match is found. - , use this method to specify a starting index within the . If you want to search for a partial match instead of the exact word, use the method. - + , use this method to specify a starting index within the . If you want to search for a partial match instead of the exact word, use the method. + ]]> @@ -1307,27 +1307,27 @@ Gets or sets the appearance of the . One of the values of . The options are , , , and . The default is . - property to get or set the display style of the . - - Starting with the .NET Framework 4.5.2, if the property is set to or , the drop-down arrow may be resized. Resizing is determined by the system DPI setting when the app.config file contains the following entry: - -``` - -  - -``` - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property to get or set the display style of the . + + Starting with the .NET Framework 4.5.2, if the property is set to or , the drop-down arrow may be resized. Resizing is determined by the system DPI setting when the app.config file contains the following entry: + +``` + +  + +``` + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1433,13 +1433,13 @@ if the list portion can contain only complete items; otherwise, . The default is . - based on the space requirements of your form, set this property to `false`. If the does not contain any items, this property has no effect. - - Setting the property resets the property to `false`. - + based on the space requirements of your form, set this property to `false`. If the does not contain any items, this property has no effect. + + Setting the property resets the property to `false`. + ]]> @@ -1530,19 +1530,19 @@ Gets or sets the maximum number of items to be shown in the drop-down portion of the . The maximum number of items in the drop-down portion. The minimum for this property is 1 and the maximum is 100. - property to get or set the maximum number of items to show in the drop-down portion of the . - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + property to get or set the maximum number of items to show in the drop-down portion of the . + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1614,13 +1614,13 @@ 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. + ]]> @@ -1657,13 +1657,13 @@ 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. + ]]> @@ -1700,13 +1700,13 @@ 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. + ]]> @@ -1743,13 +1743,13 @@ 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. + ]]> @@ -1786,15 +1786,15 @@ An that contains the event data. Raises the event. - is raised only when the user changes the combo box selection. Do not use or to capture user changes, because those events are also raised when the selection changes programmatically. This event is also raised when you set . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + is raised only when the user changes the combo box selection. Do not use or to capture user changes, because those events are also raised when the selection changes programmatically. This event is also raised when you set . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1832,17 +1832,17 @@ The control from which to subscribe events. Subscribes events from the specified control. - method to add or prevent the synchronizing of control events. - - If you override and hook up events here, unhook them by using the method. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 to add or prevent the synchronizing of control events. + + If you override and hook up events here, unhook them by using the method. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1879,13 +1879,13 @@ 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. + ]]> @@ -1923,15 +1923,15 @@ The control from which to unsubscribe events. Unsubscribes events from the specified control. - method to unsubscribe events subscribed in . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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 to unsubscribe events subscribed in . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1970,17 +1970,17 @@ The number of characters to select. Selects a range of text in the editable portion of the . - - The is less than zero. - - -or- - + The is less than zero. + + -or- + minus is less than zero. @@ -2052,13 +2052,13 @@ Gets or sets the index specifying the currently selected item. A zero-based index of the currently selected item. A value of negative one (-1) is returned if no item is selected. - event. - - **Note** To deselect the currently selected item, set the to -1. - + event. + + **Note** To deselect the currently selected item, set the to -1. + ]]> @@ -2095,21 +2095,21 @@ Occurs when the value of the property has changed. - 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 type named `ToolStripComboBox1`. Then 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 type named `ToolStripComboBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet581"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet581"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet581"::: + ]]> @@ -2163,11 +2163,11 @@ Gets or sets currently selected item in the . The object that is the currently selected item or if there is no currently selected item. - property to an object, the attempts to make that object the currently selected one in the list. If the object is found in the list, it is displayed in the edit portion of the and the property is set to the corresponding index. If the object does not exist in the list, the property is left at its current value. - + property to an object, the attempts to make that object the currently selected one in the list. If the object is found in the list, it is displayed in the edit portion of the and the property is set to the corresponding index. If the object does not exist in the list, the property is left at its current value. + ]]> @@ -2212,11 +2212,11 @@ Gets or sets the text that is selected in the editable portion of a . A string that represents the currently selected text in the combo box. If is set to , the return value is an empty string (""). - @@ -2261,11 +2261,11 @@ Gets or sets the number of characters selected in the editable portion of the . The number of characters selected in the . - property is set to a value that is larger than the number of characters within the text of the control, the value of the property is set to the entire length of text within the control minus the value of the property (if any value is specified for the property). - + property is set to a value that is larger than the number of characters within the text of the control, the value of the property is set to the entire length of text within the control minus the value of the property (if any value is specified for the property). + ]]> @@ -2310,11 +2310,11 @@ Gets or sets the starting index of text selected in the . The zero-based index of the first character in the string of the current text selection. - property. If the remaining text in the control after the position indicated by the property is less than the value of the property, the value of the property is automatically decreased. The value of the property never causes an increase in the property. - + property. If the remaining text in the control after the position indicated by the property is less than the value of the property, the value of the property is automatically decreased. The value of the property never causes an increase in the property. + ]]> @@ -2352,19 +2352,19 @@ if the combo box is sorted; otherwise, . The default is . - sorts existing entries and add new entries to the appropriate sorted position in the list. You can use this property to automatically sort items in a . As items are added to a sorted , the items are moved to the appropriate location in the sorted list. When you set the property to `false`, new items are added to the end of the existing list. The sort is case-insensitive and in alphabetically ascending order. - - - -## Examples - The following code example demonstrates the syntax for setting various properties, including the property. - + sorts existing entries and add new entries to the appropriate sorted position in the list. You can use this property to automatically sort items in a . As items are added to a sorted , the items are moved to the appropriate location in the sorted list. When you set the property to `false`, new items are added to the end of the existing list. The sort is case-insensitive and in alphabetically ascending order. + + + +## Examples + The following code example demonstrates the syntax for setting various properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripComboBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripComboBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2401,21 +2401,21 @@ Occurs when the text has changed. - 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 type named `ToolStripComboBox1`. Then 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 type named `ToolStripComboBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet582"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet582"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet582"::: + ]]> diff --git a/xml/System.Windows.Forms/ToolStripContainer.xml b/xml/System.Windows.Forms/ToolStripContainer.xml index d3b0eb6878e..3eff9dc6e68 100644 --- a/xml/System.Windows.Forms/ToolStripContainer.xml +++ b/xml/System.Windows.Forms/ToolStripContainer.xml @@ -45,27 +45,27 @@ Provides panels on each side of the form and a central panel that can hold one or more controls. - is similar to . It uses four docked side panels (instances of ) and one central panel (an instance of ) to create a typical arrangement. You cannot remove the side panels, but you can hide them by setting their respective , , , and properties to `false`. By default, each of these properties is `true` at design time. Also at design time, the appears with its top panel already expanded. You can neither remove nor hide the . You can arrange one or more , , or controls in the side panels, and you can use the central panel for other controls. The also provides a way to get renderer support into the body of your form for a consistent appearance. - - does not support Multiple Document Interface (MDI) applications. Use for MDI applications. - - - -## Examples - The following code example demonstrates adding a and a to a Windows Forms, adding items to the , and adding the to the of the . - + is similar to . It uses four docked side panels (instances of ) and one central panel (an instance of ) to create a typical arrangement. You cannot remove the side panels, but you can hide them by setting their respective , , , and properties to `false`. By default, each of these properties is `true` at design time. Also at design time, the appears with its top panel already expanded. You can neither remove nor hide the . You can arrange one or more , , or controls in the side panels, and you can use the central panel for other controls. The also provides a way to get renderer support into the body of your form for a consistent appearance. + + does not support Multiple Document Interface (MDI) applications. Use for MDI applications. + + + +## Examples + The following code example demonstrates adding a and a to a Windows Forms, adding items to the , and adding the to the of the . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStrip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/system.windows.forms.toolstripcontainer2/vb/form1.vb" id="Snippet1"::: + ]]> - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -137,11 +137,11 @@ to enable automatic scrolling; otherwise, . - @@ -190,11 +190,11 @@ This property is not relevant for this class. A value. - @@ -243,11 +243,11 @@ This property is not relevant for this class. A value. - @@ -296,11 +296,11 @@ This property is not relevant for this class. A value. - @@ -349,11 +349,11 @@ This event is not relevant for this class. - @@ -403,11 +403,11 @@ This property is not relevant for this class. TTThe background image displayed in the control. - @@ -456,11 +456,11 @@ This event is not relevant for this class. - @@ -509,11 +509,11 @@ This property is not relevant for this class. The background image layout as defined in the ImageLayout enumeration. - @@ -562,11 +562,11 @@ This event is not relevant for this class. - @@ -619,11 +619,11 @@ Gets the bottom panel of the . A representing the bottom panel of the . - property to add , , or controls or move them from another . - + property to add , , or controls or move them from another . + ]]> @@ -661,11 +661,11 @@ if the bottom panel of the is visible; otherwise, . The default is . - property to `false` to use a without a bottom panel. - + property to `false` to use a without a bottom panel. + ]]> @@ -715,11 +715,11 @@ if the control causes validation; otherwise, . - @@ -760,11 +760,11 @@ Occurs when the value of the property changes. - @@ -817,11 +817,11 @@ Gets the center panel of the . A representing the center panel of the . - to hold , , or controls. Controls other than , , or are automatically added to the . - + to hold , , or controls. Controls other than , , or are automatically added to the . + ]]> @@ -871,11 +871,11 @@ This property is not relevant for this class. The ContextMenuStrip associated with this control. - @@ -916,11 +916,11 @@ Occurs when the value of the property changes. - @@ -969,11 +969,11 @@ This property is not relevant for this class. The collection of controls contained within the control. - @@ -1086,11 +1086,11 @@ This property is not relevant for this class. The cursor that is displayed when the mouse pointer is over the control. - @@ -1139,11 +1139,11 @@ This event is not relevant for this class. - @@ -1220,11 +1220,11 @@ This property is not relevant for this class. The foreground color of the control. - @@ -1273,11 +1273,11 @@ This event is not relevant for this class. - @@ -1330,11 +1330,11 @@ Gets the left panel of the . A representing the left panel of the . - property to add , , or controls or move them from another . - + property to add , , or controls or move them from another . + ]]> @@ -1372,11 +1372,11 @@ if the left panel of the is visible; otherwise, . The default is . - property to `false` to use a without a left panel. - + property to `false` to use a without a left panel. + ]]> @@ -1441,13 +1441,13 @@ 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. + ]]> @@ -1503,11 +1503,11 @@ Gets the right panel of the . A representing the right panel of the . - property to add , , or controls or move them from another . - + property to add , , or controls or move them from another . + ]]> @@ -1545,11 +1545,11 @@ if the right panel of the is visible; otherwise, . The default is . - property to `false` to use a without a right panel. - + property to `false` to use a without a right panel. + ]]> @@ -1602,11 +1602,11 @@ Gets the top panel of the . A representing the top panel of the . - property to add , , or controls or move them from another . - + property to add , , or controls or move them from another . + ]]> @@ -1644,11 +1644,11 @@ if the top panel of the is visible; otherwise, . The default is . - property to `false` to use a without a top panel. - + property to `false` to use a without a top panel. + ]]> diff --git a/xml/System.Windows.Forms/ToolStripContentPanel.xml b/xml/System.Windows.Forms/ToolStripContentPanel.xml index 0701b1d5b22..79db69591a3 100644 --- a/xml/System.Windows.Forms/ToolStripContentPanel.xml +++ b/xml/System.Windows.Forms/ToolStripContentPanel.xml @@ -61,24 +61,24 @@ Represents the center panel of a control. - to hold , , or controls. Use the to hold controls other than these. - - - -## Examples - The following code example demonstrates adding a to a . - + to hold , , or controls. Use the to hold controls other than these. + + + +## Examples + The following code example demonstrates adding a to a . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripContentPanel/Overview/Form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripContainer/VB/Form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripContainer/VB/Form1.vb" id="Snippet1"::: + ]]> - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -149,11 +149,11 @@ This property is not relevant to this class. The edges of the container to which a control is bound and determines how a control is resized with its parent. - @@ -195,11 +195,11 @@ to enable automatic scrolling; otherwise, . - @@ -248,11 +248,11 @@ This property is not relevant to this class. The distance between any child controls and the edges of the scrollable parent control. - @@ -301,11 +301,11 @@ This property is not relevant to this class. The minimum size of the auto-scroll. - @@ -355,11 +355,11 @@ to enable automatic sizing; otherwise, . - @@ -408,11 +408,11 @@ This event is not relevant to this class. - @@ -465,11 +465,11 @@ This property is not relevant to this class. The mode by which the content panel automatically resizes itself. - @@ -547,11 +547,11 @@ if the control causes validation; otherwise, . - @@ -592,11 +592,11 @@ This event is not relevant for this class. - @@ -645,11 +645,11 @@ This property is not relevant to this class. One of the values. - @@ -698,11 +698,11 @@ This event is not relevant to this class. - @@ -733,21 +733,21 @@ Occurs when the content panel loads. - 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 type named `ToolStripContentPanel1`. Then 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 type named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet604"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet604"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet604"::: + ]]> @@ -796,11 +796,11 @@ This property is not relevant to this class. The coordinates of the upper-left corner of the control relative to the upper-left corner of its container. - @@ -849,11 +849,11 @@ This event is not relevant to this class. - @@ -902,11 +902,11 @@ This property is not relevant to this class. The size that is the upper limit that GetPreferredSize can specify. - @@ -955,11 +955,11 @@ This property is not relevant to this class. The size that is the lower limit that GetPreferredSize can specify. - @@ -1012,11 +1012,11 @@ This property is not relevant to this class. The name of the control. - @@ -1088,13 +1088,13 @@ 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. + ]]> @@ -1137,15 +1137,15 @@ A that contains the event data. Renders the . - , which contains all the information necessary to render the . - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + , which contains all the information necessary to render the . + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> @@ -1182,13 +1182,13 @@ 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. + ]]> @@ -1268,21 +1268,21 @@ 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 type named `ToolStripContentPanel1`. Then 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 type named `ToolStripContentPanel1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet605"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet605"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet605"::: + ]]> @@ -1359,11 +1359,11 @@ This property is not relevant to this class. The tab order of the control within its container. - @@ -1404,11 +1404,11 @@ This event is not relevant for this class. - @@ -1458,11 +1458,11 @@ if the can be tabbed to; otherwise, . - @@ -1503,11 +1503,11 @@ This event is not relevant for this class. - diff --git a/xml/System.Windows.Forms/ToolStripControlHost.xml b/xml/System.Windows.Forms/ToolStripControlHost.xml index 04a1e4851b8..e4ec8827f0f 100644 --- a/xml/System.Windows.Forms/ToolStripControlHost.xml +++ b/xml/System.Windows.Forms/ToolStripControlHost.xml @@ -53,8 +53,8 @@ ]]> - ToolStrip Control (Windows Forms) - How To: Wrap a Windows Forms Control with ToolStripControlHost + ToolStrip Control (Windows Forms) + How To: Wrap a Windows Forms Control with ToolStripControlHost diff --git a/xml/System.Windows.Forms/ToolStripDropDown.xml b/xml/System.Windows.Forms/ToolStripDropDown.xml index 14bad68ddd5..d21ece2eae1 100644 --- a/xml/System.Windows.Forms/ToolStripDropDown.xml +++ b/xml/System.Windows.Forms/ToolStripDropDown.xml @@ -70,7 +70,7 @@ Use the to display drop-down lists - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) diff --git a/xml/System.Windows.Forms/ToolStripDropDownButton.xml b/xml/System.Windows.Forms/ToolStripDropDownButton.xml index d9f8e9859c2..3838aeececd 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownButton.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownButton.xml @@ -33,26 +33,26 @@ Represents a control that when clicked displays an associated from which the user can select a single item. - looks like , but it shows a drop-down area when the user clicks it. Hide or show the drop-down arrow by setting the property. hosts a that displays items that overflow the . - - Use the to activate familiar drop-down controls such as color pickers. Set the property to `true` to more clearly indicate to the user that further options are available on the drop-down list. - - - -## Examples - The following code example displays three controls when the is clicked. The buttons change the foreground color of the form. - + looks like , but it shows a drop-down area when the user clicks it. Hide or show the drop-down arrow by setting the property. hosts a that displays items that overflow the . + + Use the to activate familiar drop-down controls such as color pickers. Set the property to `true` to more clearly indicate to the user that further options are available on the drop-down list. + + + +## Examples + The following code example displays three controls when the is clicked. The buttons change the foreground color of the form. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]> - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -86,15 +86,15 @@ Initializes a new instance of the class. - control. - + control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]> @@ -361,14 +361,14 @@ Creates a new accessibility object for this instance. A new accessibility object for this instance. - instance returned by this method supports the UI Automation expand/collapse pattern. +However, it's only available in applications that are running on the .NET Framework 4.7.1 or later versions and are either recompiled to target the .NET Framework 4.7.1 or opt in to this .NET Framework accessibility enhancements by using an AppCompat switch. +For more information, see the [migration guide](/dotnet/framework/migration-guide/retargeting/4.7-4.7.1#windows-forms). -The instance returned by this method supports the UI Automation expand/collapse pattern. -However, it's only available in applications that are running on the .NET Framework 4.7.1 or later versions and are either recompiled to target the .NET Framework 4.7.1 or opt in to this .NET Framework accessibility enhancements by using an AppCompat switch. -For more information, see the [migration guide](/dotnet/framework/migration-guide/retargeting/4.7-4.7.1#windows-forms). - ]]> @@ -460,13 +460,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid 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. + ]]> @@ -503,13 +503,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid 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. + ]]> @@ -577,13 +577,13 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid 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. + ]]> @@ -661,15 +661,15 @@ For more information, see the [migration guide](/dotnet/framework/migration-guid to show an arrow on the ; otherwise, . The default is . - control. The property is set to `false`. - + control. The property is set to `false`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripButton/Checked/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip1/VB/form1.vb" id="Snippet5"::: + ]]> diff --git a/xml/System.Windows.Forms/ToolStripDropDownItem.xml b/xml/System.Windows.Forms/ToolStripDropDownItem.xml index 41fe39810eb..b27881f210b 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownItem.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownItem.xml @@ -56,9 +56,9 @@ ]]> - MenuStrip Control (Windows Forms) - ToolStrip Control (Windows Forms) - How To: Insert a MenuStrip into an MDI Drop-Down Menu (Windows Forms) + MenuStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) + How To: Insert a MenuStrip into an MDI Drop-Down Menu (Windows Forms) @@ -585,7 +585,7 @@ ## Examples - The following code example demonstrates how to use the property to create a menu with sub-menus. For the complete code example, see [How to: Display Option Buttons in a MenuStrip](/dotnet/framework/winforms/controls/how-to-display-option-buttons-in-a-menustrip-windows-forms). + The following code example demonstrates how to use the property to create a menu with sub-menus. For the complete code example, see [How to: Display Option Buttons in a MenuStrip](/dotnet/desktop/winforms/controls/how-to-display-option-buttons-in-a-menustrip-windows-forms). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripDropDownItem/DropDownItems/ToolStripRadioButtonMenuItem.cs" id="Snippet200"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolStripRadioButtonMenuItem/vb/ToolStripRadioButtonMenuItem.vb" id="Snippet200"::: diff --git a/xml/System.Windows.Forms/ToolStripDropDownMenu.xml b/xml/System.Windows.Forms/ToolStripDropDownMenu.xml index d80b7f0a7c5..092f098f247 100644 --- a/xml/System.Windows.Forms/ToolStripDropDownMenu.xml +++ b/xml/System.Windows.Forms/ToolStripDropDownMenu.xml @@ -45,30 +45,30 @@ Provides basic functionality for the control. - is the base class for , providing necessary painting and layout properties and methods. The properties of this class that you are most likely to use directly are the and properties, which determine whether the shortcut menu will be able to display a check mark, an image, or both. - + and replace and extend the control, which was removed in .NET Core 3.1. -## Examples - The following code example demonstrates how to create and initialize a control by setting the check and image margins. - +## Examples + The following code example demonstrates how to create and initialize a control by setting the check and image margins. + > [!IMPORTANT] -> This code is not a complete sample, so it won't compile. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). - +> This code is not a complete sample, so it won't compile. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]> - ToolStrip Control Overview (Windows Forms) - ToolStrip Control Architecture - ToolStrip Technology Summary - How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls + ToolStrip Control Overview (Windows Forms) + ToolStrip Control Architecture + ToolStrip Technology Summary + How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls @@ -93,14 +93,14 @@ Initializes a new instance of the class. - control. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). - + control. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet62"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet62"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet62"::: + ]]> @@ -165,11 +165,11 @@ Creates a default with the specified text, image, and event handler on a new . A , or a if the parameter is a hyphen (-). - method to add a with commonly used characteristics to a . - + method to add a with commonly used characteristics to a . + ]]> @@ -298,11 +298,11 @@ Gets or sets a value indicating how the items of are displayed. One of the values. The default is . - items flow horizontally or vertically as necessary. See the enumeration for the other possibilities. - + items flow horizontally or vertically as necessary. See the enumeration for the other possibilities. + ]]> @@ -364,13 +364,13 @@ 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. + ]]> @@ -407,13 +407,13 @@ 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. + ]]> @@ -514,21 +514,21 @@ if the check margin is shown; otherwise, . The default is . - property to `true` to display a check mark when the user chooses the . -## Examples - The following code example demonstrates how to create and initialize a control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). - +## Examples + The following code example demonstrates how to create and initialize a control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]> - How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls + How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls @@ -564,21 +564,21 @@ if the image margin is shown; otherwise, . The default is . - property to `true` to display a graphic image with the . -## Examples - The following code example demonstrates how to create and initialize a control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/framework/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). - +## Examples + The following code example demonstrates how to create and initialize a control by setting the check and image margins. For a full code listing, see [How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls](/dotnet/desktop/winforms/controls/how-to-enable-check-margins-and-image-margins-in-contextmenustrip-controls). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ContextMenuStrip/Overview/Program.cs" id="Snippet61"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.Misc/VB/Program.vb" id="Snippet61"::: + ]]> - How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls + How to: Enable Check Margins and Image Margins in ContextMenuStrip Controls diff --git a/xml/System.Windows.Forms/ToolStripItem.xml b/xml/System.Windows.Forms/ToolStripItem.xml index de5e6b553fd..e5a25ae8a3b 100644 --- a/xml/System.Windows.Forms/ToolStripItem.xml +++ b/xml/System.Windows.Forms/ToolStripItem.xml @@ -112,7 +112,7 @@ - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) @@ -7748,7 +7748,7 @@ If you set the property, t uses the property as the default source for the content. Set to `false` to use as the source for content. diff --git a/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml b/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml index 24648ba0efc..49e6f02ef41 100644 --- a/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml +++ b/xml/System.Windows.Forms/ToolStripItemRenderEventArgs.xml @@ -29,53 +29,53 @@ Provides data for the events that render the background of objects derived from in the class. - class provides data for the following events: - -- - -- - -- - -- - -- - -- - -- - - In addition, it provides data for the following methods: - -- - -- - -- - -- - -- - -- - + class provides data for the following events: + +- + +- + +- + +- + +- + +- + +- + + In addition, it provides data for the following methods: + +- + +- + +- + +- + +- + +- + - - -## Examples - The following code example demonstrates how to override the method to draw a border around a control's . This code example is part of a larger example provided for the class. - + +## Examples + The following code example demonstrates how to override the method to draw a border around a control's . This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -148,20 +148,20 @@ Gets the graphics used to paint the . The used to paint the . - method to draw a border around a control's . This code example is part of a larger example provided for the class. - + method to draw a border around a control's . This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -196,20 +196,20 @@ Gets the to paint. The to paint. - method to draw a border around a control's . This code example is part of a larger example provided for the class. - + method to draw a border around a control's . This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -245,25 +245,25 @@ Gets the value of the property for the to paint. The that is the owner of the . - is in the overflow area of the , the property returns an empty string. - - - -## Examples - The following code example demonstrates how to override the method to draw a border around a control's . This code example is part of a larger example provided for the class. - + is in the overflow area of the , the property returns an empty string. + + + +## Examples + The following code example demonstrates how to override the method to draw a border around a control's . This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer diff --git a/xml/System.Windows.Forms/ToolStripLabel.xml b/xml/System.Windows.Forms/ToolStripLabel.xml index b563b5c141b..f9d0a5298fd 100644 --- a/xml/System.Windows.Forms/ToolStripLabel.xml +++ b/xml/System.Windows.Forms/ToolStripLabel.xml @@ -33,30 +33,30 @@ Represents a nonselectable that renders text and images and can display hyperlinks. - class to create a label that can render text and images that can implement the and properties. The also has many properties that enable it to display one or more hyperlinks, and other properties that modify the appearance and behavior of hyperlinks. - - The is like a that does not get focus by default and that does not render as pushed or highlighted. - - as a hosted item supports access keys. - - Use the , , and properties on a to support link control in a . - - - -## Examples - The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. - + class to create a label that can render text and images that can implement the and properties. The also has many properties that enable it to display one or more hyperlinks, and other properties that modify the appearance and behavior of hyperlinks. + + The is like a that does not get focus by default and that does not render as pushed or highlighted. + + as a hosted item supports access keys. + + Use the , , and properties on a to support link control in a . + + + +## Examples + The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> - ToolStrip Control Overview (Windows Forms) - ToolStrip Control Architecture - ToolStrip Technology Summary + ToolStrip Control Overview (Windows Forms) + ToolStrip Control Architecture + ToolStrip Technology Summary @@ -327,24 +327,24 @@ Gets or sets the color used to display an active link. A that represents the color to display an active link. The default color is specified by the system. Typically, this color is . - control. You can use this property to specify the color that the link is displayed in when the link is in the process of being clicked. - - There are a number of colors associated with a link. The specifies the color of all links displayed in the control. The property enables you to specify the color of a link after it has been visited by the user. - + control. You can use this property to specify the color that the link is displayed in when the link is in the process of being clicked. + + There are a number of colors associated with a link. The specifies the color of all links displayed in the control. The property enables you to specify the color of a link after it has been visited by the user. + > [!NOTE] -> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is in the process of being clicked. - - - -## Examples - The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. - +> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is in the process of being clicked. + + + +## Examples + The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> @@ -376,11 +376,11 @@ in all cases. - is a nonselectable . - + is a nonselectable . + ]]> @@ -458,14 +458,14 @@ if the is a hyperlink; otherwise, . The default is . - to contain a link by setting the , , , , and properties. - + to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> @@ -506,19 +506,19 @@ Gets or sets a value that represents the behavior of a link. One of the values. The default is . - . - - - -## Examples - The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. - + . + + + +## Examples + The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> @@ -549,14 +549,14 @@ Gets or sets the color used when displaying a normal link. A that represents the color used to displaying a normal link. The default color is specified by the system. Typically, this color is . - to contain a link by setting the , , , , and properties. - + to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> @@ -598,19 +598,19 @@ if links should display as though they were visited; otherwise, . The default is . - control does not automatically denote that a link is a visited link. To display the link as a visited link, you can set the value of this property to `true` in an event handler for the click event of the . A visited link is displayed using the color specified in the property of the control. - - - -## Examples - The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. - + control does not automatically denote that a link is a visited link. To display the link as a visited link, you can set the value of this property to `true` in an event handler for the click event of the . A visited link is displayed using the color specified in the property of the control. + + + +## Examples + The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> @@ -644,13 +644,13 @@ 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. + ]]> @@ -687,13 +687,13 @@ 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. + ]]> @@ -730,13 +730,13 @@ 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. + ]]> @@ -773,13 +773,13 @@ 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. + ]]> @@ -818,13 +818,13 @@ if the character was processed as a mnemonic by the control; otherwise, . - implementation relies on the host control to call the method to determine whether the given character matches a mnemonic in the item's text. In this case, the method selects the item associated with the label, or raises the event if the item cannot be selected. - + implementation relies on the host control to call the method to determine whether the given character matches a mnemonic in the item's text. In this case, the method selects the item associated with the label, or raises the event if the item cannot be selected. + ]]> @@ -855,22 +855,22 @@ Gets or sets the color used when displaying a link that has been previously visited. A that represents the color used to display links that have been visited. The default color is specified by the system. Typically, this color is . - that have been visited by the user. - + that have been visited by the user. + > [!NOTE] -> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is displayed as a visited link. - - - -## Examples - The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. - +> When setting this property, ensure that the color you are setting the property to does not conflict with the color of the control's background or the text does not display properly. For example, if the background color of the control is `Color.Red` and this property is set to `Color.Red`, the text is not shown properly when the link is displayed as a visited link. + + + +## Examples + The following code example demonstrates how to initialize a to contain a link by setting the , , , , and properties. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/Tag/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripLabel/VB/form1.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/ToolStripMenuItem.xml b/xml/System.Windows.Forms/ToolStripMenuItem.xml index 9b4469752ee..0b8015048d8 100644 --- a/xml/System.Windows.Forms/ToolStripMenuItem.xml +++ b/xml/System.Windows.Forms/ToolStripMenuItem.xml @@ -1729,7 +1729,7 @@ ## Examples - The following code example demonstrates how to use the property to assign the key combination CTRL+P to a menu item called `printToolStripMenuItem`. For the complete example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + The following code example demonstrates how to use the property to assign the key combination CTRL+P to a menu item called `printToolStripMenuItem`. For the complete example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet100"::: :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet100"::: diff --git a/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml b/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml index cc483133190..4bd380e4fea 100644 --- a/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml +++ b/xml/System.Windows.Forms/ToolStripProfessionalRenderer.xml @@ -29,19 +29,19 @@ Handles the painting functionality for objects, applying a custom palette and a streamlined style. - creates pens and brushes based on a replaceable color table called . - - - -## Examples - The following code example demonstrates how to create a composite control that mimics the **Navigation Pane** provided by Microsoft® Outlook®. For a full code listing, see [How to: Create a Professionally Styled ToolStrip Control](/dotnet/framework/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control). - + creates pens and brushes based on a replaceable color table called . + + + +## Examples + The following code example demonstrates how to create a composite control that mimics the **Navigation Pane** provided by Microsoft® Outlook®. For a full code listing, see [How to: Create a Professionally Styled ToolStrip Control](/dotnet/desktop/winforms/controls/how-to-create-a-professionally-styled-toolstrip-control). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripProfessionalRenderer/Overview/StackView.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet10"::: + ]]> @@ -77,14 +77,14 @@ Initializes a new instance of the class. - class. This code example is part of a larger example provided for the class. - + class. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripProfessionalRenderer/Overview/StackView.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.StackView/VB/StackView.vb" id="Snippet5"::: + ]]> @@ -654,13 +654,13 @@ 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. + ]]> @@ -697,13 +697,13 @@ 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. + ]]> @@ -740,13 +740,13 @@ 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. + ]]> diff --git a/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml b/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml index 095423be432..26177f39ed8 100644 --- a/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml +++ b/xml/System.Windows.Forms/ToolStripRenderEventArgs.xml @@ -29,25 +29,25 @@ Provides data for the , , and methods. - class also provides data for the , , and methods. - - - -## Examples - The following code example demonstrates how to override the method to draw a custom border around a control. This code example is part of a larger example provided for the class. - + class also provides data for the , , and methods. + + + +## Examples + The following code example demonstrates how to override the method to draw a custom border around a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -155,20 +155,20 @@ Gets the representing the bounds of the area to be painted. The representing the bounds of the area to be painted. - method to draw a custom border around a control. This code example is part of a larger example provided for the class. - + method to draw a custom border around a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -197,16 +197,16 @@ Gets the that the background of the is painted with. The that the background of the is painted with. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]> @@ -237,21 +237,21 @@ Gets the representing the overlap area between a and its . The representing the overlap area between a and its . - is not a or the is `null`, the property returns an empty . - - - -## 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. - + is not a or the is `null`, the property returns an empty . + + + +## 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]> @@ -288,20 +288,20 @@ Gets the used to paint. The used to paint. - method to draw a custom border around a control. This code example is part of a larger example provided for the class. - + method to draw a custom border around a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer @@ -336,20 +336,20 @@ Gets the to be painted. The to be painted. - method to paint a gradient in the background of a control. This code example is part of a larger example provided for the class. - + method to paint a gradient in the background of a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: + ]]> - How to: Implement a Custom ToolStripRenderer + How to: Implement a Custom ToolStripRenderer diff --git a/xml/System.Windows.Forms/ToolStripRenderer.xml b/xml/System.Windows.Forms/ToolStripRenderer.xml index e517a230386..2634e04e3ae 100644 --- a/xml/System.Windows.Forms/ToolStripRenderer.xml +++ b/xml/System.Windows.Forms/ToolStripRenderer.xml @@ -29,29 +29,29 @@ Handles the painting functionality for objects. - class to apply a particular style or theme to a . Rather than custom painting a and the objects it contains, you set the property to an object that inherits from . The painting specified by the is applied to the , as well as the items it contains. - - You can do custom painting in controls in several ways. As with other Windows Forms controls, the and both have overridable `OnPaint` methods and `Paint` events. As with regular painting, the coordinate system is relative to the client area of the control; that is, the upper left-hand corner of the control is 0, 0. The `Paint` event and `OnPaint` method for a behave like other control paint events. - - The class has overridable methods for painting the background, item background, item image, item arrow, item text, and border of the . The event arguments for these methods expose several properties such as rectangles, colors, and text formats that you can adjust as desired. - - To adjust just a few aspects of how an item is painted, you typically override the . - - If you are writing a new item and want to control all aspects of the painting, override the `OnPaint` method. From within `OnPaint`, you can use methods from the . - - By default, the is double buffered, taking advantage of the setting. - - - -## Examples - The following code example demonstrates how to implement a custom class. The `GridStripRenderer` class customizes three aspects of the `GridStrip` control's appearance: `GridStrip` border, border, and image. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/framework/winforms/controls/how-to-implement-a-custom-toolstriprenderer). - + class to apply a particular style or theme to a . Rather than custom painting a and the objects it contains, you set the property to an object that inherits from . The painting specified by the is applied to the , as well as the items it contains. + + You can do custom painting in controls in several ways. As with other Windows Forms controls, the and both have overridable `OnPaint` methods and `Paint` events. As with regular painting, the coordinate system is relative to the client area of the control; that is, the upper left-hand corner of the control is 0, 0. The `Paint` event and `OnPaint` method for a behave like other control paint events. + + The class has overridable methods for painting the background, item background, item image, item arrow, item text, and border of the . The event arguments for these methods expose several properties such as rectangles, colors, and text formats that you can adjust as desired. + + To adjust just a few aspects of how an item is painted, you typically override the . + + If you are writing a new item and want to control all aspects of the painting, override the `OnPaint` method. From within `OnPaint`, you can use methods from the . + + By default, the is double buffered, taking advantage of the setting. + + + +## Examples + The following code example demonstrates how to implement a custom class. The `GridStripRenderer` class customizes three aspects of the `GridStrip` control's appearance: `GridStrip` border, border, and image. For a full code listing, see [How to: Implement a Custom ToolStripRenderer](/dotnet/desktop/winforms/controls/how-to-implement-a-custom-toolstriprenderer). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet10"::: + ]]> @@ -89,11 +89,11 @@ Initializes a new instance of the class. - is an abstract class, so the constructor is only available to classes derived from it. - + is an abstract class, so the constructor is only available to classes derived from it. + ]]> @@ -159,11 +159,11 @@ A that contains data to draw the arrow. Draws an arrow on a . - method provides an entry point to the arrow rendering code. Use this method to draw an arrow when overriding the method, or to force an arrow to be drawn in a custom . To change the way an arrow is rendered, override the method in a class derived from . - + method provides an entry point to the arrow rendering code. Use this method to draw an arrow when overriding the method, or to force an arrow to be drawn in a custom . To change the way an arrow is rendered, override the method in a class derived from . + ]]> @@ -197,11 +197,11 @@ The that contains data to draw the button's background. Draws the background for a . - method provides an entry point to the rendering code for the background of a . Use this method to draw the background of a button when overriding the method, or to force the background of a button to be drawn in a custom . To change the way the background is rendered, override the method in a class derived from . - + method provides an entry point to the rendering code for the background of a . Use this method to draw the background of a button when overriding the method, or to force the background of a button to be drawn in a custom . To change the way the background is rendered, override the method in a class derived from . + ]]> @@ -235,11 +235,11 @@ A that contains the data to draw the drop-down button's background. Draws the background for a . - method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a drop-down button when overriding the method, or to force the background of a drop-down button to be drawn in a custom . To change the way the background is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a drop-down button when overriding the method, or to force the background of a drop-down button to be drawn in a custom . To change the way the background is rendered, override the method in a class derived from . + ]]> @@ -273,11 +273,11 @@ A that contains the data to draw the move handle. Draws a move handle on a . - method provides an entry point to the rendering code for a move handle located on a . Use this method when overriding the method, or to force a move handle to be drawn in a custom . To change the way a move handle is rendered, override the method in a class derived from . - + method provides an entry point to the rendering code for a move handle located on a . Use this method when overriding the method, or to force a move handle to be drawn in a custom . To change the way a move handle is rendered, override the method in a class derived from . + ]]> @@ -311,11 +311,11 @@ A that contains the data to draw the space around the image. Draws the space around an image on a . - method provides the entry point to the rendering code for the image. Use this method to draw the image margin when overriding the method, or to force the image margin to be drawn in a custom . To change the way the image margin is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the image. Use this method to draw the image margin when overriding the method, or to force the image margin to be drawn in a custom . To change the way the image margin is rendered, override the method in a class derived from . + ]]> @@ -349,11 +349,11 @@ A that contains the data to draw the background of the item. Draws the background for a . - method provides the entry point to the rendering code for the background of an item. Use this method to draw the background of an item when overriding the method, or to force the background of an item to be drawn in a custom . To change the way the background of an item is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of an item. Use this method to draw the background of an item when overriding the method, or to force the background of an item to be drawn in a custom . To change the way the background of an item is rendered, override the method in a class derived from . + ]]> @@ -387,11 +387,11 @@ A that contains the data to draw the selected image. Draws an image on a that indicates the item is in a selected state. - method provides the entry point to the rendering code for an image in a selected state. Use this method to draw a selected image when overriding the method, or to force a selected image to be drawn in a custom . To change the way a selected image is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for an image in a selected state. Use this method to draw a selected image when overriding the method, or to force a selected image to be drawn in a custom . To change the way a selected image is rendered, override the method in a class derived from . + ]]> @@ -425,11 +425,11 @@ A that contains the data to draw the image. Draws an image on a . - method provides the entry point to the rendering code for an image. Use this method to draw an image when overriding the method or to force the image to be drawn in a custom . To change the way the image is rendered, override the `OnDrawItem` method in a class derived from . - + method provides the entry point to the rendering code for an image. Use this method to draw an image when overriding the method or to force the image to be drawn in a custom . To change the way the image is rendered, override the `OnDrawItem` method in a class derived from . + ]]> @@ -463,11 +463,11 @@ A that contains the data to draw the text. Draws text on a . - method provides the entry point to the rendering code for the text of a . Use this method to draw the item text when overriding the method, or to force the item text to be drawn in a custom . To change the way the item text is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the text of a . Use this method to draw the item text when overriding the method, or to force the item text to be drawn in a custom . To change the way the item text is rendered, override the method in a class derived from . + ]]> @@ -501,11 +501,11 @@ A that contains the data to draw the background for the label. Draws the background for a . - method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background of a is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background of a is rendered, override the method in a class derived from . + ]]> @@ -539,11 +539,11 @@ A that contains the data to draw the background for the menu item. Draws the background for a . - method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background for a is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background for a is rendered, override the method in a class derived from . + ]]> @@ -577,11 +577,11 @@ A that contains the event data. Draws the background for an overflow button. - method provides the entry point to the rendering code for the background of an overflow button. Use this method to draw the background of an overflow button when overriding the method, or to force the background for an overflow button to be drawn in a custom . To change the way the background for an overflow button is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of an overflow button. Use this method to draw the background of an overflow button when overriding the method, or to force the background for an overflow button to be drawn in a custom . To change the way the background for an overflow button is rendered, override the method in a class derived from . + ]]> @@ -615,11 +615,11 @@ A that contains the data to draw the . Draws a . - method provides the entry point to the rendering code for a . Use this method to draw the when overriding the method, or to force a to be drawn in a custom . To change the way the is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for a . Use this method to draw the when overriding the method, or to force a to be drawn in a custom . To change the way the is rendered, override the method in a class derived from . + ]]> @@ -653,11 +653,11 @@ A that contains the event data. Draws a . - method provides the entry point to the rendering code for a . Use this method to draw a when overriding the method, or to force a to be drawn in a custom . To change the way the is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for a . Use this method to draw a when overriding the method, or to force a to be drawn in a custom . To change the way the is rendered, override the method in a class derived from . + ]]> @@ -722,11 +722,11 @@ A that contains the data to draw the background for the . Draws the background for a . - method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background of a is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the background of a . Use this method to draw the background of a when overriding the method, or to force the background of a to be drawn in a custom . To change the way the background of a is rendered, override the method in a class derived from . + ]]> @@ -760,11 +760,11 @@ A that contains the data to draw the border for the . Draws the border for a . - method provides the entry point to the rendering code for the border of a . Use this method to draw the border of a when overriding the method, or to force the border of a to be drawn in a custom . To change the way the border of a is rendered, override the method in a class derived from . - + method provides the entry point to the rendering code for the border of a . Use this method to draw the border of a when overriding the method, or to force the border of a to be drawn in a custom . To change the way the border of a is rendered, override the method in a class derived from . + ]]> @@ -891,11 +891,11 @@ The to be initialized. When overridden in a derived class, provides for custom initialization of the given . - method to set properties, such as the or , when a is rendered. - + method to set properties, such as the or , when a is rendered. + ]]> @@ -960,19 +960,19 @@ The to be initialized. When overridden in a derived class, provides for custom initialization of the given . - method to set properties, such as the or , when a is rendered. - - - -## Examples - The following code example demonstrates how to initialize individual controls. This code example is part of a larger example provided for the class. - + method to set properties, such as the or , when a is rendered. + + + +## Examples + The following code example demonstrates how to initialize individual controls. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet11"::: + ]]> How to: Implement a Custom ToolStripRenderer @@ -1090,13 +1090,13 @@ 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. + ]]> .NET 5 and later: The argument is . @@ -1134,19 +1134,19 @@ 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 method to draw a border around a control's . This code example is part of a larger example provided for the class. - + +## Examples + The following code example demonstrates how to override the method to draw a border around a control's . This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet14"::: + ]]> @@ -1184,13 +1184,13 @@ 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. + ]]> @@ -1227,13 +1227,13 @@ 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. + ]]> @@ -1270,13 +1270,13 @@ A that contains the event data. Draws the item background. - 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. + ]]> @@ -1313,13 +1313,13 @@ 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. + ]]> @@ -1356,13 +1356,13 @@ 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. + ]]> .NET 5 and later: The argument is . @@ -1400,13 +1400,13 @@ 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. + ]]> .NET 5 and later: The argument is . @@ -1444,13 +1444,13 @@ 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. + ]]> .NET 5 and later: The argument is . @@ -1488,13 +1488,13 @@ 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. + ]]> @@ -1531,13 +1531,13 @@ 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. + ]]> @@ -1574,13 +1574,13 @@ 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. + ]]> @@ -1617,13 +1617,13 @@ 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. + ]]> @@ -1660,13 +1660,13 @@ 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. + ]]> @@ -1703,13 +1703,13 @@ 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. + ]]> .NET 5 and later: The argument is . @@ -1747,21 +1747,21 @@ 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 method to paint a gradient in the background of a control. This code example is part of a larger example provided for 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 demonstrates how to override the method to paint a gradient in the background of a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet13"::: + ]]> @@ -1799,21 +1799,21 @@ 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 method to draw a custom border around a control. This code example is part of a larger example provided for 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 demonstrates how to override the method to draw a custom border around a control. This code example is part of a larger example provided for the class. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/LayoutSettings/Overview/GridStrip.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStrip.GridStrip/VB/GridStrip.vb" id="Snippet12"::: + ]]> @@ -1851,13 +1851,13 @@ 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. + ]]> @@ -1894,13 +1894,13 @@ 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. + ]]> @@ -1937,13 +1937,13 @@ 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. + ]]> @@ -1976,21 +1976,21 @@ Occurs when an arrow on a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet583"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet583"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet583"::: + ]]> @@ -2020,21 +2020,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet588"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet588"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet588"::: + ]]> @@ -2064,21 +2064,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet589"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet589"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet589"::: + ]]> @@ -2108,21 +2108,21 @@ Occurs when the move handle for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet591"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet591"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet591"::: + ]]> @@ -2152,21 +2152,21 @@ Draws the margin between an image and its container. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet596"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet596"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet596"::: + ]]> @@ -2196,21 +2196,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet592"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet592"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet592"::: + ]]> @@ -2240,21 +2240,21 @@ Occurs when the image for a selected is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet594"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet594"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet594"::: + ]]> @@ -2284,21 +2284,21 @@ Occurs when the image for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet593"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet593"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet593"::: + ]]> @@ -2328,21 +2328,21 @@ Occurs when the text for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet595"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet595"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet595"::: + ]]> @@ -2372,21 +2372,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet597"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet597"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet597"::: + ]]> @@ -2416,21 +2416,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet598"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet598"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet598"::: + ]]> @@ -2460,21 +2460,21 @@ Occurs when the background for an overflow button is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet590"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet590"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet590"::: + ]]> @@ -2504,21 +2504,21 @@ Occurs when a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet602"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet602"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet602"::: + ]]> @@ -2548,21 +2548,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet601"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet601"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet601"::: + ]]> @@ -2592,21 +2592,21 @@ Occurs when the display style changes. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet600"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet600"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet600"::: + ]]> @@ -2636,21 +2636,21 @@ Occurs when the background for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet584"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet584"::: + ]]> @@ -2680,21 +2680,21 @@ Occurs when the border for a is rendered. - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet587"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet587"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet587"::: + ]]> @@ -2724,21 +2724,21 @@ Draws the background of a . - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet586"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet586"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet586"::: + ]]> @@ -2768,21 +2768,21 @@ Draws the background of a . - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet585"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet585"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet585"::: + ]]> @@ -2812,21 +2812,21 @@ Draws the background of a . - 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 `ToolStripRenderer1` 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 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 `ToolStripRenderer1` and ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet599"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet599"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet599"::: + ]]> @@ -2886,9 +2886,9 @@ The DPI value to use for scaling. Applies the and values to scaling the arrow icon based on the specified DPI value. - about the new DPI and allows the offsets for rendering arrows in the right dimensions to be calculated. +This overload of the `ScaleArrowOffsetsIfNeeded` method should be called in a derived class only when an application opts into [per-monitor version 2](/dotnet/framework/whats-new/whats-new-in-accessibility#accessibility-switches), targets .NET Framework 4.7.1 or later, and has the `EnableDpiChangedMessageHandling` and `EnableDpiChangedHighDpiImprovements` configuration switches turned on. It informs the about the new DPI and allows the offsets for rendering arrows in the right dimensions to be calculated. ]]> diff --git a/xml/System.Windows.Forms/ToolStripSeparator.xml b/xml/System.Windows.Forms/ToolStripSeparator.xml index 24bc110ea9e..1256c5c3960 100644 --- a/xml/System.Windows.Forms/ToolStripSeparator.xml +++ b/xml/System.Windows.Forms/ToolStripSeparator.xml @@ -33,18 +33,18 @@ Represents a line used to group items of a or the drop-down items of a or or other control. - to group related items on a menu or . The is automatically spaced and oriented horizontally or vertically to accord with its container. - - You can add a at design time by choosing it from a drop-down list. However, you can also automatically create a by typing a hyphen (-) in either the designer template node or in the method. - + to group related items on a menu or . The is automatically spaced and oriented horizontally or vertically to accord with its container. + + You can add a at design time by choosing it from a drop-down list. However, you can also automatically create a by typing a hyphen (-) in either the designer template node or in the method. + ]]> - ToolStrip Control (Windows Forms) - MenuStrip Control (Windows Forms) - How to: Add Enhancements to ToolStripMenuItems + ToolStrip Control (Windows Forms) + MenuStrip Control (Windows Forms) + How to: Add Enhancements to ToolStripMenuItems @@ -116,11 +116,11 @@ if enabled; otherwise, . - @@ -170,11 +170,11 @@ This property is not relevant to this class. The image to display in the background of the separator. - @@ -223,11 +223,11 @@ This property is not relevant to this class. One of the values. - @@ -402,11 +402,11 @@ This property is not relevant to this class. One of the values. - @@ -447,11 +447,11 @@ This event is not relevant to this class. - @@ -501,11 +501,11 @@ if enabled; otherwise, . - @@ -555,11 +555,11 @@ if enabled; otherwise, . - @@ -600,11 +600,11 @@ This event is not relevant to this class. - @@ -657,11 +657,11 @@ This property is not relevant to this class. The to apply to the text displayed by the . - @@ -743,11 +743,11 @@ This property is not relevant to this class. The image to be displayed. - @@ -796,11 +796,11 @@ This property is not relevant to this class. One of the values. - @@ -857,11 +857,11 @@ This property is not relevant to this class. The index of the image that is displayed. - @@ -914,11 +914,11 @@ This property is not relevant to this class. The key for the image that is displayed for the . - @@ -967,11 +967,11 @@ This property is not relevant to this class. One of the value. - @@ -1020,11 +1020,11 @@ This property is not relevant to this class. One of the values. - @@ -1064,11 +1064,11 @@ A that contains the event data. This method is not relevant to this class. - @@ -1149,11 +1149,11 @@ if enabled; otherwise, . - @@ -1234,11 +1234,11 @@ This property is not relevant to this class. A representing the item's text. - @@ -1287,11 +1287,11 @@ This property is not relevant to this class. One of the value. - @@ -1332,11 +1332,11 @@ This event is not relevant to this class. - @@ -1381,11 +1381,11 @@ This property is not relevant to this class. One of the values. - @@ -1434,11 +1434,11 @@ This property is not relevant to this class. One of the values. - @@ -1488,11 +1488,11 @@ This property is not relevant to this class. A string representing the ToolTip text. - diff --git a/xml/System.Windows.Forms/ToolStripSplitButton.xml b/xml/System.Windows.Forms/ToolStripSplitButton.xml index 3953cd50ed1..0969b6f86dc 100644 --- a/xml/System.Windows.Forms/ToolStripSplitButton.xml +++ b/xml/System.Windows.Forms/ToolStripSplitButton.xml @@ -37,18 +37,18 @@ Represents a combination of a standard button on the left and a drop-down button on the right, or the other way around if the value of is . - combines button and drop-down button functionality. - - Use the property to synchronize the event of the chosen drop-down item with the item shown on the button. - + combines button and drop-down button functionality. + + Use the property to synchronize the event of the chosen drop-down item with the item shown on the button. + ]]> - ToolStrip Control Overview (Windows Forms) - ToolStrip Control Architecture - ToolStrip Technology Summary + ToolStrip Control Overview (Windows Forms) + ToolStrip Control Architecture + ToolStrip Technology Summary @@ -318,11 +318,11 @@ if default text is displayed; otherwise, . The default is . - property to `false` to display custom text on a . - + property to `false` to display custom text on a . + ]]> @@ -394,21 +394,21 @@ Occurs when the standard button portion of a is clicked. - 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 type named `ToolStripSplitButton1`. Then 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 type named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet609"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet609"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet609"::: + ]]> @@ -445,21 +445,21 @@ Occurs when the standard button portion of a is double-clicked. - 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 type named `ToolStripSplitButton1`. Then 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 type named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet610"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet610"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet610"::: + ]]> @@ -668,13 +668,13 @@ Gets or sets the portion of the that is activated when the control is first selected. A representing the portion of the that is activated when first selected. The default value is . - has a , the ENTER key activates the button. Otherwise, the ENTER key activates the drop-down. - - Use the property to synchronize the event of the chosen drop-down item with the item shown on the button. - + has a , the ENTER key activates the button. Otherwise, the ENTER key activates the drop-down. + + Use the property to synchronize the event of the chosen drop-down item with the item shown on the button. + ]]> @@ -711,21 +711,21 @@ Occurs when the has changed. - 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 type named `ToolStripSplitButton1`. Then 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 type named `ToolStripSplitButton1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet611"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet611"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet611"::: + ]]> @@ -966,13 +966,13 @@ 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. + ]]> @@ -1009,13 +1009,13 @@ 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. + ]]> @@ -1052,13 +1052,13 @@ 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. + ]]> @@ -1095,13 +1095,13 @@ 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. + ]]> @@ -1138,13 +1138,13 @@ 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. + ]]> @@ -1181,13 +1181,13 @@ 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. + ]]> @@ -1256,13 +1256,13 @@ 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. + ]]> @@ -1329,13 +1329,13 @@ if the key was processed by the item; otherwise, . - event. However, if the is not enabled, this method calls the base class implementation instead. - - This method is called only if the method indicates that the item is not processing the key. - + event. However, if the is not enabled, this method calls the base class implementation instead. + + This method is called only if the method indicates that the item is not processing the key. + ]]> @@ -1408,11 +1408,11 @@ This method is not relevant to this class. - @@ -1454,11 +1454,11 @@ Gets the boundaries of the separator between the standard and drop-down button portions of a . A that represents the size and location of the separator. - property to do custom painting. - + property to do custom painting. + ]]> diff --git a/xml/System.Windows.Forms/ToolStripStatusLabel.xml b/xml/System.Windows.Forms/ToolStripStatusLabel.xml index cc8de7b33cf..c94e116c12d 100644 --- a/xml/System.Windows.Forms/ToolStripStatusLabel.xml +++ b/xml/System.Windows.Forms/ToolStripStatusLabel.xml @@ -42,21 +42,21 @@ Represents a panel in a control. - is a version of designed specifically for use in . The special features include , , and . - - A can contain text or an icon that reflects the status of an application. Use the class to find, add, or remove objects. - + is a version of designed specifically for use in . The special features include , , and . + + A can contain text or an icon that reflects the status of an application. Use the class to find, add, or remove objects. + replaces and extends the control, which was removed in .NET 5. -## Examples - The following code example demonstrates a with various common properties set. - +## Examples + The following code example demonstrates a with various common properties set. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]> @@ -287,17 +287,17 @@ Gets or sets a value that determines where the is aligned on the . One of the values. - property is affected by the setting of the property. -## Examples - The following code example demonstrates the syntax for various common properties, including the property. - +## Examples + The following code example demonstrates the syntax for various common properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -338,14 +338,14 @@ Gets or sets a value that indicates which sides of the show borders. One of the values. The default is . - common properties, including the property. - + common properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -386,14 +386,14 @@ Gets or sets the border style of the . One of the values. The default is . - common properties, including the property. - + common properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> The value of is not one of the values. @@ -632,20 +632,20 @@ if the automatically fills the available space on the as the form is resized; otherwise, . The default is . - property to `true` to enable the to smoothly resize along with its container. -## Examples - The following code example demonstrates the syntax for various common properties, including the property. - +## Examples + The following code example demonstrates the syntax for various common properties, including the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripItem/RightToLeftAutoMirrorImage/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripStatusLabel.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> - How to: Use the Spring Property Interactively in a StatusStrip + How to: Use the Spring Property Interactively in a StatusStrip diff --git a/xml/System.Windows.Forms/ToolStripTextBox.xml b/xml/System.Windows.Forms/ToolStripTextBox.xml index 4dcd268475b..15e258cdd68 100644 --- a/xml/System.Windows.Forms/ToolStripTextBox.xml +++ b/xml/System.Windows.Forms/ToolStripTextBox.xml @@ -33,30 +33,30 @@ Represents a text box in a that allows the user to enter text. - is the optimized for hosting in a . A subset of the hosted control's properties and events are exposed at the level, but the underlying control is fully accessible through the property. - - The control allows the user to enter text in an application. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing. - - Typically, a control is used to display a single line of text or accept it as input. You can use the to enable multiple lines of text to be displayed or entered. Set the and properties to `true` to allow greater text manipulation in a multiline control. - - You can limit the amount of text entered into a control by setting the property to a specific number of characters. Use the property to allow the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the control. - - To restrict text from being entered in a control, you can create an event handler for the event in order to validate each character entered in the control. You can also restrict all entry of data in a control by setting the property to `true`. - - - -## Examples - The following code example demonstrates a with various common property settings, including automatic completion options. - + is the optimized for hosting in a . A subset of the hosted control's properties and events are exposed at the level, but the underlying control is fully accessible through the property. + + The control allows the user to enter text in an application. This control has additional functionality that is not found in the standard Windows text box control, including multiline editing. + + Typically, a control is used to display a single line of text or accept it as input. You can use the to enable multiple lines of text to be displayed or entered. Set the and properties to `true` to allow greater text manipulation in a multiline control. + + You can limit the amount of text entered into a control by setting the property to a specific number of characters. Use the property to allow the user to type only uppercase, only lowercase, or a combination of uppercase and lowercase characters into the control. + + To restrict text from being entered in a control, you can create an event handler for the event in order to validate each character entered in the control. You can also restrict all entry of data in a control by setting the property to `true`. + + + +## Examples + The following code example demonstrates a with various common property settings, including automatic completion options. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet0"::: + ]]> - ToolStrip Control (Windows Forms) + ToolStrip Control (Windows Forms) ToolStrip Sample @@ -189,19 +189,19 @@ if the ENTER key creates a new line of text in a multiline version of the control; if the ENTER key activates the default button for the form. The default is . - control. If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + control. If there is no default button for the form, then the ENTER key will always create a new line of text in the control, no matter what the value of this property. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -239,19 +239,19 @@ if users can enter tabs in a multiline text box using the TAB key; if pressing the TAB key moves the focus. The default is . - property is set to `true`, the user must press CTRL+TAB to move the focus to the next control in the tab order. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + property is set to `true`, the user must press CTRL+TAB to move the focus to the next control in the tab order. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -289,21 +289,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet612"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet612"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet612"::: + ]]> @@ -398,23 +398,23 @@ Gets or sets a custom string collection to use when the property is set to . An to use with . - , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the property is optional, but you must set the property to `CustomSource` in order to use . - - You must use the and properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the property is optional, but you must set the property to `CustomSource` in order to use . + + You must use the and properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -461,23 +461,23 @@ Gets or sets an option that controls how automatic completion works for the . One of the values. The default is . - , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the property is optional, but you must set the property to `CustomSource` in order to use . - - You must use the and properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the property is optional, but you must set the property to `CustomSource` in order to use . + + You must use the and properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -524,23 +524,23 @@ Gets or sets a value specifying the source of complete strings used for automatic completion. One of the values. The default is . - , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. - - The use of the property is optional, but you must set the property to `CustomSource` in order to use . - - You must use the and properties together. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + , , and properties to create a that automatically completes input strings by comparing the prefix being entered to the prefixes of all strings in a maintained source. This is useful for controls in which URLs, addresses, file names, or commands will be frequently entered. + + The use of the property is optional, but you must set the property to `CustomSource` in order to use . + + You must use the and properties together. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -596,11 +596,11 @@ This property is not relevant to this class. The background image displayed in the control. - @@ -649,11 +649,11 @@ This property is not relevant to this class. An value. - @@ -694,19 +694,19 @@ Gets or sets the border type of the control. One of the values. The default is . - property to create borderless and flat style controls, in addition to the default three-dimensional control. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + property to create borderless and flat style controls, in addition to the default three-dimensional control. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -743,21 +743,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet613"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet613"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet613"::: + ]]> @@ -803,11 +803,11 @@ if the user can undo the previous operation performed in a text box control; otherwise, . - method to undo the last operation in a . - + method to undo the last operation in a . + ]]> @@ -849,19 +849,19 @@ Gets or sets whether the control modifies the case of characters as they are typed. One of the values. The default is . - property to change the case of characters as required by your application. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + property to change the case of characters as required by your application. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -925,11 +925,11 @@ Clears information about the most recent operation from the undo buffer of the . - @@ -965,11 +965,11 @@ Copies the current selection in the to the Clipboard. - class, to copy text in the and place it in the Clipboard. - + class, to copy text in the and place it in the Clipboard. + ]]> @@ -1033,11 +1033,11 @@ Moves the current selection in the to the Clipboard. - if text is selected in the control. You can use this method, instead of using the class, to copy text in the and move it to the Clipboard. - + if text is selected in the control. You can use this method, instead of using the class, to copy text in the and move it to the Clipboard. + ]]> @@ -1101,13 +1101,13 @@ Gets the default size of the . The default of the in pixels. The default size is 100 pixels by 25 pixels. - [!NOTE] -> In order to maintain better performance, you should not set the of a in its constructor. The preferred method is to override the property. - +> In order to maintain better performance, you should not set the of a in its constructor. The preferred method is to override the property. + ]]> @@ -1173,14 +1173,14 @@ Retrieves the character that is closest to the specified location within the control. The character at the specified location. - [!NOTE] -> If the specified location in the `pt` parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in `pt` is returned. - +> If the specified location in the `pt` parameter is located on the right side of the client area of the control, the last character of the string closest to the point specified in `pt` is returned. + ]]> @@ -1219,11 +1219,11 @@ Retrieves the index of the character nearest to the specified location. The zero-based character index at the specified location. - @@ -1262,13 +1262,13 @@ Retrieves the index of the first character of a given line. The zero-based character index in the specified line. - returns 0. If the `lineNum` parameter exceeds the number of lines in the control, returns the first character index for the last line in the control. - - returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a control and set and to `true`, the two long assigned lines result in four physical (or displayed lines). - + returns 0. If the `lineNum` parameter exceeds the number of lines in the control, returns the first character index for the last line in the control. + + returns the first character index of a physical line. The physical line is the displayed line, not the assigned line. The number of displayed lines can be greater than the number of assigned lines due to word wrap. For example, if you assign two long lines to a control and set and to `true`, the two long assigned lines result in four physical (or displayed lines). + ]]> @@ -1336,14 +1336,14 @@ Retrieves the line number from the specified character position within the text of the control. The zero-based line number in which the character index is located. - method returns the physical line number where the indexed character is located within the control. For example, if a portion of the first logical line of text in the control wraps to the next line, the method returns 1 if the character at the specified character index has wrapped to the second physical line. If is set to `false`, no portion of the line wraps to the next, and the method returns 0 for the specified character index. You can use this method to determine which line a specific character index is located within. For example, after calling the method to search for text, you can obtain the character index to where the search results are found. You can call this method with the character index returned by the method to determine which line the word was found. - + method returns the physical line number where the indexed character is located within the control. For example, if a portion of the first logical line of text in the control wraps to the next line, the method returns 1 if the character at the specified character index has wrapped to the second physical line. If is set to `false`, no portion of the line wraps to the next, and the method returns 0 for the specified character index. You can use this method to determine which line a specific character index is located within. For example, after calling the method to search for text, you can obtain the character index to where the search results are found. You can call this method with the character index returned by the method to determine which line the word was found. + > [!NOTE] -> If the character index specified in the `index` parameter is beyond the available number of lines contained within the control, the last line number is returned. - +> If the character index specified in the `index` parameter is beyond the available number of lines contained within the control, the last line number is returned. + ]]> @@ -1382,11 +1382,11 @@ Retrieves the location within the control at the specified character index. The location of the specified character. - control. - + control. + ]]> @@ -1461,19 +1461,19 @@ if the selected text does not appear highlighted when the text box control loses focus; , if the selected text remains highlighted when the text box control loses focus. The default is . - common property settings, including the property . - + common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1510,21 +1510,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet614"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet614"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet614"::: + ]]> @@ -1577,11 +1577,11 @@ Gets or sets the lines of text in a control. An array of strings that contains the text in a text box control. - property of the text box control is set to `true` and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line. - + property of the text box control is set to `true` and a newline character appears in the text, the text following the newline character is added to a new element in the array and displayed on a separate line. + ]]> @@ -1622,19 +1622,19 @@ Gets or sets the maximum number of characters the user can type or paste into the text box control. The number of characters that can be entered into the control. The default is 32767 characters. - common property settings, including the property . - + common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1680,11 +1680,11 @@ if the control's contents have been modified; otherwise, . - control. You can also set this property in code to indicate that changes were made to the control by the application. This property can be used by validation and data-saving methods to determine if changes were made in a control so the changed contents can be validated or saved. - + control. You can also set this property in code to indicate that changes were made to the control by the application. This property can be used by validation and data-saving methods to determine if changes were made in a control so the changed contents can be validated or saved. + ]]> @@ -1721,21 +1721,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet615"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet615"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet615"::: + ]]> @@ -1793,11 +1793,11 @@ if enabled; otherwise, . - @@ -1842,11 +1842,11 @@ This event is not relevant to this class. - @@ -1880,13 +1880,13 @@ 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. + ]]> @@ -1923,13 +1923,13 @@ 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. + ]]> @@ -1966,13 +1966,13 @@ 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. + ]]> @@ -2009,13 +2009,13 @@ 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. + ]]> @@ -2052,13 +2052,13 @@ 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. + ]]> @@ -2095,13 +2095,13 @@ 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. + ]]> @@ -2201,11 +2201,11 @@ Replaces the current selection in the text box with the contents of the Clipboard. - method will only paste text into the control if text is currently stored in the Clipboard. - + method will only paste text into the control if text is currently stored in the Clipboard. + ]]> @@ -2248,11 +2248,11 @@ if the is read-only; otherwise, . The default is . - property to allow the contents to be copied. - + property to allow the contents to be copied. + ]]> @@ -2289,21 +2289,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet616"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet616"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet616"::: + ]]> @@ -2334,14 +2334,14 @@ Scrolls the contents of the control to the current caret position. - method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control. - + method will scroll the contents of the control until the caret is visible at the bottom of the control. If the caret is positioned above the visible region of the control, this method scrolls the contents of the control until the caret is visible at the top of the control. You can use this method in a multiline text box to ensure that the current text entry point is within the visible region of the control. + > [!NOTE] -> This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control. - +> This method has no effect if the control does not have focus or if the caret is already positioned in the visible region of the control. + ]]> @@ -2377,14 +2377,14 @@ The number of characters to select. Selects a range of text in the text box. - [!NOTE] -> You can programmatically move the caret within the text box by setting the `start` parameter to the position within the text box where you want the caret to move to and set the `length` parameter to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the `start` parameter to the position within the text box where you want the caret to move to and set the `length` parameter to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]> @@ -2415,11 +2415,11 @@ Selects all text in the text box. - method, which requires text to be selected in the control, to cut the entire contents of the control and paste them into the Clipboard. - + method, which requires text to be selected in the control, to cut the entire contents of the control and paste them into the Clipboard. + ]]> @@ -2464,11 +2464,11 @@ Gets or sets a value indicating the currently selected text in the control. A string that represents the currently selected text in the text box. - . If no text is currently selected in the , this property returns a zero-length string. - + . If no text is currently selected in the , this property returns a zero-length string. + ]]> @@ -2515,14 +2515,14 @@ Gets or sets the number of characters selected in the . The number of characters selected in the . - property is set to a value that is larger than the number of characters within the text of the control, the value of the property is set to the entire length of text within the control minus the value of the property (if any value is specified for the property). - + property is set to a value that is larger than the number of characters within the text of the control, the value of the property is set to the entire length of text within the control minus the value of the property (if any value is specified for the property). + > [!NOTE] -> You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]> @@ -2569,14 +2569,14 @@ Gets or sets the starting point of text selected in the . The starting position of text selected in the . - property. If the remaining text in the control after the position indicated by the property is less than the value of the property, the value of the property is automatically decreased. The value of the property never causes an increase in the property. - + property. If the remaining text in the control after the position indicated by the property is less than the value of the property, the value of the property is automatically decreased. The value of the property never causes an increase in the property. + > [!NOTE] -> You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved. - +> You can programmatically move the caret within the text box by setting the to the position within the text box where you want the caret to move to and set the property to a value of zero (0). The text box must have focus in order for the caret to be moved. + ]]> @@ -2614,31 +2614,31 @@ to enable the shortcuts; otherwise, . - property to enable or disable the following shortcut key combinations: - -|Shortcut keys|Shortcut keys| -|-------------------|-------------------| -|CTRL+Z|CTRL+E| -|CTRL+C|CTRL+I| -|CTRL+X|CTRL+Y| -|CTRL+V|CTRL+BACKSPACE| -|CTRL+A|CTRL+DELETE| -|CTRL+L|SHIFT+DELETE| -|CTRL+R|SHIFT+INSERT| - - You can override this property to specify other shortcut keys. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + property to enable or disable the following shortcut key combinations: + +|Shortcut keys|Shortcut keys| +|-------------------|-------------------| +|CTRL+Z|CTRL+E| +|CTRL+C|CTRL+I| +|CTRL+X|CTRL+Y| +|CTRL+V|CTRL+BACKSPACE| +|CTRL+A|CTRL+DELETE| +|CTRL+L|SHIFT+DELETE| +|CTRL+R|SHIFT+INSERT| + + You can override this property to specify other shortcut keys. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2721,19 +2721,19 @@ Gets or sets how text is aligned in a control. One of the enumeration values that specifies how text is aligned in the control. The default is . - to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the property to , and the text will be aligned with the right side of the control instead of the default left alignment. - - - -## Examples - The following code example demonstrates the syntax for setting various common property settings, including the property . - + to match the layout of text on your form. For example, if your controls are all located on the right side of the form, you can set the property to , and the text will be aligned with the right side of the control instead of the default left alignment. + + + +## Examples + The following code example demonstrates the syntax for setting various common property settings, including the property . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripTextBox/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolStripTextBox.CommonProps/VB/form1.vb" id="Snippet1"::: + ]]> @@ -2770,21 +2770,21 @@ 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 type named `ToolStripTextBox1`. Then 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 type named `ToolStripTextBox1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet617"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet617"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet617"::: + ]]> @@ -2821,11 +2821,11 @@ Gets the length of text in the control. The number of characters contained in the text of the . - property to determine the number of characters in a string for tasks such as searching for specific strings of text within the text of the control, where knowledge of the total number of characters is needed. - + property to determine the number of characters in a string for tasks such as searching for specific strings of text within the text of the control, where knowledge of the total number of characters is needed. + ]]> @@ -2856,11 +2856,11 @@ Undoes the last edit operation in the text box. - property returns `true`. - + property returns `true`. + ]]> @@ -2915,11 +2915,11 @@ if enabled; otherwise, . - diff --git a/xml/System.Windows.Forms/ToolTip.xml b/xml/System.Windows.Forms/ToolTip.xml index 12b8663095c..91bd67b5ec8 100644 --- a/xml/System.Windows.Forms/ToolTip.xml +++ b/xml/System.Windows.Forms/ToolTip.xml @@ -50,44 +50,44 @@ Represents a small rectangular pop-up window that displays a brief description of a control's purpose when the user rests the pointer on the control. - class, you can provide hints to a user when the user places the pointer on a control. The class is typically used to alert users to the intended use of a control. For example, you can specify ToolTip text for a control that accepts a name, specifying the format of the name to be typed into the control. In addition to providing hints, you can also use the class to provide run time status information. For example, you can use the class to display connection speed and line quality data when the user moves the pointer onto a control that displays Internet connection status. - - The class can be used in any container. To explicitly specify a container, use the constructor. A single component typically is used to create ToolTips for multiple controls on a single form. After you create a , use a separate call to the method to associate ToolTip display text to an individual control. Then when the user moves the pointer on a control, the ToolTip with its text is displayed. You can call more than once for the same control to change the text that is associated with the control. To get the text that is associated with a control, use the method. To remove all ToolTip text associations with an instance of the class, use the method. - + class, you can provide hints to a user when the user places the pointer on a control. The class is typically used to alert users to the intended use of a control. For example, you can specify ToolTip text for a control that accepts a name, specifying the format of the name to be typed into the control. In addition to providing hints, you can also use the class to provide run time status information. For example, you can use the class to display connection speed and line quality data when the user moves the pointer onto a control that displays Internet connection status. + + The class can be used in any container. To explicitly specify a container, use the constructor. A single component typically is used to create ToolTips for multiple controls on a single form. After you create a , use a separate call to the method to associate ToolTip display text to an individual control. Then when the user moves the pointer on a control, the ToolTip with its text is displayed. You can call more than once for the same control to change the text that is associated with the control. To get the text that is associated with a control, use the method. To remove all ToolTip text associations with an instance of the class, use the method. + > [!NOTE] -> ToolTip text is not displayed for controls that are disabled. Unless the property is set to `true`, ToolTips are not displayed when their container is inactive. - - The class provides the following properties and methods to modify the default behavior and appearance of a ToolTip. - -|Category|Associated members| -|--------------|------------------------| -|Manual display|, , , , , | -|ToolTip timing|, , , , | -|Content|, , , , , | -|Appearance|, , , , , | - - If you want to disable all ToolTip text so that it cannot be displayed in your application, you can use the property. Usually the ToolTip is drawn by the operating system, but to customize the appearance of the , you can set the property to `true` and handle the event. - - The class implements the interface, which has a single method, . ToolTips extend controls on the same form at design time, adding a `ToolTip` property. For more information about extender providers, see [Extender Providers](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ms171835(v=vs.120)). - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . - +> ToolTip text is not displayed for controls that are disabled. Unless the property is set to `true`, ToolTips are not displayed when their container is inactive. + + The class provides the following properties and methods to modify the default behavior and appearance of a ToolTip. + +|Category|Associated members| +|--------------|------------------------| +|Manual display|, , , , , | +|ToolTip timing|, , , , | +|Content|, , , , , | +|Appearance|, , , , , | + + If you want to disable all ToolTip text so that it cannot be displayed in your application, you can use the property. Usually the ToolTip is drawn by the operating system, but to customize the appearance of the , you can set the property to `true` and handle the event. + + The class implements the interface, which has a single method, . ToolTips extend controls on the same form at design time, adding a `ToolTip` property. For more information about extender providers, see [Extender Providers](https://learn.microsoft.com/previous-versions/visualstudio/visual-studio-2013/ms171835(v=vs.120)). + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to always be display regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> Extender Providers - ToolTip Component (Windows Forms) + ToolTip Component (Windows Forms) @@ -122,20 +122,20 @@ Initializes a new instance of the without a specified container. - class. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . - + class. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -169,11 +169,11 @@ An that represents the container of the . Initializes a new instance of the class with a specified container. - constructor enables you to associate a with any object. By associating the in this manner, you hand over control of the lifetime of the ToolTip to the . This can be useful if you use several components in your application, and want to dispose of all of them at the same time. For example, if you associate a , an , and a with a , calling on the will also force disposal of all of these components. - + constructor enables you to associate a with any object. By associating the in this manner, you hand over control of the lifetime of the ToolTip to the . This can be useful if you use several components in your application, and want to dispose of all of them at the same time. For example, if you associate a , an , and a with a , calling on the will also force disposal of all of these components. + ]]> @@ -217,11 +217,11 @@ if the ToolTip is currently active; otherwise, . The default is . - property, you can enable or disable the display of ToolTip text for all controls that have text specified by this particular component. Although more than one component can be created and assigned to a form, setting the property to `false` only affects the current . You can enable users to set the value of this property in a form that provides application options. These options, in turn, provide the user with the ability to enable or disable the display of ToolTips in your application. - + property, you can enable or disable the display of ToolTip text for all controls that have text specified by this particular component. Although more than one component can be created and assigned to a form, setting the property to `false` only affects the current . You can enable users to set the value of this property in a form that provides application options. These options, in turn, provide the user with the ability to enable or disable the display of ToolTips in your application. + ]]> @@ -271,19 +271,19 @@ Gets or sets the automatic delay for the ToolTip. The automatic delay, in milliseconds. The default is 500. - property enables you to set a single delay value, which is then used to set the values of the , , and properties. Each time the property is set, the following values are set by default. - -|Property|Default Value| -|--------------|-------------------| -||10 times the property value.| -||Equal to the property value.| -||1/5 of the property value.| - - These properties can also be set independently once the property has been set. For more information, see the , , and properties. This property is typically used to provide a consistent delay pattern for your ToolTip windows. - + property enables you to set a single delay value, which is then used to set the values of the , , and properties. Each time the property is set, the following values are set by default. + +|Property|Default Value| +|--------------|-------------------| +||10 times the property value.| +||Equal to the property value.| +||1/5 of the property value.| + + These properties can also be set independently once the property has been set. For more information, see the , , and properties. This property is typically used to provide a consistent delay pattern for your ToolTip windows. + ]]> @@ -330,24 +330,24 @@ Gets or sets the period of time the ToolTip remains visible if the pointer is stationary on a control with specified ToolTip text. The period of time, in milliseconds, that the remains visible when the pointer is stationary on a control. The default value is 5000. - property enables you to shorten or lengthen the time that the window is displayed when the pointer is on a control. For example, if you display extensive Help in a ToolTip window, you can increase the value of this property to ensure that the user has sufficient time to read the text. - - If you want to have a consistent delay pattern for your ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single value. Every time the property is set, the property is set to 10 times the property value. Once the property is set, you can independently set the property, overriding the default value. - - The maximum time you can delay a popup is 5000 milliseconds. For longer durations, use the method to control the exact moment when the ToolTip is displayed. - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . - + property enables you to shorten or lengthen the time that the window is displayed when the pointer is on a control. For example, if you display extensive Help in a ToolTip window, you can increase the value of this property to ensure that the user has sufficient time to read the text. + + If you want to have a consistent delay pattern for your ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single value. Every time the property is set, the property is set to 10 times the property value. Once the property is set, you can independently set the property, overriding the default value. + + The maximum time you can delay a popup is 5000 milliseconds. For longer durations, use the method to control the exact moment when the ToolTip is displayed. + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -393,13 +393,13 @@ Gets or sets the background color for the ToolTip. The background . - property. - + property. + ]]> @@ -443,11 +443,11 @@ if the class can offer one or more extender properties; otherwise, . - method is the only member of the interface. This method returns `true` if the `target` parameter is of type . - + method is the only member of the interface. This method returns `true` if the `target` parameter is of type . + ]]> @@ -479,14 +479,14 @@ Gets the creation parameters for the ToolTip window. A containing the information needed to create the ToolTip. - property should only be extended when you are wrapping a standard Windows control class or to set styles not provided by the namespace. For more information about creating control parameters, see [CreateWindowA](/windows/win32/api/winuser/nf-winuser-createwindowa), [CreateWindowEx](/windows/win32/api/winuser/nf-winuser-createwindowexa), and [CREATESTRUCT](/windows/win32/api/winuser/ns-winuser-createstructa). - + > [!NOTE] -> When overriding the property in a derived class, use the base class's property to extend the base implementation. - +> When overriding the property in a derived class, use the base class's property to extend the base implementation. + ]]> @@ -558,24 +558,24 @@ Occurs when the ToolTip is drawn and the property is set to and the property is . - event, you can customize the appearance of the . - - The event is raised by the class when the is drawn and the property value is `true` and the property is `false`. The class contains all the information needed to paint the , including the ToolTip text, the , and the object on which the drawing should be done. To customize the look of the ToolTip, use the to determine the bounds of the ToolTip, and the object to perform your customized drawing. You can increase the bounds of the before it is shown by handling the event. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to custom draw the . The example creates a and associates it to three controls located on the . The example sets the property to `true` and handles the event. In the event handler, the is custom drawn differently, depending on what button the is being displayed for as indicated by the property. - + event, you can customize the appearance of the . + + The event is raised by the class when the is drawn and the property value is `true` and the property is `false`. The class contains all the information needed to paint the , including the ToolTip text, the , and the object on which the drawing should be done. To customize the look of the ToolTip, use the to determine the bounds of the ToolTip, and the object to perform your customized drawing. You can increase the bounds of the before it is shown by handling the event. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to custom draw the . The example creates a and associates it to three controls located on the . The example sets the property to `true` and handles the event. In the event handler, the is custom drawn differently, depending on what button the is being displayed for as indicated by the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DrawToolTipEventArgs/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: + ]]> @@ -614,11 +614,11 @@ Releases the unmanaged resources and performs other cleanup operations before the is reclaimed by the garbage collector. - . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). - + . Application code should not call this method; an object's method is automatically invoked during garbage collection, unless finalization by the garbage collector has been disabled by a call to the method. For more information, see [Finalize Methods and Destructors](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/0s71x931(v%3dvs.100)), [Cleaning Up Unmanaged Resources](/dotnet/standard/garbage-collection/unmanaged), and [Overriding the Finalize Method](https://learn.microsoft.com/previous-versions/dotnet/netframework-4.0/ddae83kx(v=vs.100)). + ]]> @@ -662,11 +662,11 @@ Gets or sets the foreground color for the ToolTip. The foreground . - and properties to modify the color scheme used by ToolTips. The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the property. - + and properties to modify the color scheme used by ToolTips. The system default font is automatically used and can only be overridden by owner-drawing the ToolTip. For more information, see the property. + ]]> @@ -729,11 +729,11 @@ Retrieves the ToolTip text associated with the specified control. A containing the ToolTip text for the specified control. - method, you can retrieve the ToolTip text for any control. If the ToolTip text changes dynamically in an application, you can use this method to find out what text is displayed at any point, depending on the state of the application. To change the text that a control is displaying, use the method. - + method, you can retrieve the ToolTip text for any control. If the ToolTip text changes dynamically in an application, you can use this method to find out what text is displayed at any point, depending on the state of the application. To change the text that a control is displaying, use the method. + ]]> @@ -772,13 +772,13 @@ The of the associated window or control that the ToolTip is associated with. Hides the specified ToolTip window. - method hides the ToolTip for the specified if it is currently being displayed. It does not disable or otherwise prevent the same ToolTip from being displayed in the future. To instead disable all ToolTip windows associated with the current component, set the property to `false`. - - Applications running in partial trust must assert the permission to use this method, as can hide the tip independent of user action. - + method hides the ToolTip for the specified if it is currently being displayed. It does not disable or otherwise prevent the same ToolTip from being displayed in the future. To instead disable all ToolTip windows associated with the current component, set the property to `false`. + + Applications running in partial trust must assert the permission to use this method, as can hide the tip independent of user action. + ]]> @@ -833,24 +833,24 @@ Gets or sets the time that passes before the ToolTip appears. The period of time, in milliseconds, that the pointer must remain stationary on a control before the ToolTip window is displayed. - property, you can shorten or lengthen the time that the waits before displaying a ToolTip window. If the value of the property is set to a value that is too long in duration, the user of your application might not know that your application provides ToolTip Help. You can use this property to ensure that the user has ToolTips displayed quickly by shortening the time specified. - - The value for this property cannot exceed 32767. - - If you want to have a consistent delay pattern for your ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single time value. Every time the property is set, the property is set to the same value as the property. Once the property is set, you can independently set the property, overriding the default value. - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . - + property, you can shorten or lengthen the time that the waits before displaying a ToolTip window. If the value of the property is set to a value that is too long in duration, the user of your application might not know that your application provides ToolTip Help. You can use this property to ensure that the user has ToolTips displayed quickly by shortening the time specified. + + The value for this property cannot exceed 32767. + + If you want to have a consistent delay pattern for your ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single time value. Every time the property is set, the property is set to the same value as the property. Once the property is set, you can independently set the property, overriding the default value. + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -897,11 +897,11 @@ if a balloon window should be used; otherwise, if a standard rectangular window should be used. The default is . - property to `true`, the ToolTip will be displayed using a balloon window. - + property to `true`, the ToolTip will be displayed using a balloon window. + ]]> @@ -955,22 +955,22 @@ if the is drawn by code that you provide; if the is drawn by the operating system. The default is . - is drawn by the operating system, but to customize the appearance of the you can set the property to `true` and handle the event. - - The property takes precedence over the property. If both are set to `true`, the will be displayed using a balloon window rather than an owner drawn window. - - - -## Examples - The following code example demonstrates how to owner draw the . The example creates a and associates it to three controls located on the . The example sets the property to `true` and handles the event. In the event handler, the is custom drawn differently depending upon what button the is being displayed for as indicated by the property. - + is drawn by the operating system, but to customize the appearance of the you can set the property to `true` and handle the event. + + The property takes precedence over the property. If both are set to `true`, the will be displayed using a balloon window rather than an owner drawn window. + + + +## Examples + The following code example demonstrates how to owner draw the . The example creates a and associates it to three controls located on the . The example sets the property to `true` and handles the event. In the event handler, the is custom drawn differently depending upon what button the is being displayed for as indicated by the property. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/DrawToolTipEventArgs/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.ToolTip.OwnerDraw/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1013,23 +1013,23 @@ Occurs before a ToolTip is initially displayed. This is the default event for the class. - event is raised whenever a ToolTip is displayed, either through an explicit call to one of the methods or when the class implicitly displays a ToolTip. This event can be canceled. - - Calling properties in this event that cause the underlying window handle to be recreated, such as , will result in an exception being thrown. - - - -## 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 type named `ToolTip1`. Then ensure that the event handler is associated with the event. - + event is raised whenever a ToolTip is displayed, either through an explicit call to one of the methods or when the class implicitly displays a ToolTip. This event can be canceled. + + Calling properties in this event that cause the underlying window handle to be recreated, such as , will result in an exception being thrown. + + + +## 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 type named `ToolTip1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet619"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet619"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet619"::: + ]]> @@ -1067,11 +1067,11 @@ Removes all ToolTip text currently associated with the ToolTip component. - component for all associated controls. To disable the display of text instead, use the property. To change the text for a single associated control, use the method. - + component for all associated controls. To disable the display of text instead, use the property. To change the text for a single associated control, use the method. + ]]> @@ -1120,22 +1120,22 @@ Gets or sets the length of time that must transpire before subsequent ToolTip windows appear as the pointer moves from one control to another. The length of time, in milliseconds, that it takes subsequent ToolTip windows to appear. - property, you can shorten or lengthen the time that the waits before displaying a ToolTip window after a previous ToolTip window is displayed. The first time a ToolTip window is displayed, the value of the property is used to determine the delay to apply before initially showing the ToolTip window. When a ToolTip window is currently being displayed and the user moves the pointer to another control that displays a ToolTip window, the value of the property is used before showing the ToolTip for the new control. The ToolTip window from the previous control must still be displayed in order for the delay specified in the property to be used; otherwise the property value is used. - - If you want to have a consistent delay pattern for ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single time value. Every time the property is set, the property is set to 1/5 of the property value. Once the property is set, you can independently set the property, overriding the default value. - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . - + property, you can shorten or lengthen the time that the waits before displaying a ToolTip window after a previous ToolTip window is displayed. The first time a ToolTip window is displayed, the value of the property is used to determine the delay to apply before initially showing the ToolTip window. When a ToolTip window is currently being displayed and the user moves the pointer to another control that displays a ToolTip window, the value of the property is used before showing the ToolTip for the new control. The ToolTip window from the previous control must still be displayed in order for the delay specified in the property to be used; otherwise the property value is used. + + If you want to have a consistent delay pattern for ToolTip windows, you can set the property. The property sets the , , and properties to initial values based on a single time value. Every time the property is set, the property is set to 1/5 of the property value. Once the property is set, you can independently set the property, overriding the default value. + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1,` and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1185,22 +1185,22 @@ The ToolTip text to display when the pointer is on the control. Associates ToolTip text with the specified control. - method more than once for a given control does not specify multiple ToolTip text to display for a control, but instead changes the current ToolTip text for the control. To determine the ToolTip text that is associated with a control at run time, use the method. - - As a general rule the text used should be short; however, you can insert line breaks by using the `\r\n` escape character sequence. Ampersands (&) in the text are handled as described by the property. - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . This example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . - + method more than once for a given control does not specify multiple ToolTip text to display for a control, but instead changes the current ToolTip text for the control. To determine the ToolTip text that is associated with a control at run time, use the method. + + As a general rule the text used should be short; however, you can insert line breaks by using the `\r\n` escape character sequence. Ampersands (&) in the text are handled as described by the property. + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . This example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1258,13 +1258,13 @@ The to display the ToolTip for. Sets the ToolTip text associated with the specified control, and displays the ToolTip modally. - method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the method is called, or until the parent form is minimized, hidden, or closed. The ToolTip is positioned in the center of the associated control. - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the method is called, or until the parent form is minimized, hidden, or closed. The ToolTip is positioned in the center of the associated control. + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> The parameter is . @@ -1320,13 +1320,13 @@ A containing the offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip. Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position. - method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the method is called, or until the parent form is minimized, hidden, or dismissed. - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + method displays the ToolTip for the specified control modally; that is, the ToolTip will be displayed until the method is called, or until the parent form is minimized, hidden, or dismissed. + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> The parameter is . @@ -1382,13 +1382,13 @@ An containing the duration, in milliseconds, to display the ToolTip. Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration. - overloaded version of this method instead. - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + overloaded version of this method instead. + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> The parameter is . @@ -1448,13 +1448,13 @@ An containing the duration, in milliseconds, to display the ToolTip. Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position. - overloaded version of this method instead. - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + overloaded version of this method instead. + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> The parameter is . @@ -1514,13 +1514,13 @@ The vertical offset, in pixels, relative to the upper-left corner of the associated control window, to display the ToolTip. Sets the ToolTip text associated with the specified control, and then displays the ToolTip modally at the specified relative position. - method operates identically to the version, except that the offset is specified as separate x- and y-coordinates instead of a . - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + method operates identically to the version, except that the offset is specified as separate x- and y-coordinates instead of a . + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> @@ -1579,13 +1579,13 @@ An containing the duration, in milliseconds, to display the ToolTip. Sets the ToolTip text associated with the specified control, and then displays the ToolTip for the specified duration at the specified relative position. - method operates identically to the version, except that the offset is specified as separate x and y coordinates instead of a . To display the ToolTip modally, call the overloaded version of this method instead. - - Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. - + method operates identically to the version, except that the offset is specified as separate x and y coordinates instead of a . To display the ToolTip modally, call the overloaded version of this method instead. + + Applications running in partial trust must assert the permission to use this method, as can control the display and location of a ToolTip independent of user action. + ]]> The parameter is . @@ -1644,20 +1644,20 @@ if the ToolTip is always displayed; otherwise, . The default is . - property, you can display a ToolTip window even when the container of the is not active. You can use this feature in a modeless window application to enable ToolTip windows to be displayed regardless of which modeless window is active. This feature is also useful when you want to create a control by using the , which contains a number of controls within it that display ToolTip windows. Because the is often not the active window on a form, setting this property to `true` enables the controls within the to display ToolTip windows at any time. - - - -## Examples - The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . - + property, you can display a ToolTip window even when the container of the is not active. You can use this feature in a modeless window application to enable ToolTip windows to be displayed regardless of which modeless window is active. This feature is also useful when you want to create a control by using the , which contains a number of controls within it that display ToolTip windows. Because the is often not the active window on a form, setting this property to `true` enables the controls within the to display ToolTip windows at any time. + + + +## Examples + The following code example creates an instance of the class and associates the instance with the that the instance is created within. The code then initializes the delay properties , , and . In addition the instance of the class sets the property to `true` to enable ToolTip text to be displayed regardless of whether the form is active. Finally, the example associates ToolTip text with two controls on a form, a and a . The code example requires that the method defined in the example is located within a that contains a control named `button1` and a control named `checkBox1`, and that the method is called from the constructor of the . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/ToolTip Example/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolTip/Overview/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/ToolTip Example/VB/form1.vb" id="Snippet1"::: + ]]> @@ -1691,11 +1691,11 @@ Stops the timer that hides displayed ToolTips. - class has an internal timer that it uses to set the display duration for ToolTips. Set the duration of the timer through the property. The method stops this internal timer, causing any displayed ToolTip to be shown modally until the method is called or the parent form is minimized, hidden, or closed. - + class has an internal timer that it uses to set the display duration for ToolTips. Set the duration of the timer through the property. The method stops this internal timer, causing any displayed ToolTip to be shown modally until the method is called or the parent form is minimized, hidden, or closed. + ]]> @@ -1745,11 +1745,11 @@ if ampersand characters are stripped from the ToolTip text; otherwise, . The default is false. - property to `true` removes all ampersands from the ToolTip text. - + property to `true` removes all ampersands from the ToolTip text. + ]]> @@ -1817,11 +1817,11 @@ Gets or sets the object that contains programmer-supplied data associated with the . An that contains data about the . The default is . - property to store data that is closely associated with the . For example, if you are displaying a for a control that displays customer information, you might store the that contains the customer's information in the property so the data can be accessed quickly. - + property to store data that is closely associated with the . For example, if you are displaying a for a control that displays customer information, you might store the that contains the customer's information in the property so the data can be accessed quickly. + ]]> @@ -1867,11 +1867,11 @@ Gets or sets a value that defines the type of icon to be displayed alongside the ToolTip text. One of the enumerated values. - enumeration, you must owner-draw the entire ToolTip. For more information, see the property. - + enumeration, you must owner-draw the entire ToolTip. For more information, see the property. + ]]> @@ -1923,13 +1923,13 @@ Gets or sets a title for the ToolTip window. A containing the window title. - @@ -1967,11 +1967,11 @@ Returns a string representation for this control. A containing a description of the . - method displays the class name, followed by the values of the and properties. - + method displays the class name, followed by the values of the and properties. + ]]> diff --git a/xml/System.Windows.Forms/TrackBarRenderer.xml b/xml/System.Windows.Forms/TrackBarRenderer.xml index ce20cf90dbd..9c333e9714f 100644 --- a/xml/System.Windows.Forms/TrackBarRenderer.xml +++ b/xml/System.Windows.Forms/TrackBarRenderer.xml @@ -33,24 +33,24 @@ Provides methods used to render a track bar control with visual styles. This class cannot be inherited. - class provides a set of `static` methods that can be used to render each part of a track bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. - - If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods in this class will draw the track bar with the current visual style. Otherwise, the methods in this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. - - This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - - - -## Examples - The following code example demonstrates how to create a custom control that uses the methods to draw a horizontal track bar that responds to mouse clicks. - + class provides a set of `static` methods that can be used to render each part of a track bar control with the current visual style of the operating system. Rendering a control refers to drawing the user interface of a control. This is useful if you are drawing a custom control that should have the appearance of the current visual style. + + If visual styles are enabled in the operating system and visual styles are applied to the client area of application windows, the methods in this class will draw the track bar with the current visual style. Otherwise, the methods in this class will throw an . To determine whether the members of this class can be used, you can check the value of the property. + + This class wraps the functionality of a that is set to one of the elements exposed by the class. For more information, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + + + +## Examples + The following code example demonstrates how to create a custom control that uses the methods to draw a horizontal track bar that responds to mouse clicks. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet0"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet0"::: + ]]> @@ -90,21 +90,21 @@ One of the values that specifies the visual state of the track bar slider. Draws a downward-pointing track bar slider (also known as the thumb) with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -141,21 +141,21 @@ One of the values that specifies the visual state of the track bar slider. Draws a horizontal track bar slider (also known as the thumb) with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -194,23 +194,23 @@ One of the values. Draws the specified number of horizontal track bar ticks with visual styles. - property is `true`. - - If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, returns without rendering. - + property is `true`. + + If width or height of the bounding rectangle or the number of ticks is less than or equal to zero, or `g` is `null`, returns without rendering. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -245,30 +245,30 @@ The that specifies the bounds of the track. Draws the track for a horizontal track bar with visual styles. - property is `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw a track bar. This code example is part of a larger example provided for the class. - + property is `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw a track bar. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -305,21 +305,21 @@ One of the values that specifies the visual state of the track bar slider. Draws a left-pointing track bar slider (also known as the thumb) with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -356,21 +356,21 @@ One of the values that specifies the visual state of the track bar slider. Draws a right-pointing track bar slider (also known as the thumb) with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -407,30 +407,30 @@ One of the values that specifies the visual state of the track bar slider. Draws an upward-pointing track bar slider (also known as the thumb) with visual styles. - property is `true`. - - - -## Examples - The following code example uses the method in a custom control's method to draw an upward-pointing track bar slider. This code example is part of a larger example provided for the class. - + property is `true`. + + + +## Examples + The following code example uses the method in a custom control's method to draw an upward-pointing track bar slider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -467,21 +467,21 @@ One of the values that specifies the visual state of the track bar slider. Draws a vertical track bar slider (also known as the thumb) with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -520,23 +520,23 @@ One of the values. Draws the specified number of vertical track bar ticks with visual styles. - returns without rendering. - - Before calling this method, you should verify that the value of the property is `true`. - + returns without rendering. + + Before calling this method, you should verify that the value of the property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -571,21 +571,21 @@ The that specifies the bounds of the track. Draws the track for a vertical track bar with visual styles. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -621,23 +621,23 @@ Returns the size, in pixels, of the track bar slider (also known as the thumb) that points down. A that specifies the size, in pixels, of the slider. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -673,23 +673,23 @@ Returns the size, in pixels, of the track bar slider (also known as the thumb) that points to the left. A that specifies the size, in pixels, of the slider. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -725,23 +725,23 @@ Returns the size, in pixels, of the track bar slider (also known as the thumb) that points to the right. A that specifies the size, in pixels, of the slider. - property is `true`. - + property is `true`. + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -777,32 +777,32 @@ Returns the size, in pixels, of the track bar slider (also known as the thumb) that points up. A that specifies the size, in pixels, of the slider. - property is `true`. - - - -## Examples - The following code example uses the method to determine the size of the rectangle used by the method to draw the slider. This code example is part of a larger example provided for the class. - + property is `true`. + + + +## Examples + The following code example uses the method to determine the size of the rectangle used by the method to draw the slider. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet2"::: + ]]> - The operating system does not support visual styles. - - -or- - - Visual styles are disabled by the user in the operating system. - - -or- - + The operating system does not support visual styles. + + -or- + + Visual styles are disabled by the user in the operating system. + + -or- + Visual styles are not applied to the client area of application windows. @@ -833,20 +833,20 @@ if the user has enabled visual styles in the operating system and visual styles are applied to the client area of application windows; otherwise, . - . - - - -## Examples - The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. - + . + + + +## Examples + The following code example uses the property to determine whether to use the methods. This code example is part of a larger example provided for the class. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/cpp/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TrackBarRenderer/Overview/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TrackBarRenderer/VB/form1.vb" id="Snippet4"::: + ]]> diff --git a/xml/System.Windows.Forms/TreeNode.xml b/xml/System.Windows.Forms/TreeNode.xml index f79134c6b9b..63c9183e174 100644 --- a/xml/System.Windows.Forms/TreeNode.xml +++ b/xml/System.Windows.Forms/TreeNode.xml @@ -53,35 +53,35 @@ Represents a node of a . - collection holds all the child objects assigned to the current . You can add, remove, or clone a ; when you do this, all child tree nodes are added, removed, or cloned. Each can contain a collection of other objects. This can make it difficult to determine where you are in the when iterating through the collection. To determine your location in a tree structure, use the property. The string can be parsed using the string value to determine where a label begins and ends. - - The label is set by setting the property explicitly. The alternative is to create the tree node using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed. - - To display images next to the tree nodes, assign an to the property of the parent control and assign an by referencing its index value in the property. Set the property to the index value of the you want to display when the is in an unselected state. Likewise, set the property to the index value of the you want to display when the is selected. - - Selecting specific tree nodes and iterating through the collection can be achieved by using the following property values: , , , , , . Assign the returned by one of aforementioned properties to the property to select that tree node in the control. - - Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the by pressing the plus (+) button next to the , if one is displayed, or you can expand the by calling the method. To expand all child tree node levels in the collection, call the method. You can collapse the child level by calling the method, or the user can press the minus (-) button next to the , if one is displayed. You can also call the method to alternate the between the expanded and collapsed states. - - Tree nodes can optionally display a check box. To display the check boxes, set the property of the to `true`. The property is set to `true` for tree nodes that are in a checked state. - - - -## Examples - The following code example displays customer information in a control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the is suppressed by using the and methods, and a wait is displayed while the creates and paints the objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a control on a . - + collection holds all the child objects assigned to the current . You can add, remove, or clone a ; when you do this, all child tree nodes are added, removed, or cloned. Each can contain a collection of other objects. This can make it difficult to determine where you are in the when iterating through the collection. To determine your location in a tree structure, use the property. The string can be parsed using the string value to determine where a label begins and ends. + + The label is set by setting the property explicitly. The alternative is to create the tree node using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed. + + To display images next to the tree nodes, assign an to the property of the parent control and assign an by referencing its index value in the property. Set the property to the index value of the you want to display when the is in an unselected state. Likewise, set the property to the index value of the you want to display when the is selected. + + Selecting specific tree nodes and iterating through the collection can be achieved by using the following property values: , , , , , . Assign the returned by one of aforementioned properties to the property to select that tree node in the control. + + Tree nodes can be expanded to display the next level of child tree nodes. The user can expand the by pressing the plus (+) button next to the , if one is displayed, or you can expand the by calling the method. To expand all child tree node levels in the collection, call the method. You can collapse the child level by calling the method, or the user can press the minus (-) button next to the , if one is displayed. You can also call the method to alternate the between the expanded and collapsed states. + + Tree nodes can optionally display a check box. To display the check boxes, set the property of the to `true`. The property is set to `true` for tree nodes that are in a checked state. + + + +## Examples + The following code example displays customer information in a control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the is suppressed by using the and methods, and a wait is displayed while the creates and paints the objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a control on a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Cursor/Overview/treeview.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: + ]]> - How to: Add and Remove Nodes with the Windows Forms TreeView Control + How to: Add and Remove Nodes with the Windows Forms TreeView Control @@ -116,15 +116,15 @@ Initializes a new instance of the class. - is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. - + is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]> @@ -165,20 +165,20 @@ The label of the new tree node. Initializes a new instance of the class with the specified label text. - property and becomes the tree node label. - - - -## Examples - The following code example displays customer information in a control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the is suppressed by using the and methods, and a wait is displayed while the creates and paints the objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a control on a . - + property and becomes the tree node label. + + + +## Examples + The following code example displays customer information in a control. The root tree nodes display customer names, and the child tree nodes display the order numbers assigned to each customer. In this example, 1,000 customers are displayed with 15 orders each. The repainting of the is suppressed by using the and methods, and a wait is displayed while the creates and paints the objects. This example requires that you have a `Customer` object that can hold a collection of `Order` objects. It also requires that you have created an instance of a control on a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeView/CPP/treeview.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/Cursor/Overview/treeview.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeView/VB/treeview.vb" id="Snippet1"::: + ]]> @@ -252,20 +252,20 @@ An array of child objects. Initializes a new instance of the class with the specified label text and child tree nodes. - property and becomes the tree node label. The tree nodes that are contained in the `children` array are added to the that is stored in the property. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. - + property and becomes the tree node label. The tree nodes that are contained in the `children` array are added to the that is stored in the property. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]> @@ -304,20 +304,20 @@ The index value of to display when the tree node is selected. Initializes a new instance of the class with the specified label text and images to display when the tree node is in a selected and unselected state. - property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an stored in the assigned to the property. The image referenced in the `imageIndex` property is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` property is displayed when the tree node is in a selected state. - - - -## Examples - The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an stored in the assigned to the property. The image referenced in the `imageIndex` property is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` property is displayed when the tree node is in a selected state. + + + +## Examples + The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]> @@ -365,20 +365,20 @@ An array of child objects. Initializes a new instance of the class with the specified label text, child tree nodes, and images to display when the tree node is in a selected and unselected state. - property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an stored in the assigned to the property. The image referenced in the `imageIndex` parameter is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` parameter is displayed when the tree node is in a selected state. The tree nodes that are contained in the `children` array are added to the that is stored in the property. - - - -## Examples - The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + property and becomes the tree node label. The `imageIndex` and `selectedImageIndex` values are the index values of an stored in the assigned to the property. The image referenced in the `imageIndex` parameter is displayed when the tree node is not selected. Likewise, the image referenced in the `selectedImageIndex` parameter is displayed when the tree node is in a selected state. The tree nodes that are contained in the `children` array are added to the that is stored in the property. + + + +## Examples + The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]> @@ -412,20 +412,20 @@ Gets or sets the background color of the tree node. The background of the tree node. The default is . - property is set to , the used is the property value of the control that the tree node is assigned to. - - - -## Examples - The following code example highlights any objects a control that has its property set to `true` by setting its property to . This code requires that you have a control on a with a collection of objects. - + property is set to , the used is the property value of the control that the tree node is assigned to. + + + +## Examples + The following code example highlights any objects a control that has its property set to `true` by setting its property to . This code requires that you have a control on a with a collection of objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Checked/CPP/treenode_checked.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/BackColor/treenode_checked.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: + ]]> @@ -458,23 +458,23 @@ Initiates the editing of the tree node label. - event of a or . - + event of a or . + > [!NOTE] -> This method only works if the property of the is set to `true`. If is set to `false`, an exception is thrown and the tree node will not be put into an editable state. - - - -## Examples - The following code example lets the user edit nonroot tree nodes by using a . When the user right-clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - +> This method only works if the property of the is set to `true`. If is set to `false`, an exception is thrown and the tree node will not be put into an editable state. + + + +## Examples + The following code example lets the user edit nonroot tree nodes by using a . When the user right-clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -516,20 +516,20 @@ Gets the bounds of the tree node. The that represents the bounds of the tree node. - control. - - - -## Examples - The following code example changes the size to the specified size and adjusts the of the tree node's parent control. This example requires that you have a that contains a control with a collection of objects, and a that contains font sizes. - + control. + + + +## Examples + The following code example changes the size to the specified size and adjusts the of the tree node's parent control. This example requires that you have a that contains a control with a collection of objects, and a that contains font sizes. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: + ]]> @@ -572,15 +572,15 @@ if the tree node is in a checked state; otherwise, . - objects a control that has its property set to `true` by setting its property to . This code requires that you have a control on a with a collection of objects. - + objects a control that has its property set to `true` by setting its property to . This code requires that you have a control on a with a collection of objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Checked/CPP/treenode_checked.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/BackColor/treenode_checked.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Checked/VB/treenode_checked.vb" id="Snippet1"::: + ]]> @@ -617,22 +617,22 @@ Copies the tree node and the entire subtree rooted at this tree node. The that represents the cloned . - being cloned are included in the new tree node and subtree. - - The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value. - - - -## Examples - The following code example clones the last child tree node of the last root tree node and inserts the clone as the first root tree node in the `TreeNodeCollection`. This example requires that you have a control on a that contains a collection of objects and a . - + being cloned are included in the new tree node and subtree. + + The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value. + + + +## Examples + The following code example clones the last child tree node of the last root tree node and inserts the clone as the first root tree node in the `TreeNodeCollection`. This example requires that you have a control on a that contains a collection of objects and a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet3"::: + ]]> @@ -680,23 +680,23 @@ Collapses the tree node. - method collapses the current and its child nodes. If you want to collapse only the current , use the overload, passing `true` to ignore its child nodes. - + method collapses the current and its child nodes. If you want to collapse only the current , use the overload, passing `true` to ignore its child nodes. + > [!NOTE] -> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . - +> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]> @@ -741,11 +741,11 @@ to leave the child nodes in their current state; to collapse the child nodes. Collapses the and optionally collapses its children. - method, passing `true`, when you want to collapse a node but leave its child nodes in their expanded state. - + method, passing `true`, when you want to collapse a node but leave its child nodes in their expanded state. + ]]> @@ -784,11 +784,11 @@ Gets the shortcut menu that is associated with this tree node. The that is associated with the tree node. - property. - + property. + ]]> @@ -838,11 +838,11 @@ Gets or sets the shortcut menu associated with this tree node. The associated with the tree node. - @@ -911,15 +911,15 @@ if the editing of the tree node label text was canceled without being saved; otherwise, . Ends the editing of the tree node label. - . When the user right clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - + . When the user right clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, allowing the user to edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -953,23 +953,23 @@ Ensures that the tree node is visible, expanding tree nodes and scrolling the tree view control as necessary. - method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the . This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node. - + method is called, the tree is expanded and scrolled to ensure that the current tree node is visible in the . This method is useful if you are selecting a tree node in code based on certain criteria. By calling this method after you select the node, the user can see and interact with the selected node. + > [!NOTE] -> If the property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results. - - - -## Examples - The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a control on a that contains a collection of objects, and a . There should be enough tree nodes so that they are not all visible in the tree view control. - +> If the property is set to a value that is larger than the height of the tree view control, calling this method has unexpected results. + + + +## Examples + The following code example brings the last child tree node of the last root tree node into view in the tree view when a button is clicked. This example requires that you have a control on a that contains a collection of objects, and a . There should be enough tree nodes so that they are not all visible in the tree view control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: + ]]> @@ -1004,23 +1004,23 @@ Expands the tree node. - method expands the current down to the next level of nodes. - + method expands the current down to the next level of nodes. + > [!NOTE] -> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . - +> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example toggles the selected node when a button is clicked. If the selected node is collapsed, it is expanded, if it is expanded by calling the method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]> @@ -1056,23 +1056,23 @@ Expands all the child tree nodes. - method expands all the child tree nodes assigned to the collection. - + method expands all the child tree nodes assigned to the collection. + > [!NOTE] -> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example expands all the tree nodes in a control when a is checked, and collapses the when the is cleared. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). - +> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example expands all the tree nodes in a control when a is checked, and collapses the when the is cleared. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet1"::: + ]]> @@ -1119,20 +1119,20 @@ Gets the first child tree node in the tree node collection. The first child in the collection. - is the first child in the stored in the property of the current tree node. If the has no child tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + is the first child in the stored in the property of the current tree node. If the has no child tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -1164,20 +1164,20 @@ Gets or sets the foreground color of the tree node. The foreground of the tree node. - used is the property value of the control that the tree node is assigned to. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. - + used is the property value of the control that the tree node is assigned to. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]> @@ -1217,20 +1217,20 @@ Returns the tree node with the specified handle and assigned to the specified tree view control. A that represents the tree node assigned to the specified control with the specified handle. - collection, the control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the method of the to provide custom drawing in response to this notification, you should always check the return value of this method for `null` before you attempt to access the node. - - - -## Examples - The following code example gets the that was collapsed and creates a copy of it using its property. The original is removed from the , and the copy is added to the collection. This example requires that you have a with a control on it. The control should have two or more root nodes, each having at least one child node. - + collection, the control sends an NM_CUSTOMDRAW notification before the node handle is available. If you override the method of the to provide custom drawing in response to this notification, you should always check the return value of this method for `null` before you attempt to access the node. + + + +## Examples + The following code example gets the that was collapsed and creates a copy of it using its property. The original is removed from the , and the copy is added to the collection. This example requires that you have a with a control on it. The control should have two or more root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: + ]]> @@ -1270,20 +1270,20 @@ Gets the path from the root tree node to the current tree node. The path from the root tree node to the current tree node. - property of the control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\\), the property value is "Country\Region\State". - - - -## Examples - The following code example sets the property of a and displays the number of child tree nodes that are contained in the of the . The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). - + property of the control that contains this node. For example, if the delimiter character of the tree view control named "Location" is set to the backslash character, (\\), the property value is "Country\Region\State". + + + +## Examples + The following code example sets the property of a and displays the number of child tree nodes that are contained in the of the . The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: + ]]> The node is not contained in a . @@ -1322,15 +1322,15 @@ Returns the number of child tree nodes. The number of child tree nodes assigned to the collection. - property of a and displays the number of child tree nodes that are contained in the of the . The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). - + property of a and displays the number of child tree nodes that are contained in the of the . The percentage of child tree node to total tree nodes in the tree view control is also displayed. This example requires that you have a with a , and a control with a that has several objects (preferably with three or more levels). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_ForeColor/CPP/treenode_forecolor.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ExpandAll/treenode_forecolor.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_ForeColor/VB/treenode_forecolor.vb" id="Snippet2"::: + ]]> @@ -1370,20 +1370,20 @@ Gets the handle of the tree node. The tree node handle. - property is referenced, it is created. - - - -## Examples - The following code example gets the that was collapsed and creates a copy of it using its property. The original is removed from the , and the copy is added to the collection. This example requires that you have a with a control on it. The control should have two or more root nodes, each having at least one child node. - + property is referenced, it is created. + + + +## Examples + The following code example gets the that was collapsed and creates a copy of it using its property. The original is removed from the , and the copy is added to the collection. This example requires that you have a with a control on it. The control should have two or more root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet3"::: + ]]> @@ -1449,27 +1449,27 @@ Gets or sets the image list index value of the image displayed when the tree node is in the unselected state. A zero-based index value that represents the image position in the assigned . - value is the index value of an stored in the assigned to the property. - + value is the index value of an stored in the assigned to the property. + > [!NOTE] -> The default value of the property is the same as the property of the control that the is assigned to. - +> The default value of the property is the same as the property of the control that the is assigned to. + and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). - +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). + **.NET 5 and later versions:** If the associated property value is changed to `null`, the property returns its default value, -1. However, the assigned value is retained internally and used when another object is assigned to the property. If the new assigned to the property has an property value that is less than or equal to the value assigned to the property minus one (to account for the collection being a zero-based index), the property value is adjusted to one less than the property value. -For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. - -## Examples - The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - +For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. + +## Examples + The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a that contains a , and an that contains `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]> .NET 5 and later: is less than -2. @@ -1538,16 +1538,16 @@ For example, consider a button control whose Gets or sets the key for the image associated with this tree node when the node is in an unselected state. The key for the image associated with this tree node when the node is in an unselected state. - property of the containing control. - - The is case-insensitive. - + property of the containing control. + + The is case-insensitive. + and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). - +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). + ]]> @@ -1585,15 +1585,15 @@ If you set the property, the Gets the position of the tree node in the tree node collection. A zero-based index value that represents the position of the tree node in the collection. - and property values of the represented by the property of the . This example requires that you have a with a control on it. The should have at least two root nodes, each having at least one child node. - + and property values of the represented by the property of the . This example requires that you have a with a control on it. The should have at least two root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: + ]]> @@ -1632,15 +1632,15 @@ If you set the property, the if the tree node is in editable state; otherwise, . - . When the user right clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, letting the user edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. - + . When the user right clicks the mouse, the at that position is determined and stored in a variable named `mySelectedNode`. If a nonroot tree node was selected, it is put into an editable state, letting the user edit the node label. After the user stops editing the tree node label, the new label text is evaluated and saved. For this example, several characters are considered not valid in the label text. If one of the invalid characters is in the label string, or the string is empty, the user is notified of the error and the label is returned to its previous text. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/NodeLabelEditEventArgs/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_CLR_Classic/classic TreeNode.BeginEdit Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -1681,15 +1681,15 @@ If you set the property, the if the tree node is in the expanded state; otherwise, . - method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . - + method, it is collapsed by calling the method. This example requires that you have a with a control that has at least one with at least one child . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet1"::: + ]]> @@ -1730,15 +1730,15 @@ If you set the property, the if the tree node is in the selected state; otherwise, . - after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a containing several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a containing several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -1778,15 +1778,15 @@ If you set the property, the if the tree node is visible or partially visible; otherwise, . - control on a that contains a collection of objects, and a . There should be enough tree nodes so that they are not all visible in the tree view control. - + control on a that contains a collection of objects, and a . There should be enough tree nodes so that they are not all visible in the tree view control. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/CPP/treenode_ensurevisible_4.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Clone/treenode_ensurevisible_4.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_EnsureVisible_4/VB/treenode_ensurevisible_4.vb" id="Snippet2"::: + ]]> @@ -1831,20 +1831,20 @@ If you set the property, the Gets the last child tree node. A that represents the last child tree node. - is the last child in the stored in the property of the current tree node. If the has no child tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + is the last child in the stored in the property of the current tree node. If the has no child tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -1884,11 +1884,11 @@ If you set the property, the Gets the zero-based depth of the tree node in the control. The zero-based depth of the tree node in the control. - property, the root node is considered the first level of nesting and returns 0. - + property, the root node is considered the first level of nesting and returns 0. + ]]> @@ -1925,11 +1925,11 @@ If you set the property, the Gets or sets the name of the tree node. A that represents the name of the tree node. - of a is also the node's key, when the node is part of a . If the node does not have a name, returns an empty string (""). - + of a is also the node's key, when the node is part of a . If the node does not have a name, returns an empty string (""). + ]]> @@ -1972,20 +1972,20 @@ If you set the property, the Gets the next sibling tree node. A that represents the next sibling tree node. - is the next sibling in the stored in the property of the tree node's parent . If there is no next tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + is the next sibling in the stored in the property of the tree node's parent . If there is no next tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -2031,20 +2031,20 @@ If you set the property, the Gets the next visible tree node. A that represents the next visible tree node. - can be a child, sibling, or a tree node from another branch. If there is no next tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + can be a child, sibling, or a tree node from another branch. If there is no next tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -2093,23 +2093,23 @@ If you set the property, the Gets or sets the font that is used to display the text on the tree node label. The that is used to display the text on the tree node label. - used is the property value of the control that this node is attached to. - + used is the property value of the control that this node is attached to. + > [!NOTE] -> If the node font is larger than the property value that is set in the control, the tree node label text is clipped. - - - -## Examples - The following code example changes the size of to the specified size and adjusts the of the tree node's parent control. This example requires that you have a with a control that contains a collection of objects, and a that contains font sizes. - +> If the node font is larger than the property value that is set in the control, the tree node label text is clipped. + + + +## Examples + The following code example changes the size of to the specified size and adjusts the of the tree node's parent control. This example requires that you have a with a control that contains a collection of objects, and a that contains font sizes. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet2"::: + ]]> @@ -2153,20 +2153,20 @@ If you set the property, the Gets the collection of objects assigned to the current tree node. A that represents the tree nodes assigned to the current tree node. - property can hold a collection of other objects. Each of the tree node in the collection has a property that can contain its own . This nesting of tree nodes can make it difficult to navigate a tree structure. The property makes it easier to determine your location in a tree. - - - -## Examples - The following code example removes the selected tree node from one and adds it to another if both tree node collections are not read-only. When a is clicked, the is deleted from one using the method and added to the other using the method. This example requires that you have two controls named `treeView1` and `treeView2`, and a on a . - + property can hold a collection of other objects. Each of the tree node in the collection has a property that can contain its own . This nesting of tree nodes can make it difficult to navigate a tree structure. The property makes it easier to determine your location in a tree. + + + +## Examples + The following code example removes the selected tree node from one and adds it to another if both tree node collections are not read-only. When a is clicked, the is deleted from one using the method and added to the other using the method. This example requires that you have two controls named `treeView1` and `treeView2`, and a on a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNodeCollection/CPP/treenodecollection.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/Nodes/treenodecollection.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNodeCollection/VB/treenodecollection.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNodeCollection/VB/treenodecollection.vb" id="Snippet1"::: + ]]> @@ -2211,20 +2211,20 @@ If you set the property, the Gets the parent tree node of the current tree node. A that represents the parent of the current tree node. - property returns `null`. - - - -## Examples - The following code example displays the and property values of the represented by the property of the . This example requires that you have a with a control on it. The should have at least two root nodes, each having at least one child node. - + property returns `null`. + + + +## Examples + The following code example displays the and property values of the represented by the property of the . This example requires that you have a with a control on it. The should have at least two root nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet2"::: + ]]> @@ -2267,20 +2267,20 @@ If you set the property, the Gets the previous sibling tree node. A that represents the previous sibling tree node. - is the previous sibling in the stored in the property of the tree node's parent . If there is no previous tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + is the previous sibling in the stored in the property of the tree node's parent . If there is no previous tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -2326,20 +2326,20 @@ If you set the property, the Gets the previous visible tree node. A that represents the previous visible tree node. - can be a child, sibling, or a tree node from another branch. If there is no previous tree node, the property returns `null`. - - - -## Examples - The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + can be a child, sibling, or a tree node from another branch. If there is no previous tree node, the property returns `null`. + + + +## Examples + The following code example selects the appropriate after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> @@ -2379,20 +2379,20 @@ If you set the property, the Removes the current tree node from the tree view control. - method is called, the tree node, and any child tree nodes that are assigned to the , are removed from the . The removed child nodes are removed from the but are still attached to this tree node. - - - -## Examples - The following code example removes a when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a with a control on it. The should have two or more root tree nodes, each having at least one child node. - + method is called, the tree node, and any child tree nodes that are assigned to the , are removed from the . The removed child nodes are removed from the but are still attached to this tree node. + + + +## Examples + The following code example removes a when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a with a control on it. The should have two or more root tree nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: + ]]> @@ -2460,27 +2460,27 @@ If you set the property, the Gets or sets the image list index value of the image that is displayed when the tree node is in the selected state. A zero-based index value that represents the image position in an . - value is the index value of an stored in the assigned to the property. - + value is the index value of an stored in the assigned to the property. + and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). - +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, the is automatically set to an empty string (""). + **.NET 5 and later versions:** If the associated property value is changed to `null`, the property returns its default value, -1. However, the assigned value is retained internally and used when another object is assigned to the property. If the new assigned to the property has an property value that is less than or equal to the value assigned to the property minus one (to account for the collection being a zero-based index), the property value is adjusted to one less than the property value. -For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. - +For example, consider a button control whose has three images and whose property is set to 2. If a new that has only two images is assigned to the button, the value changes to 1. + > [!NOTE] > The default value of the property is the same as the property of the control that the is assigned to. - -## Examples - The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a containing a , and an containing `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. - + +## Examples + The following code example creates and assigns an to a control and fills the control with objects. The tree nodes are assigned images from the that is displayed when the tree node is in a selected or unselected state. This example requires that you have a containing a , and an containing `Customer` objects that each contain `Order` objects. It also requires that the `Customer` and `Order` objects are defined. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_TreeNode/CPP/treenode_treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_TreeNode/VB/treenode_treenode.vb" id="Snippet1"::: + ]]> .NET 5 and later: is less than -2. @@ -2547,13 +2547,13 @@ For example, consider a button control whose Gets or sets the key of the image displayed in the tree node when it is in a selected state. The key of the image displayed when the tree node is in a selected state. - property of the parent control. - + property of the parent control. + and are mutually exclusive, meaning if one is set, the other is set to an invalid value and ignored. -If you set the property, the property is automatically set to -1. Alternatively, if you set the property, is automatically set to an empty string (""). +If you set the property, the property is automatically set to -1. Alternatively, if you set the property, is automatically set to an empty string (""). ]]> @@ -2652,15 +2652,15 @@ If you set the property, t Gets or sets the index of the image that is used to indicate the state of the when the parent has its property set to . The index of the image that is used to indicate the state of the . - property of the parent control. - - If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the . - - The returns -1 when not set. The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string (""). - + property of the parent control. + + If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the . + + The returns -1 when not set. The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string (""). + ]]> The specified index is less than -1 or greater than 14. @@ -2727,15 +2727,15 @@ If you set the property, t Gets or sets the key of the image that is used to indicate the state of the when the parent has its property set to . The key of the image that is used to indicate the state of the . - property of the parent control. - - If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the . - - The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string (""). You should set the to an image with a corresponding index between 0 and 14. You can set the to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed - + property of the parent control. + + If the parent has check boxes enabled, the is ignored and the node will display the first or second image in the set on the parent to indicate an unchecked or checked state, respectively. Toggling the property does not affect the value of the . + + The and properties are mutually exclusive, meaning if one is set, the other is ignored. If you set the property, the property is automatically set to -1. Alternatively, if you set , is automatically set to an empty string (""). You should set the to an image with a corresponding index between 0 and 14. You can set the to an image with an index value greater than 14 (an exception will not be thrown), but the image may not be displayed + ]]> @@ -2842,23 +2842,23 @@ If you set the property, t Gets or sets the object that contains data about the tree node. An that contains data about the tree node. The default is . - derived type can be assigned to this property. If this property is being set through the Windows Forms designer, only text can be assigned. - + derived type can be assigned to this property. If this property is being set through the Windows Forms designer, only text can be assigned. + > [!CAUTION] -> The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. - +> The method performs a shallow copy of the node. If the value of the property is a reference type, both the original and cloned copy will point to the same single instance of the value. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]> @@ -2897,22 +2897,22 @@ If you set the property, t Gets or sets the text displayed in the label of the tree node. The text displayed in the label of the tree node. - can display is 259. If a that has more than 259 characters is assigned to this property, only the first 259 characters are displayed. - - This property cannot be set by the user if the property of the parent is set to `false`. The alternative to explicitly setting this property is to create the tree node by using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed. - - - -## Examples - The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. - + can display is 259. If a that has more than 259 characters is assigned to this property, only the first 259 characters are displayed. + + This property cannot be set by the user if the property of the parent is set to `false`. The alternative to explicitly setting this property is to create the tree node by using one of the constructors that has a string parameter that represents the property. The label is displayed next to the image, if one is displayed. + + + +## Examples + The following code example creates a root tree node to assign child tree nodes to. A child tree node for each `Customer` object in an is added to the root tree node as well as a child tree node for each `Order` object assigned to the `Customer` object. The `Customer` object is assigned to the property, and the tree nodes representing `Customer` objects are displayed with text. This example requires that you have a `Customer` and `Order` object defined, a control on a , and an named `customerArray` that contains `Customer` objects. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Bounds/CPP/treenode_bounds.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/.ctor/treenode_bounds.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Bounds/VB/treenode_bounds.vb" id="Snippet1"::: + ]]> @@ -2947,23 +2947,23 @@ If you set the property, t Toggles the tree node to either the expanded or collapsed state. - [!NOTE] -> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. - - - -## Examples - The following code example removes a when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a with a control on it. The should have two or more root tree nodes, each having at least one child node. - +> The state of a is persisted. For example, if the next level of child nodes was not collapsed previously, when the method is called, the child nodes appear in their previously expanded state. + + + +## Examples + The following code example removes a when the user right-clicks the mouse over it and toggles it from expanded to collapsed when the user clicks the mouse wheel over it. This example requires that you have a with a control on it. The should have two or more root tree nodes, each having at least one child node. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Windows.Forms.TreeNode/CPP/treenode.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FromHandle/treenode.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Windows.Forms.TreeNode/VB/treenode.vb" id="Snippet1"::: + ]]> @@ -3016,21 +3016,21 @@ If you set the property, t Gets or sets the text that appears when the mouse pointer hovers over a . Gets the text that appears when the mouse pointer hovers over a . - property of the parent to `true` for the to be visible at run time. - - If the control has a ToolTip and also contains a that has a , only the for the node will be shown. - - - -## Examples - The following code example demonstrates how to use the and properties. To run this example, paste the following code into a Windows Form and call `InitializeTreeViewWithToolTips` from the form's constructor or event handler. - + property of the parent to `true` for the to be visible at run time. + + If the control has a ToolTip and also contains a that has a , only the for the node will be shown. + + + +## Examples + The following code example demonstrates how to use the and properties. To run this example, paste the following code into a Windows Form and call `InitializeTreeViewWithToolTips` from the form's constructor or event handler. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/ToolTipText/Form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.TreeViewWhidbeyMembers/VB/Form1.vb" id="Snippet7"::: + ]]> @@ -3104,15 +3104,15 @@ If you set the property, t Gets the parent tree view that the tree node is assigned to. A that represents the parent tree view that the tree node is assigned to, or if the node has not been assigned to a tree view. - after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". - + after determining if the passed in is selected and which to select. This example requires that you have a with a control that has a that contains several objects. It also requires that you have a with the following items: "Previous", "PreviousVisible", "Next", "NextVisible", "First", and "Last". + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/TreeNode_Parent/CPP/treenode_parent.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/TreeNode/FirstNode/treenode_parent.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/TreeNode_Parent/VB/treenode_parent.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Windows.Forms/UserControl.xml b/xml/System.Windows.Forms/UserControl.xml index 39ba458d679..a3fad041166 100644 --- a/xml/System.Windows.Forms/UserControl.xml +++ b/xml/System.Windows.Forms/UserControl.xml @@ -70,28 +70,28 @@ Provides an empty control that can be used to create other controls. - , inherits all the standard positioning and mnemonic-handling code that is necessary in a user control. - - The gives you the ability to create controls that can be used in multiple places within an application or organization. You can include all the code needed for validation of common data you ask the user to input; some examples of this are email addresses (see Example section), telephone numbers, and postal codes. Another efficient use of the user control is to simply preload a or with static items you commonly use in almost every application; some examples of this are countries/regions, cities, states, and office locations. 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). - + , inherits all the standard positioning and mnemonic-handling code that is necessary in a user control. + + The gives you the ability to create controls that can be used in multiple places within an application or organization. You can include all the code needed for validation of common data you ask the user to input; some examples of this are email addresses (see Example section), telephone numbers, and postal codes. Another efficient use of the user control is to simply preload a or with static items you commonly use in almost every application; some examples of this are countries/regions, cities, states, and office locations. For more information about authoring custom controls, see [Developing Custom Windows Forms Controls with the .NET Framework](/dotnet/desktop/winforms/controls/developing-custom-windows-forms-controls). + > [!NOTE] -> You might consider creating a namespace that contains several classes of user controls and compiling it into one DLL. This DLL can be referenced and distributed with the application or all applications within an organization. This gives you the ability to reference the user control in many applications and save time laying out and coding the contained elements of the user control. A user control also gives you consistency within or across applications; for example, all address information input blocks will all have the same appearance and behavior. Consistency gives your application a more polished and professional appearance. -> -> You can host Windows Forms -derived classes inside of a form, on another , inside of Internet Explorer on a web page, or inside a control hosted on a form. - +> You might consider creating a namespace that contains several classes of user controls and compiling it into one DLL. This DLL can be referenced and distributed with the application or all applications within an organization. This gives you the ability to reference the user control in many applications and save time laying out and coding the contained elements of the user control. A user control also gives you consistency within or across applications; for example, all address information input blocks will all have the same appearance and behavior. Consistency gives your application a more polished and professional appearance. +> +> You can host Windows Forms -derived classes inside of a form, on another , inside of Internet Explorer on a web page, or inside a control hosted on a form. + > [!NOTE] -> When hosting a inside of the control, you cannot turn off Visual Styles using the `META` tag value `MSThemeCompatible`. For more information about Visual Styles, see [Rendering Controls with Visual Styles](/dotnet/framework/winforms/controls/rendering-controls-with-visual-styles). - -## Examples - The following code example creates a that can be reused in multiple applications to get user information. This example adds several controls, controls and an to the to gather the user's information. Additionally, the user's email address is validated in the event of the and the object is used to give the user feedback if the data fails validation. The code is intended to be compiled into a DLL for reference in other applications. - +> When hosting a inside of the control, you cannot turn off Visual Styles using the `META` tag value `MSThemeCompatible`. For more information about Visual Styles, see [Rendering Controls with Visual Styles](/dotnet/desktop/winforms/controls/rendering-controls-with-visual-styles). + +## Examples + The following code example creates a that can be reused in multiple applications to get user information. This example adds several controls, controls and an to the to gather the user's information. Additionally, the user's email address is validated in the event of the and the object is used to give the user feedback if the data fails validation. The code is intended to be compiled into a DLL for reference in other applications. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic UserControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/UserControl/Overview/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -121,20 +121,20 @@ Initializes a new instance of the class. - . To create your own user control class, inherit from the class. - - - -## Examples - The following code example creates an instance of the derived class, `MyCustomerInfoUserControl`, which was created in the example section of the class overview. The user control is added to a control and has its property set to . The is then added to a . - + . To create your own user control class, inherit from the class. + + + +## Examples + The following code example creates an instance of the derived class, `MyCustomerInfoUserControl`, which was created in the example section of the class overview. The user control is added to a control and has its property set to . The is then added to a . + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/Classic UserControl.UserControl Example/CPP/source.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/UserControl/.ctor/source.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl.UserControl Example/VB/source.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/Classic UserControl.UserControl Example/VB/source.vb" id="Snippet1"::: + ]]> @@ -265,11 +265,11 @@ Gets or sets how the control will resize itself. A value from the enumeration. The default is . - property will function as though was set to . All controls that recognize the property will, by default, grow to fit available space, but will not shrink below the value specified by the property. - + property will function as though was set to . All controls that recognize the property will, by default, grow to fit available space, but will not shrink below the value specified by the property. + ]]> @@ -348,21 +348,21 @@ Occurs when the property changes. - property so that you can change your control's validation behavior accordingly. - - - -## 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 type named `UserControl1`. Then ensure that the event handler is associated with the event. - + property so that you can change your control's validation behavior accordingly. + + + +## 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 type named `UserControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet641"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet641"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet641"::: + ]]> @@ -413,11 +413,11 @@ Gets or sets the border style of the user control. One of the values. The default is . - property is set to , the control has a sunken, three-dimensional appearance. To display a flat, thin border, set the property to . - + property is set to , the control has a sunken, three-dimensional appearance. To display a flat, thin border, set the property to . + ]]> The assigned value is not one of the values. @@ -516,29 +516,29 @@ Occurs before the control becomes visible for the first time. - [!NOTE] -> If the is part of an MDI child form, the event will occur each time the child form is shown. In this case, you should put any one-time initialization code in the instead of a event handler. - +> If the is part of an MDI child form, the event will occur each time the child form is shown. In this case, you should put any one-time initialization code in the instead of a event handler. + > [!CAUTION] -> The event occurs when the handle for the is created. In some circumstances, this can cause the event to occur more than one time. For example, the event occurs when the is loaded, and again if the handle is recreated. (One way that a handle is recreated is by calling the method.) To account for the event occurring more than one time, you should put any one time initialization code in the constructor instead of a event handler. In addition, you should not add data bindings to the in a event handler. - - 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 type named `UserControl1`. Then ensure that the event handler is associated with the event. - +> The event occurs when the handle for the is created. In some circumstances, this can cause the event to occur more than one time. For example, the event occurs when the is loaded, and again if the handle is recreated. (One way that a handle is recreated is by calling the method.) To account for the event occurring more than one time, you should put any one time initialization code in the constructor instead of a event handler. In addition, you should not add data bindings to the in a event handler. + + 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 type named `UserControl1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet642"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet642"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet642"::: + ]]> @@ -578,13 +578,13 @@ 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. + ]]> @@ -628,15 +628,15 @@ An that contains the event data. Raises the event. - event occurs after the control is created, but before the control becomes visible for the first time. - - Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). - - 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. - + event occurs after the control is created, but before the control becomes visible for the first time. + + Raising an event invokes the event handler through a delegate. For more information, see [Handling and Raising Events](/dotnet/standard/events/). + + 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. + ]]> diff --git a/xml/System.Windows.Forms/WebBrowser.xml b/xml/System.Windows.Forms/WebBrowser.xml index b149eb82ab7..da7c0890794 100644 --- a/xml/System.Windows.Forms/WebBrowser.xml +++ b/xml/System.Windows.Forms/WebBrowser.xml @@ -57,57 +57,57 @@ Enables a user to navigate Web pages inside a form. - [!NOTE] > For new Windows Forms projects, we recommend using the Microsoft Edge [WebView2 control](/microsoft-edge/webview2/) instead of the control. - The control lets you host Web pages and other browser-enabled documents in your Windows Forms applications. You can use the control, for example, to provide integrated HTML-based user assistance or Web browsing capabilities in your application. Additionally, you can use the control to add your existing Web-based controls to your Windows Forms client applications. - + The control lets you host Web pages and other browser-enabled documents in your Windows Forms applications. You can use the control, for example, to provide integrated HTML-based user assistance or Web browsing capabilities in your application. Additionally, you can use the control to add your existing Web-based controls to your Windows Forms client applications. + > [!IMPORTANT] -> The control is resource-intensive. To ensure that all resources are released in a timely fashion, call the method when you're finished using the control. You must call the method on the same thread that attached the events, which should always be the message or user-interface (UI) thread. - - The control cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). - - The control has several properties, methods, and events related to navigation. The following members let you navigate the control to a specific URL, move backward and forward through the navigation history list, and load the home page and search page of the current user: - -- -- -- -- -- +> The control is resource-intensive. To ensure that all resources are released in a timely fashion, call the method when you're finished using the control. You must call the method on the same thread that attached the events, which should always be the message or user-interface (UI) thread. + + The control cannot be used by partially trusted code. For more information, see [Using Libraries from Partially Trusted Code](/dotnet/framework/misc/using-libraries-from-partially-trusted-code). + + The control has several properties, methods, and events related to navigation. The following members let you navigate the control to a specific URL, move backward and forward through the navigation history list, and load the home page and search page of the current user: + +- +- +- +- +- - - - If the navigation is unsuccessful, a page indicating the problem is displayed. Navigation with any of these members causes the , , and events to occur at different stages of navigation. - - These and other members, such as the and methods, let you implement user interface controls in your application similar to those in Internet Explorer. Some members are useful even when you don't want to display the control on your form. For example, you can use the method to print the latest version of a Web page without displaying the page to the user. - - The control also lets you display content that you create in your application or you retrieve from a database or resource file. Use the or property to get or set the contents of the current document as a string or data stream. - - You can also manipulate the contents of a Web page through the property, which contains an object that provides managed access to the HTML document object model (DOM) for the current page. This property is useful, when used in combination with the property, to implement two-way communication between your application code and dynamic HTML (DHTML) code in a Web page, letting you combine Web-based controls and Windows Forms controls in a single user interface. You can use the property to call scripting code methods from your application. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to the object that you specify for the property. - - The control is a managed wrapper for the ActiveX [WebBrowser control](/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752040(v=vs.85)), and uses whichever version of the control is installed on the user's computer. - + + If the navigation is unsuccessful, a page indicating the problem is displayed. Navigation with any of these members causes the , , and events to occur at different stages of navigation. + + These and other members, such as the and methods, let you implement user interface controls in your application similar to those in Internet Explorer. Some members are useful even when you don't want to display the control on your form. For example, you can use the method to print the latest version of a Web page without displaying the page to the user. + + The control also lets you display content that you create in your application or you retrieve from a database or resource file. Use the or property to get or set the contents of the current document as a string or data stream. + + You can also manipulate the contents of a Web page through the property, which contains an object that provides managed access to the HTML document object model (DOM) for the current page. This property is useful, when used in combination with the property, to implement two-way communication between your application code and dynamic HTML (DHTML) code in a Web page, letting you combine Web-based controls and Windows Forms controls in a single user interface. You can use the property to call scripting code methods from your application. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to the object that you specify for the property. + + The control is a managed wrapper for the ActiveX [WebBrowser control](/previous-versions/windows/internet-explorer/ie-developer/platform-apis/aa752040(v=vs.85)), and uses whichever version of the control is installed on the user's computer. + > [!NOTE] > > - This class makes security demands at the class level. A is thrown when a derived class or any caller in the call stack does not have full trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands) and [Inheritance Demands](/previous-versions/dotnet/netframework-4.0/x4yx82e6(v=vs.100)). -> - The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. +> - The class can only be used in threads set to single thread apartment (STA) mode. To use this class, ensure that your `Main` method is marked with the attribute. > - For accessibility purposes, the property should be set to `false` when there is no content to display in the control. Change the value to `true` to enable users to navigate via keyboard into the contents of the control. - -## Examples - The following code example demonstrates how to implement an address bar for use with the control. This example requires that you have a form that contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press Enter or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + +## Examples + The following code example demonstrates how to implement an address bar for use with the control. This example requires that you have a form that contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press Enter or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]> - WebBrowser Control (Windows Forms) + WebBrowser Control (Windows Forms) Using Libraries from Partially Trusted Code WebBrowser Control @@ -134,17 +134,17 @@ Initializes a new instance of the class. - control is empty. To navigate it to an initial document, set the property. - -## Examples - The following code example demonstrates the use of this member. - + control is empty. To navigate it to an initial document, set the property. + +## Examples + The following code example demonstrates the use of this member. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: + ]]> The control is hosted inside Internet Explorer. @@ -183,11 +183,11 @@ if the control can navigate to another page; otherwise, . - , or property, but will prevent all subsequent navigation. - + , or property, but will prevent all subsequent navigation. + ]]> @@ -225,24 +225,24 @@ if the control accepts documents that are dropped onto it; otherwise, . The default is . - control automatically navigates to documents that are dropped onto it. This behavior is useful when you use the control as a generic browser. If you use the control to display content designed specifically for your application, such as HTML-based user assistance, set the property to `false` to prevent the display of other content. This is particularly useful when you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls. - - You can disable other standard browser features by setting the and properties to `false`. - + control automatically navigates to documents that are dropped onto it. This behavior is useful when you use the control as a generic browser. If you use the control to display content designed specifically for your application, such as HTML-based user assistance, set the property to `false` to prevent the display of other content. This is particularly useful when you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls. + + You can disable other standard browser features by setting the and properties to `false`. + > [!NOTE] -> This property is not related to the property and does not cause drag-and-drop events such as the event to occur for the control. - - - -## Examples - The following code example demonstrates how to use the property. - +> This property is not related to the property and does not cause drag-and-drop events such as the event to occur for the control. + + + +## Examples + The following code example demonstrates how to use the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet1"::: + ]]> This instance is no longer valid. @@ -332,24 +332,24 @@ if the control can navigate backward; otherwise, . - control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the previous page in this history, if one is available. Use the property to determine whether navigation history is available and contains a previous page. If this property is `true`, the method will succeed. Otherwise, calling the method will return a value of `false` and no navigation will occur. - - You can also handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. - - - -## Examples - The following code example demonstrates how to use the property to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the previous page in this history, if one is available. Use the property to determine whether navigation history is available and contains a previous page. If this property is `true`, the method will succeed. Otherwise, calling the method will return a value of `false` and no navigation will occur. + + You can also handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. + + + +## Examples + The following code example demonstrates how to use the property to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]> @@ -389,24 +389,24 @@ Occurs when the property value changes. - control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the previous page in this history, if one is available. The property indicates whether navigation history is available and contains a previous page. Handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to use a handler for the event to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the previous page in this history, if one is available. The property indicates whether navigation history is available and contains a previous page. Handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to use a handler for the event to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]> @@ -460,26 +460,26 @@ if the control can navigate forward; otherwise, . - control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the next page in this history, if one is available as a result of a previous backward navigation. If this property is `true`, the method will succeed. Otherwise, calling the method will return a value of `false` and no navigation will occur. - - Use the property to determine whether navigation history is available and contains a page located after the current one, allowing the method to succeed. - - You can also handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. - - - -## Examples - The following code example demonstrates how to use a handler for the event to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the next page in this history, if one is available as a result of a previous backward navigation. If this property is `true`, the method will succeed. Otherwise, calling the method will return a value of `false` and no navigation will occur. + + Use the property to determine whether navigation history is available and contains a page located after the current one, allowing the method to succeed. + + You can also handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. + + + +## Examples + The following code example demonstrates how to use a handler for the event to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]> @@ -519,24 +519,24 @@ Occurs when the property value changes. - control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the next page in this history, if one is available as a result of a previous backward navigation. The property indicates whether navigation history is available and contains a page located after the current one, allowing the method to succeed. Handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to use the method to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. The method navigates the control to the next page in this history, if one is available as a result of a previous backward navigation. The property indicates whether navigation history is available and contains a page located after the current one, allowing the method to succeed. Handle the event to receive a notification when the property changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to use the method to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]> @@ -596,19 +596,19 @@ Associates the underlying ActiveX control with a client that can handle control events. - control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. - - - -## Examples - The following code example illustrates the use of this method in a class derived from that supplements the normal events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. - + control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. + + + +## Examples + The following code example illustrates the use of this method in a class derived from that supplements the normal events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/CreateSink/WB2.cs" id="Snippet00"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet00"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet00"::: + ]]> @@ -643,16 +643,16 @@ Returns a reference to the unmanaged ActiveX control site, which you can extend to customize the managed control. A that represents the ActiveX control site. - control, which is a managed wrapper for the ActiveX control. You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents. - - To use this feature, implement classes that inherit from the and classes. The unmanaged `WebBrowser` ActiveX control uses the protected method to retrieve extensibility interfaces implemented by the class. Override the method to return an instance of your own class that inherits from the class. The class provides default implementations of the OLE `IDocHostUIHandler` interface. You can provide your own implementation of this interface or implement any other `WebBrowser` ActiveX control interface in order to customize the behavior of the control. - + control, which is a managed wrapper for the ActiveX control. You can use this extensibility, for example, to customize the browser shortcut menu and shortcut keys or to provide a custom security configuration for hosted documents. + + To use this feature, implement classes that inherit from the and classes. The unmanaged `WebBrowser` ActiveX control uses the protected method to retrieve extensibility interfaces implemented by the class. Override the method to return an instance of your own class that inherits from the class. The class provides default implementations of the OLE `IDocHostUIHandler` interface. You can provide your own implementation of this interface or implement any other `WebBrowser` ActiveX control interface in order to customize the behavior of the control. + > [!NOTE] -> If you provide your own implementation for any `IDocHostUIHandler` members, you must implement all the members of that interface. - +> If you provide your own implementation for any `IDocHostUIHandler` members, you must implement all the members of that interface. + ]]> @@ -745,21 +745,21 @@ Releases the event-handling client attached in the method from the underlying ActiveX control. - control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. - - - -## Examples - The following code example illustrates the use of this method in a class derived from that supplements the standard events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. - - For the complete code example, see . - + control, which is a managed wrapper for the ActiveX control. You can use this extensibility to implement events from the ActiveX control that are not provided by the wrapper control. + + + +## Examples + The following code example illustrates the use of this method in a class derived from that supplements the standard events with the `NavigateError` event from the OLE `DWebBrowserEvents2` interface. + + For the complete code example, see . + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/CreateSink/WB2.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserExtensibility/VB/WB2.vb" id="Snippet10"::: + ]]> @@ -840,25 +840,25 @@ Gets an representing the Web page currently displayed in the control. An representing the current page, or if no page is loaded. - control through the HTML document object model (DOM). This is useful, for example, when you want to use Web-based controls in your Windows Forms application. - - You can use this property, in combination with the property, to implement two-way communication between a Web page displayed in the control and your application. Use the method to call script methods implemented in a Web page from your client application code. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to an object that you specify for the property. - - To access the contents of a Web page as a string, use the property. To access the contents of a Web page as a , use the property. - - - -## Examples - The following code example demonstrates how to use the property in a handler for the event to determine whether a Web page form has been filled in. If the input field does not contain a value, the navigation is canceled. - - This example requires that your form contains a control called `webBrowser1`. - + control through the HTML document object model (DOM). This is useful, for example, when you want to use Web-based controls in your Windows Forms application. + + You can use this property, in combination with the property, to implement two-way communication between a Web page displayed in the control and your application. Use the method to call script methods implemented in a Web page from your client application code. Your scripting code can access your application through the `window.external` object, which is a built-in DOM object provided for host access, and which maps to an object that you specify for the property. + + To access the contents of a Web page as a string, use the property. To access the contents of a Web page as a , use the property. + + + +## Examples + The following code example demonstrates how to use the property in a handler for the event to determine whether a Web page form has been filled in. If the input field does not contain a value, the navigation is canceled. + + This example requires that your form contains a control called `webBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]> This instance is no longer valid. @@ -899,41 +899,41 @@ Occurs when the control finishes loading a document. - control navigates to a new document whenever one of the following properties is set or methods is called: - -- - -- - -- - -- - -- - -- - -- - -- - - Handle the event to receive notification when the new document finishes loading. When the event occurs, the new document is fully loaded, which means you can access its contents through the , , or property. - - To receive notification before navigation begins, handle the event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. Handle the event to receive notification when the control finishes navigation and has begun loading the document at the new location. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates the use of this event to print a document after it has fully loaded. - + control navigates to a new document whenever one of the following properties is set or methods is called: + +- + +- + +- + +- + +- + +- + +- + +- + + Handle the event to receive notification when the new document finishes loading. When the event occurs, the new document is fully loaded, which means you can access its contents through the , , or property. + + To receive notification before navigation begins, handle the event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. Handle the event to receive notification when the control finishes navigation and has begun loading the document at the new location. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates the use of this event to print a document after it has fully loaded. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet10"::: + ]]> @@ -991,16 +991,16 @@ Gets or sets a stream containing the contents of the Web page displayed in the control. A containing the contents of the current Web page, or if no page is loaded. The default is . - control from a object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the control automatically navigates to the about:blank URL before loading the specified text. This means that the , , and events occur when you set this property, and the value of the property is no longer meaningful. - + control from a object. You can use this property, for example, to load Web pages from a database or resource file. When you set this property, the control automatically navigates to the about:blank URL before loading the specified text. This means that the , , and events occur when you set this property, and the value of the property is no longer meaningful. + > [!NOTE] -> This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new content. You can retrieve the new value in a event handler. - - To access the contents of a Web page as a string, use the property. You can also access the page contents using the HTML document object model (DOM) through the property. - +> This property contains the contents of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new content. You can retrieve the new value in a event handler. + + To access the contents of a Web page as a string, use the property. You can also access the page contents using the HTML document object model (DOM) through the property. + ]]> This instance is no longer valid. @@ -1056,24 +1056,24 @@ Gets or sets the HTML contents of the page displayed in the control. The HTML text of the displayed page, or the empty string ("") if no document is loaded. - control using string processing tools. You can use this property, for example, to load pages from a database or to analyze pages using regular expressions. When you set this property, the control automatically navigates to the about:blank URL before loading the specified text. This means that the , , and events occur when you set this property, and the value of the property is no longer meaningful. - + control using string processing tools. You can use this property, for example, to load pages from a database or to analyze pages using regular expressions. When you set this property, the control automatically navigates to the about:blank URL before loading the specified text. This means that the , , and events occur when you set this property, and the value of the property is no longer meaningful. + > [!NOTE] -> This property contains the text of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new content. You can retrieve the new value in a event handler. Alternatively, you can block the thread until the document is loaded by calling the method in a loop until the property returns the value that you originally set it to. - - To access the contents of a Web page as a , use the property. You can also access the page contents using the HTML document object model (DOM) through the property. - - - -## Examples - The following code example demonstrates how to use the property to programmatically display document content of your choosing. This example requires that your form contains a control called `webBrowser1`. - +> This property contains the text of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new content. You can retrieve the new value in a event handler. Alternatively, you can block the thread until the document is loaded by calling the method in a loop until the property returns the value that you originally set it to. + + To access the contents of a Web page as a , use the property. You can also access the page contents using the HTML document object model (DOM) through the property. + + + +## Examples + The following code example demonstrates how to use the property to programmatically display document content of your choosing. This example requires that your form contains a control called `webBrowser1`. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]> This instance is no longer valid. @@ -1129,24 +1129,24 @@ Gets the title of the document currently displayed in the control. The title of the current document, or the empty string ("") if no document is loaded. - event to update the title in the title bar when the control navigates to a new document. - - - -## Examples - The following code example demonstrates how to use the property to update the form title bar with the title of the current document. This example requires that your form contains a control called `webBrowser1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + event to update the title in the title bar when the control navigates to a new document. + + + +## Examples + The following code example demonstrates how to use the property to update the form title bar with the title of the current document. This example requires that your form contains a control called `webBrowser1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: + ]]> This instance is no longer valid. @@ -1189,24 +1189,24 @@ Occurs when the property value changes. - property. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to use a handler for the event to update the form title bar with the title of the current document. This example requires that your form contains a control called `webBrowser1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + property. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to use a handler for the event to update the form title bar with the title of the current document. This example requires that your form contains a control called `webBrowser1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet15"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet15"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet15"::: + ]]> @@ -1258,11 +1258,11 @@ Gets the type of the document currently displayed in the control. The type of the current document. - This instance is no longer valid. @@ -1311,11 +1311,11 @@ Gets a value indicating the encryption method used by the document currently displayed in the control. One of the values. - event to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. When the current document is not encrypted, the value of this property is . When the control displays a Web page containing multiple frames with content of different encryption levels, the value of this property is . When the encryption level is unknown, the value of this property is . Other values indicate the type of encryption present. To mimic the behavior of the lock icon in Internet Explorer, display the encryption type in a ToolTip that appears when the mouse pointer hovers over the indicator. - + event to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. When the current document is not encrypted, the value of this property is . When the control displays a Web page containing multiple frames with content of different encryption levels, the value of this property is . When the encryption level is unknown, the value of this property is . Other values indicate the type of encryption present. To mimic the behavior of the lock icon in Internet Explorer, display the encryption type in a ToolTip that appears when the mouse pointer hovers over the indicator. + ]]> This instance is no longer valid. @@ -1359,21 +1359,21 @@ Occurs when the control navigates to or away from a Web site that uses encryption. - property to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. In a handler for this event, check the value of the property to determine whether you should hide or display the indicator. To mimic the behavior of the lock icon in Internet Explorer, you can also provide a ToolTip that shows the encryption level when the mouse pointer hovers over the indicator. - - 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. - + property to implement an indicator in the user interface of your application similar to the lock icon in Internet Explorer. In a handler for this event, check the value of the property to determine whether you should hide or display the indicator. To mimic the behavior of the lock icon in Internet Explorer, you can also provide a ToolTip that shows the encryption level when the mouse pointer hovers over the indicator. + + 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet647"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet647"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet647"::: + ]]> @@ -1408,21 +1408,21 @@ Occurs when the control downloads a file. - 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 type named `WebBrowser1`. Then 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet648"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet648"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet648"::: + ]]> @@ -1489,22 +1489,22 @@ if the navigation succeeds; if a previous page in the navigation history is not available. - control maintains a history list of all the Web pages visited during a browsing session. You can use the method to implement a **Back** button similar to the one in Internet Explorer, which will allow your users to return to a previous page in the navigation history. - - Use the property to determine whether the navigation history is available and contains a previous page. Handle the event to receive a notification when the property value changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. - -## Examples - The following code example demonstrates how to use the method to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. You can use the method to implement a **Back** button similar to the one in Internet Explorer, which will allow your users to return to a previous page in the navigation history. + + Use the property to determine whether the navigation history is available and contains a previous page. Handle the event to receive a notification when the property value changes. Handling this event is useful, for example, to change the enabled state of a **Back** button when the control navigates to or leaves the beginning of the navigation history. + +## Examples + The following code example demonstrates how to use the method to implement a **Back** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `backButton`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet7"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet7"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet7"::: + ]]> @@ -1544,24 +1544,24 @@ if the navigation succeeds; if a subsequent page in the navigation history is not available. - control maintains a history list of all the Web pages visited during a browsing session. You can use the method to implement a **Forward** button similar to the one in Internet Explorer, allowing your users to return to the next page in the navigation history after navigating backward. - - Use the property to determine whether the navigation history is available and contains a page located after the current one. Handle the event to receive a notification when the property value changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. - - - -## Examples - The following code example demonstrates how to use the method to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. You can use the method to implement a **Forward** button similar to the one in Internet Explorer, allowing your users to return to the next page in the navigation history after navigating backward. + + Use the property to determine whether the navigation history is available and contains a page located after the current one. Handle the event to receive a notification when the property value changes. Handling this event is useful, for example, to change the enabled state of a **Forward** button when the control navigates to or leaves the end of the navigation history. + + + +## Examples + The following code example demonstrates how to use the method to implement a **Forward** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonForward`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet8"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet8"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet8"::: + ]]> @@ -1599,20 +1599,20 @@ Navigates the control to the home page of the current user. - method to implement a **Home** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonHome`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + method to implement a **Home** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonHome`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet11"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet11"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet11"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet11"::: + ]]> This instance is no longer valid. @@ -1652,22 +1652,22 @@ Navigates the control to the default search page of the current user. - method or specify the property. - -## Examples - The following code example demonstrates how to use the method to implement a **Search** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonSearch`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + +## Examples + The following code example demonstrates how to use the method to implement a **Search** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonSearch`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet12"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet12"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet12"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet12"::: + ]]> This instance is no longer valid. @@ -1724,11 +1724,11 @@ if the control is busy loading a document; otherwise, . - method to halt the current navigation before the new document is fully loaded. Use the property to determine the exact navigation state of the control. The property value is false when the property value is . - + method to halt the current navigation before the new document is fully loaded. Use the property to determine the exact navigation state of the control. The property value is false when the property value is . + ]]> This instance is no longer valid. @@ -1780,11 +1780,11 @@ if the control is in offline mode; otherwise, . - control is forced to load Web pages from the local cache rather than downloading them. - + control is forced to load Web pages from the local cache rather than downloading them. + ]]> This instance is no longer valid. @@ -1826,21 +1826,21 @@ if the control shortcut menu is enabled; otherwise, . The default is . - control displays a shortcut menu when a user right-clicks it. This behavior is useful when you use the control as a generic browser. If you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls, set the property to false. - - You can disable other standard browser features by setting the and properties to false. - - - -## Examples - The following code example demonstrates how to use the property. - + control displays a shortcut menu when a user right-clicks it. This behavior is useful when you use the control as a generic browser. If you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines Web-based controls with Windows Forms controls, set the property to false. + + You can disable other standard browser features by setting the and properties to false. + + + +## Examples + The following code example demonstrates how to use the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet2"::: + ]]> @@ -1885,15 +1885,15 @@ The URL of the document to load. Loads the document at the specified Uniform Resource Locator (URL) into the control, replacing the previous document. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control navigates to the specified URI and adds it to the end of the history list. Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - - You can use the method to implement an address bar similar to the one in Internet Explorer. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control navigates to the specified URI and adds it to the end of the history list. Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + + You can use the method to implement an address bar similar to the one in Internet Explorer. + ]]> This instance is no longer valid. @@ -1941,24 +1941,24 @@ A representing the URL of the document to load. Loads the document at the location indicated by the specified into the control, replacing the previous document. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control navigates to the specified URI and adds it to the end of the history list. Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - - You can use the method to implement an address bar similar to the one in Internet Explorer. - -## Examples - The following code example demonstrates how to use the method to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control navigates to the specified URI and adds it to the end of the history list. Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + + You can use the method to implement an address bar similar to the one in Internet Explorer. + +## Examples + The following code example demonstrates how to use the method to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]> This instance is no longer valid. @@ -2003,13 +2003,13 @@ to load the document into a new browser window; to load the document into the control. Loads the document at the specified Uniform Resource Locator (URL) into a new browser window or into the control. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. + ]]> This instance is no longer valid. @@ -2059,15 +2059,15 @@ The name of the frame in which to load the document. Loads the document at the specified Uniform Resource Locator (URL) into the control, replacing the contents of the Web page frame with the specified name. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]> This instance is no longer valid. @@ -2112,13 +2112,13 @@ to load the document into a new browser window; to load the document into the control. Loads the document at the location indicated by the specified into a new browser window or into the control. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload with a `newWindow` parameter value of `false`, the control navigates to the specified URI normally and adds the URI to the end of the history list. When you call this overload with a `newWindow` parameter value of `true`, the control loads the document at the specified URI into a new Internet Explorer window, which maintains its own navigation history. You can handle the event to receive notification before a new browser window is opened, allowing you to cancel the action if necessary. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page or loads a page into a separate browser window, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. When a page is loaded into a separate Internet Explorer window, the user can retrieve the latest version by clicking the **Refresh** button. + ]]> This instance is no longer valid. @@ -2164,15 +2164,15 @@ The name of the frame in which to load the document. Loads the document at the location indicated by the specified into the control, replacing the contents of the Web page frame with the specified name. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]> This instance is no longer valid. @@ -2228,15 +2228,15 @@ HTTP headers to add to the default headers. Loads the document at the specified Uniform Resource Locator (URL) into the control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]> This instance is no longer valid. @@ -2284,15 +2284,15 @@ HTTP headers to add to the default headers. Loads the document at the location indicated by the specified into the control, requesting it using the specified HTTP data and replacing the contents of the Web page frame with the specified name. - control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. - - Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - + control maintains a history list of all the Web pages visited during a browsing session. When you call this overload, the control loads the document at the specified URI into the Web page frame with the specified name, and adds the URI to the end of the history list. If the frame name specified is invalid, the document is loaded into a new Internet Explorer window. + + Use the method to return the control to a previous page in the navigation history. Use the method to return to a later page in the navigation history after navigating backward. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + ]]> This instance is no longer valid. @@ -2332,35 +2332,35 @@ Occurs when the control has navigated to a new document and has begun loading it. - control navigates to a new document whenever one of the following properties is set or methods is called: - -- -- -- -- -- -- -- + control navigates to a new document whenever one of the following properties is set or methods is called: + +- +- +- +- +- +- +- - - - Handle the event to receive notification when the control has navigated to a new document. When the event occurs, the new document has begun loading, which means you can access the loaded content through the , , and properties. Handle the event to receive notification when the control finishes loading the new document. - - You can also receive notification before navigation begins by handling the event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, the user has not completely filled out a form. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - -## Examples - The following code example demonstrates how to use a handler for the event to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + + Handle the event to receive notification when the control has navigated to a new document. When the event occurs, the new document has begun loading, which means you can access the loaded content through the , , and properties. Handle the event to receive notification when the control finishes loading the new document. + + You can also receive notification before navigation begins by handling the event. Handling this event lets you cancel navigation if certain conditions have not been met, for example, the user has not completely filled out a form. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + +## Examples + The following code example demonstrates how to use a handler for the event to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]> @@ -2404,45 +2404,45 @@ Occurs before the control navigates to a new document. - control navigates to a new document whenever one of the following properties is set or methods is called: - -- - -- - -- - -- - -- - -- - -- - -- - - You can handle the event to cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. To cancel navigation, set the property of the object passed to the event handler to `true`. You can also use this object to retrieve the URL of the new document through the property. If the new document will be displayed in a Web page frame, you can retrieve the name of the frame through the property. - - Handle the event to receive notification when the control finishes navigation and has begun loading the document at the new location. Handle the event to receive notification when the control finishes loading the new document. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to use a handler for the event to cancel navigation when a Web page form has not been filled in. The property is used to determine whether the form input field contains a value. - - This example requires that your form contains a control called `webBrowser1` and that your form class has a making it accessible to COM. - - For a complete code example that you can paste the following code into, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control navigates to a new document whenever one of the following properties is set or methods is called: + +- + +- + +- + +- + +- + +- + +- + +- + + You can handle the event to cancel navigation if certain conditions have not been met, for example, when the user has not completely filled out a form. To cancel navigation, set the property of the object passed to the event handler to `true`. You can also use this object to retrieve the URL of the new document through the property. If the new document will be displayed in a Web page frame, you can retrieve the name of the frame through the property. + + Handle the event to receive notification when the control finishes navigation and has begun loading the document at the new location. Handle the event to receive notification when the control finishes loading the new document. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to use a handler for the event to cancel navigation when a Web page form has not been filled in. The property is used to determine whether the form input field contains a value. + + This example requires that your form contains a control called `webBrowser1` and that your form class has a making it accessible to COM. + + For a complete code example that you can paste the following code into, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet30"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet30"::: + ]]> @@ -2486,25 +2486,25 @@ Occurs before a new browser window is opened. - control opens a separate browser window when the appropriate overload of the method is called or when the user clicks the **Open in New Window** option of the browser shortcut menu when the mouse pointer hovers over a hyperlink. You can disable the shortcut menu by setting the property to false. - - The event occurs before the new browser window is opened. You can handle this event, for example, to prevent the window from opening when certain conditions have not been met. - - 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. - + control opens a separate browser window when the appropriate overload of the method is called or when the user clicks the **Open in New Window** option of the browser shortcut menu when the mouse pointer hovers over a hyperlink. You can disable the shortcut menu by setting the property to false. + + The event occurs before the new browser window is opened. You can handle this event, for example, to prevent the window from opening when certain conditions have not been met. + + 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet651"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet651"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet651"::: + ]]> @@ -2558,29 +2558,29 @@ Gets or sets an object that can be accessed by scripting code that is contained within a Web page displayed in the control. The object being made available to the scripting code. - control and the application that contains the control. This property lets you integrate dynamic HTML (DHTML) code with your client application code. The object specified for this property is available to Web page script as the `window.external` object, which is a built-in DOM object provided for host access. - - You can set this property to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the . - - To call functions defined in your Web page from your client application code, use the method of the object you can retrieve from the property. - - - -## Examples - The following code example demonstrates how to use the property. In the example, the property is set to the current form. - + control and the application that contains the control. This property lets you integrate dynamic HTML (DHTML) code with your client application code. The object specified for this property is available to Web page script as the `window.external` object, which is a built-in DOM object provided for host access. + + You can set this property to any COM-visible object for which you want its public properties and methods available to scripting code. You can make a class COM-visible by marking it with the . + + To call functions defined in your Web page from your client application code, use the method of the object you can retrieve from the property. + + + +## Examples + The following code example demonstrates how to use the property. In the example, the property is set to the current form. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet0"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet0"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet0"::: + ]]> - The specified value when setting this property is an instance of a non-public type. - - -or- - + The specified value when setting this property is an instance of a non-public type. + + -or- + The specified value when setting this property is an instance of a type that is not COM-visible. For more information, see . @@ -2615,13 +2615,13 @@ 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. + ]]> @@ -2660,13 +2660,13 @@ 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. + ]]> @@ -2705,13 +2705,13 @@ 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. + ]]> This instance is no longer valid. @@ -2754,13 +2754,13 @@ 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. + ]]> @@ -2799,13 +2799,13 @@ 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. + ]]> @@ -2844,13 +2844,13 @@ 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. + ]]> @@ -2888,13 +2888,13 @@ 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. + ]]> @@ -2933,13 +2933,13 @@ 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. + ]]> @@ -2978,13 +2978,13 @@ 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. + ]]> @@ -3022,13 +3022,13 @@ 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. + ]]> @@ -3067,13 +3067,13 @@ 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. + ]]> @@ -3175,11 +3175,11 @@ Occurs when the value of the property changes. - property and respond to changes by handling this event, the Padding property is not meaningful for this control. - + property and respond to changes by handling this event, the Padding property is not meaningful for this control. + ]]> @@ -3211,18 +3211,18 @@ Prints the document currently displayed in the control using the current print and page settings. - method. To display the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings, use the method. To display the **Print Preview** dialog box, use the method. - -## Examples - The following code example demonstrates how to use the method to implement a **Print** button for the control that's similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonPrint`. - + method. To display the **Page Setup** dialog box, which lets your users specify header and footer values and other page settings, use the method. To display the **Print Preview** dialog box, use the method. + +## Examples + The following code example demonstrates how to use the method to implement a **Print** button for the control that's similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonPrint`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet13"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet13"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet13"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet13"::: + ]]> @@ -3257,21 +3257,21 @@ Occurs when the control has updated information on the download progress of a document it is navigating to. - property to determine the number of bytes that have been downloaded successfully. Use the property to determine the total number of bytes available for downloading. - - 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. - + property to determine the number of bytes that have been downloaded successfully. Use the property to determine the total number of bytes available for downloading. + + 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 type named `WebBrowser1`. Then ensure that the event handler is associated with the event. + :::code language="csharp" source="~/snippets/csharp/System.ComponentModel/CollectionChangeEventArgs/Overview/EventExamples.cs" id="Snippet652"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet652"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.EventExamples/VB/EventExamples.vb" id="Snippet652"::: + ]]> @@ -3318,13 +3318,13 @@ Gets a value indicating the current state of the control. One of the values. - property to retrieve the specific state of the control when you need more information than the property provides. - - When the control does not contain a document, the value of this property is . Other values indicate the control state when it navigates to a new document. These values include , , , and . - + property to retrieve the specific state of the control when you need more information than the property provides. + + When the control does not contain a document, the value of this property is . Other values indicate the control state when it navigates to a new document. These values include , , , and . + ]]> This instance is no longer valid. @@ -3370,23 +3370,23 @@ Reloads the document currently displayed in the control by checking the server for an updated version. - control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The method forces the control to reload the current page by downloading it, ensuring that the control displays the latest version. You can use this method to implement a **Refresh** button similar to the one in Internet Explorer. - + control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The method forces the control to reload the current page by downloading it, ensuring that the control displays the latest version. You can use this method to implement a **Refresh** button similar to the one in Internet Explorer. + > [!NOTE] -> A document refresh simply reloads the current page, so the , , and events do not occur when you call the method. - -## Examples - The following code example demonstrates how to use the method to implement a **Refresh** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonRefresh`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - +> A document refresh simply reloads the current page, so the , , and events do not occur when you call the method. + +## Examples + The following code example demonstrates how to use the method to implement a **Refresh** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonRefresh`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet10"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet10"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet10"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet10"::: + ]]> @@ -3425,14 +3425,14 @@ One of the values. Reloads the document currently displayed in the control using the specified refresh options. - control stores recently visited Web pages in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The method forces the control to reload the current page. The type of reload depends on the value specified. If you call the method with the value, the latest version of the document is downloaded. If you use the value, the latest version is downloaded only if the current document has expired. If you use the value, the server sends a copy of the document stored in its own cache. - + control stores recently visited Web pages in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. The method forces the control to reload the current page. The type of reload depends on the value specified. If you call the method with the value, the latest version of the document is downloaded. If you use the value, the latest version is downloaded only if the current document has expired. If you use the value, the server sends a copy of the document stored in its own cache. + > [!NOTE] -> A document refresh simply reloads the current page, so the , , and events do not occur when you call the method. - +> A document refresh simply reloads the current page, so the , , and events do not occur when you call the method. + ]]> @@ -3475,22 +3475,22 @@ if the control does not display its dialog boxes; otherwise, . The default is . - control. This is useful when you use the control to add Web-based controls and scripting code to your application. It is less useful when you use the control as a generic browser. When you have finished debugging your application, set this property to `true` to suppress script errors. - + control. This is useful when you use the control to add Web-based controls and scripting code to your application. It is less useful when you use the control as a generic browser. When you have finished debugging your application, set this property to `true` to suppress script errors. + > [!NOTE] -> When is set to `true`, the control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set to `false` and suppress script errors in a handler for the event. For more information, see the code example in this topic. - - - -## Examples - The following code example demonstrates how to suppress script errors without suppressing other dialog boxes. In the example, the property is set to `false` to ensure that dialog boxes are displayed. A handler for the event suppresses the error. This event is only accessible when a document is finished loading, so the handler is attached in a event handler. - +> When is set to `true`, the control hides all its dialog boxes that originate from the underlying ActiveX control, not just script errors. Occasionally you might need to suppress script errors while displaying dialog boxes such as those used for browser security settings and user login. In this case, set to `false` and suppress script errors in a handler for the event. For more information, see the code example in this topic. + + + +## Examples + The following code example demonstrates how to suppress script errors without suppressing other dialog boxes. In the example, the property is set to `false` to ensure that dialog boxes are displayed. A handler for the event suppresses the error. This event is only accessible when a document is finished loading, so the handler is attached in a event handler. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/.ctor/WebBrowserMisc.cs" id="Snippet40"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet40"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/WebBrowserMisc/vb/WebBrowserMisc.vb" id="Snippet40"::: + ]]> This instance is no longer valid. @@ -3532,11 +3532,11 @@ if scroll bars are displayed in the control; otherwise, . The default is true. - @@ -3567,18 +3567,18 @@ Opens the Internet Explorer **Page Setup** dialog box. - method or the method. To display the **Print Preview** dialog box, use the method. - -## Examples - The following code example demonstrates how to use the method to implement a **Page Setup** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePageSetup` and a control called `webBrowser1`. - + method or the method. To display the **Print Preview** dialog box, use the method. + +## Examples + The following code example demonstrates how to use the method to implement a **Page Setup** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePageSetup` and a control called `webBrowser1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet2"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet2"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet2"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet2"::: + ]]> @@ -3611,18 +3611,18 @@ Opens the Internet Explorer **Print** dialog box without setting header and footer values. - method. To display the **Print Preview** dialog box, use the method. - -## Examples - The following code example demonstrates how to use the method to implement a **Print** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrint` and a control called `webBrowser1.` - + method. To display the **Print Preview** dialog box, use the method. + +## Examples + The following code example demonstrates how to use the method to implement a **Print** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrint` and a control called `webBrowser1.` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet3"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet3"::: + ]]> @@ -3655,20 +3655,20 @@ Opens the Internet Explorer **Print Preview** dialog box. - method. To print the current document, use the method or the method. - -## Examples - The following code example demonstrates how to use the method to implement a **Print Preview** menu option similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrintPreview`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + method. To print the current document, use the method or the method. + +## Examples + The following code example demonstrates how to use the method to implement a **Print Preview** menu option similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFilePrintPreview`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet4"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet4"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet4"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet4"::: + ]]> @@ -3701,18 +3701,18 @@ Opens the Internet Explorer **Properties** dialog box for the current document. - method to implement a **Properties** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileProperties` and a control called `webBrowser1.` - + method to implement a **Properties** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileProperties` and a control called `webBrowser1.` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet5"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet5"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet5"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet5"::: + ]]> @@ -3743,21 +3743,21 @@ Opens the Internet Explorer **Save Web Page** dialog box or the **Save** dialog box of the hosted document if it is not an HTML page. - [!NOTE] -> This method allows users to save only the contents of the document as it was originally loaded. Any modifications made to the document at run time through the property are not persisted. For information on retrieving the run-time modifications, see [How to: Access the HTML Source in the Managed HTML Document Object Model](/dotnet/framework/winforms/controls/how-to-access-the-html-source-in-the-managed-html-document-object-model). - -## Examples - The following code example demonstrates how to use the method to implement a **Save As** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileSaveAs` and a control called `webBrowser1`. - +> This method allows users to save only the contents of the document as it was originally loaded. Any modifications made to the document at run time through the property are not persisted. For information on retrieving the run-time modifications, see [How to: Access the HTML Source in the Managed HTML Document Object Model](/dotnet/desktop/winforms/controls/how-to-access-the-html-source-in-the-managed-html-document-object-model). + +## Examples + The following code example demonstrates how to use the method to implement a **Save As** menu option that is similar to the one on the Internet Explorer **File** menu. This example requires that your form contains a menu with a menu item called `MenuItemFileSaveAs` and a control called `webBrowser1`. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet1"::: + ]]> @@ -3807,22 +3807,22 @@ Gets the status text of the control. The status text. - control in a status bar. The status text is a message that contains information such as the URL of a hyperlink when the mouse pointer hovers over it and the URL of the document currently being loaded. Handle the event to update the status bar when the value of the property changes. - - - -## Examples - The following code example demonstrates how to use the property to implement a status bar for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `StatusBar1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + control in a status bar. The status text is a message that contains information such as the URL of a hyperlink when the mouse pointer hovers over it and the URL of the document currently being loaded. Handle the event to update the status bar when the value of the property changes. + + + +## Examples + The following code example demonstrates how to use the property to implement a status bar for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `StatusBar1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet14"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: + ]]> This instance is no longer valid. @@ -3865,24 +3865,24 @@ Occurs when the property value changes. - property changes. - - For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). - - - -## Examples - The following code example demonstrates how to use a handler for the event to implement a status bar for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `StatusBar1`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + property changes. + + For more information about handling events, see [Handling and Raising Events](/dotnet/standard/events/). + + + +## Examples + The following code example demonstrates how to use a handler for the event to implement a status bar for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `StatusBar1`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet14"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet14"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet14"::: + ]]> @@ -3916,20 +3916,20 @@ Cancels any pending navigation and stops any dynamic page elements, such as background sounds and animations. - method to implement a **Stop** button that is similar to the one on the Internet Explorer **File** menu. - -## Examples - The following code example demonstrates how to use the method to implement a **Stop** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonStop`. - - For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/framework/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). - + method to implement a **Stop** button that is similar to the one on the Internet Explorer **File** menu. + +## Examples + The following code example demonstrates how to use the method to implement a **Stop** button for the control similar to the one in Internet Explorer. This example requires that your form contains a control called `webBrowser1` and a control called `ButtonStop`. + + For the complete code example, see [How to: Add Web Browser Capabilities to a Windows Forms Application](/dotnet/desktop/winforms/controls/how-to-add-web-browser-capabilities-to-a-windows-forms-application). + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet9"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet9"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet9"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet9"::: + ]]> @@ -3980,25 +3980,25 @@ Gets or sets the URL of the current document. A representing the URL of the current document. - method and passing it the specified URL. - - The control maintains a history list of all the Web pages visited during a browsing session. When you set the property, the control navigates to the specified URL and adds it to the end of the history list. - - The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. - + method and passing it the specified URL. + + The control maintains a history list of all the Web pages visited during a browsing session. When you set the property, the control navigates to the specified URL and adds it to the end of the history list. + + The control stores Web pages from recently visited sites in a cache on the local hard disk. Each page can specify an expiration date indicating how long it will remain in the cache. When the control navigates to a page, it saves time by displaying a cached version, if one is available, rather than downloading the page again. Use the method to force the control to reload the current page by downloading it, ensuring that the control displays the latest version. + > [!NOTE] -> This property contains the URL of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new document. You can retrieve the new value in a event handler. - -## Examples - The following code example demonstrates how to use the property to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. - +> This property contains the URL of the current document, even if another document has been requested. If you set the value of this property and then immediately retrieve it again, the value retrieved may be different than the value set if the control has not had time to load the new document. You can retrieve the new value in a event handler. + +## Examples + The following code example demonstrates how to use the property to implement an address bar for the control. This example requires that your form contains a control called `webBrowser1`, a control called `TextBoxAddress`, and a control called `ButtonGo`. When you type a URL into the text box and press ENTER or click the **Go** button, the control navigates to the URL specified. When you navigate by clicking a hyperlink, the text box automatically updates to display the current URL. + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/CPP/form1.cpp" id="Snippet6"::: :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/ToolStripMenuItem/ShortcutKeys/form1.cs" id="Snippet6"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser/VB/form1.vb" id="Snippet6"::: + ]]> This instance is no longer valid. @@ -4054,11 +4054,11 @@ Gets the version of Internet Explorer installed. The version of Internet Explorer installed. - control is a managed wrapper around a component installed with Internet Explorer. Use this property to determine which version of Internet Explorer is installed. This is useful when your application uses a feature of Internet Explorer that is present only in certain versions. If the required version is not present on the local machine, you can provide alternative functionality or prompt the user to upgrade. - + control is a managed wrapper around a component installed with Internet Explorer. Use this property to determine which version of Internet Explorer is installed. This is useful when your application uses a feature of Internet Explorer that is present only in certain versions. If the required version is not present on the local machine, you can provide alternative functionality or prompt the user to upgrade. + ]]> @@ -4097,19 +4097,19 @@ if keyboard shortcuts are enabled within the control; otherwise, . The default is . - control. This is useful when you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines DHTML-based controls with Windows Forms controls. - - You can disable other standard browser features by setting the and properties to `false`. - -## Examples - The following code example demonstrates how to use the property. - + control. This is useful when you want to conceal the fact that you are using the control, for example to create a user interface that seamlessly combines DHTML-based controls with Windows Forms controls. + + You can disable other standard browser features by setting the and properties to `false`. + +## Examples + The following code example demonstrates how to use the property. + :::code language="csharp" source="~/snippets/csharp/System.Windows.Forms/WebBrowser/AllowWebBrowserDrop/form1.cs" id="Snippet3"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet3"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Winforms/System.Windows.Forms.WebBrowser.ObjectForScripting/vb/form1.vb" id="Snippet3"::: + ]]> diff --git a/xml/System.Windows.Forms/WindowsFormsSection.xml b/xml/System.Windows.Forms/WindowsFormsSection.xml index d94f5caf2d7..5ae74da7a81 100644 --- a/xml/System.Windows.Forms/WindowsFormsSection.xml +++ b/xml/System.Windows.Forms/WindowsFormsSection.xml @@ -29,11 +29,11 @@ Defines a new for parsing application settings. This class cannot be inherited. - diff --git a/xml/System.Windows/ContentElement.xml b/xml/System.Windows/ContentElement.xml index 3f4f7fcc577..157730e3d0a 100644 --- a/xml/System.Windows/ContentElement.xml +++ b/xml/System.Windows/ContentElement.xml @@ -11915,7 +11915,7 @@ Note that by default a is not foc This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> @@ -11962,7 +11962,7 @@ Note that by default a is not foc This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> diff --git a/xml/System.Windows/UIElement.xml b/xml/System.Windows/UIElement.xml index 71dad0d6ccc..fc96c04f42a 100644 --- a/xml/System.Windows/UIElement.xml +++ b/xml/System.Windows/UIElement.xml @@ -14886,7 +14886,7 @@ For this call to be successful, some other element in the application needed to This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> @@ -14933,7 +14933,7 @@ For this call to be successful, some other element in the application needed to This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> diff --git a/xml/System.Windows/UIElement3D.xml b/xml/System.Windows/UIElement3D.xml index 3ad04cadfbc..d97a238936e 100644 --- a/xml/System.Windows/UIElement3D.xml +++ b/xml/System.Windows/UIElement3D.xml @@ -12075,7 +12075,7 @@ This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> @@ -12122,7 +12122,7 @@ This `ShouldSerialize` method is provided because the property does not have a simple default value. This method indicates whether the property has changed from its default value. You typically invoke this method if you are either developing a designer or developing your own control incorporating a . - For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/framework/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). + For more information, see [Defining Default Values with the ShouldSerialize and Reset Methods](/dotnet/desktop/winforms/controls/defining-default-values-with-the-shouldserialize-and-reset-methods). ]]> diff --git a/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml b/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml index edefd9b2aee..3b4fd26282a 100644 --- a/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml +++ b/xml/System.Xml.Serialization/UnreferencedObjectEventArgs.xml @@ -50,37 +50,37 @@ Provides data for the known, but unreferenced, object found in an encoded SOAP XML stream during deserialization. - class, see the event of the . - - The event occurs only when you call the method. - - For more information about handling events, see [Events Overview](/dotnet/framework/winforms/events-overview-windows-forms) - - - -## Examples - The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` - - - - - ABCD - - - 1234 - - -``` - + class, see the event of the . + + The event occurs only when you call the method. + + For more information about handling events, see [Events Overview](/dotnet/desktop/winforms/events-overview-windows-forms) + + + +## Examples + The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` + + + + + ABCD + + + 1234 + + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]> @@ -133,28 +133,28 @@ A unique string used to identify the unreferenced object. Initializes a new instance of the class. - to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` - - - - - ABCD - - - 1234 - - -``` - + to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` + + + + + ABCD + + + 1234 + + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]> @@ -205,35 +205,35 @@ Gets the ID of the object. The ID of the object. - property when you need to know when more than one object raises the event. The property allows you to distinguish between multiple instances of unreferenced objects. - - For more information about the property, see the event. - - - -## Examples - The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` - - - - - ABCD - - - 1234 - - -``` - + property when you need to know when more than one object raises the event. The property allows you to distinguish between multiple instances of unreferenced objects. + + For more information about the property, see the event. + + + +## Examples + The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` + + + + + ABCD + + + 1234 + + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]> @@ -284,35 +284,35 @@ Gets the deserialized, but unreferenced, object. The deserialized, but unreferenced, object. - can be cast to the known type if examining its properties is required. - - See the event for more information about the property. - - - -## Examples - The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. - -``` - - - - - ABCD - - - 1234 - - -``` - + can be cast to the known type if examining its properties is required. + + See the event for more information about the property. + + + +## Examples + The following example adds an to an . The event is handled by the `Serializer_UnreferencedObject` method. To run the example, cut and paste the following XML into a file named UnrefObj.xml. + +``` + + + + + ABCD + + + 1234 + + +``` + :::code language="cpp" source="~/snippets/cpp/VS_Snippets_Remoting/UnreferencedObject Event Example/CPP/unrefobj.cpp" id="Snippet1"::: :::code language="csharp" source="~/snippets/csharp/System.Xml.Serialization/UnreferencedObjectEventArgs/Overview/unrefobj.cs" id="Snippet1"::: - :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: - + :::code language="vb" source="~/snippets/visualbasic/VS_Snippets_Remoting/UnreferencedObject Event Example/VB/unrefobj.vb" id="Snippet1"::: + ]]> diff --git a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml index a8caf2b1176..aa2f3502861 100644 --- a/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml +++ b/xml/System.Xml.Serialization/XmlAttributeEventArgs.xml @@ -53,7 +53,7 @@ event occurs only when you call the method. diff --git a/xml/ns-System.Drawing.Drawing2D.xml b/xml/ns-System.Drawing.Drawing2D.xml index ba141f8a2d7..8fa569d4fad 100644 --- a/xml/ns-System.Drawing.Drawing2D.xml +++ b/xml/ns-System.Drawing.Drawing2D.xml @@ -23,6 +23,6 @@ ]]> - Coordinate Systems and Transformations + Coordinate Systems and Transformations diff --git a/xml/ns-System.Drawing.Imaging.xml b/xml/ns-System.Drawing.Imaging.xml index 03c4bb7ebed..b664e7c5984 100644 --- a/xml/ns-System.Drawing.Imaging.xml +++ b/xml/ns-System.Drawing.Imaging.xml @@ -15,10 +15,10 @@ ]]> - Graphics and Drawing in Windows Forms - Images, Bitmaps, and Metafiles + Graphics and Drawing in Windows Forms + Images, Bitmaps, and Metafiles Working with Images, Bitmaps, Icons, and Metafiles - Using Image Encoders and Decoders in Managed GDI+ - Recoloring Images + Using Image Encoders and Decoders in Managed GDI+ + Recoloring Images diff --git a/xml/ns-System.Drawing.Printing.xml b/xml/ns-System.Drawing.Printing.xml index 517158fca32..65c6d14e42d 100644 --- a/xml/ns-System.Drawing.Printing.xml +++ b/xml/ns-System.Drawing.Printing.xml @@ -24,6 +24,6 @@ ]]> - Windows Forms Print Support + Windows Forms Print Support diff --git a/xml/ns-System.Drawing.Text.xml b/xml/ns-System.Drawing.Text.xml index 42e356ceebf..13f78eed83c 100644 --- a/xml/ns-System.Drawing.Text.xml +++ b/xml/ns-System.Drawing.Text.xml @@ -12,6 +12,6 @@ ]]> - Using Fonts and Text + Using Fonts and Text diff --git a/xml/ns-System.Windows.Forms.VisualStyles.xml b/xml/ns-System.Windows.Forms.VisualStyles.xml index 424beaae6b2..22398c600b7 100644 --- a/xml/ns-System.Windows.Forms.VisualStyles.xml +++ b/xml/ns-System.Windows.Forms.VisualStyles.xml @@ -17,6 +17,6 @@ ]]> - Rendering Controls with Visual Styles + Rendering Controls with Visual Styles