CreateParams Class

 

Encapsulates the information needed when creating a control.

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

System.Object
  System.Windows.Forms.CreateParams

type CreateParams = class end

NameDescription
System_CAPS_pubmethodCreateParams()

Initializes a new instance of the CreateParams class.

NameDescription
System_CAPS_pubpropertyCaption

Gets or sets the control's initial text.

System_CAPS_pubpropertyClassName

Gets or sets the name of the Windows class to derive the control from.

System_CAPS_pubpropertyClassStyle

Gets or sets a bitwise combination of class style values.

System_CAPS_pubpropertyExStyle

Gets or sets a bitwise combination of extended window style values.

System_CAPS_pubpropertyHeight

Gets or sets the initial height of the control.

System_CAPS_pubpropertyParam

Gets or sets additional parameter information needed to create the control.

System_CAPS_pubpropertyParent

Gets or sets the control's parent.

System_CAPS_pubpropertyStyle

Gets or sets a bitwise combination of window style values.

System_CAPS_pubpropertyWidth

Gets or sets the initial width of the control.

System_CAPS_pubpropertyX

Gets or sets the initial left position of the control.

System_CAPS_pubpropertyY

Gets or sets the top position of the initial location of the control.

NameDescription
System_CAPS_pubmethodEquals(Object)

Determines whether the specified object is equal to the current object.(Inherited from Object.)

System_CAPS_protmethodFinalize()

Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.(Inherited from Object.)

System_CAPS_pubmethodGetHashCode()

Serves as the default hash function. (Inherited from Object.)

System_CAPS_pubmethodGetType()

Gets the Type of the current instance.(Inherited from Object.)

System_CAPS_protmethodMemberwiseClone()

Creates a shallow copy of the current Object.(Inherited from Object.)

System_CAPS_pubmethodToString()

Returns a string that represents the current object.(Overrides Object.ToString().)

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.

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

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.

.NET Framework
Available since 1.1

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

Return to top
Show: