Export (0) Print
Expand All

CreateParams Class

Encapsulates the information needed when creating a control.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public class CreateParams

The information in a CreateParams can be used to pass information about the initial state and appearance of a control. Most Control derived controls override the CreateParams property to pass in the appropriate values or include additional information in the CreateParams.

For more information about creating control parameters, see the CreateWindow and CreateWindowEx functions and the CREATESTRUCT structure documentation in the Windows Platform SDK reference located in the MSDN Library.

NoteNote:

The constants used to set the Style, ExStyle, and ClassStyle properties are defined in the Winuser.h header file. This file is installed by the Platform SDK or Visual Studio .NET.

The following code example creates a Button derived class named MyIconButton and provides the implementation needed for the button to display an Icon rather than an Image. The CreateParams property is extended and a value added to the Style property that causes the button to display an Icon rather than an Image.

No code example is currently available or this language may not be supported.

The following code example creates an instance of a standard Button control and an instance of the derived control, MyIconButton, created in the example above. This example requires that there is an Icon file named Default.ico in the same location as the application. When the application starts, the Default icon is displayed on the MyIconButton button. If the Default icon is not present, the button face is blank. When the standard Button is clicked, an OpenFileDialog box will appear so you can select a new Icon to display on the MyIconButton.

No code example is currently available or this language may not be supported.

System.Object
  System.Windows.Forms.CreateParams

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0, 1.1, 1.0

Community Additions

ADD
Show:
© 2014 Microsoft