Editare

Partajați prin


ParentControlDesigner.CreateTool Method

Definition

Creates a component or control from the specified tool and adds it to the current design document.

Overloads

CreateTool(ToolboxItem, Point)

Creates a component or control from the specified tool and adds it to the current design document at the specified location.

CreateTool(ToolboxItem, Rectangle)

Creates a component or control from the specified tool and adds it to the current design document within the bounds of the specified rectangle.

CreateTool(ToolboxItem)

Creates a component or control from the specified tool and adds it to the current design document.

CreateTool(ToolboxItem, Point)

Important

This API is not CLS-compliant.

Creates a component or control from the specified tool and adds it to the current design document at the specified location.

protected:
 void CreateTool(System::Drawing::Design::ToolboxItem ^ tool, System::Drawing::Point location);
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Point location);
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Point location);
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Point -> unit
[<System.CLSCompliant(false)>]
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Point -> unit
Protected Sub CreateTool (tool As ToolboxItem, location As Point)

Parameters

tool
ToolboxItem

The ToolboxItem to create a component from.

location
Point

The Point, in design-time view screen coordinates, at which to center the component.

Attributes

Remarks

The new component or control is positioned around the location specified by the location parameter. This method uses the default size for the tool's component, if the component has a default size.

To specify a location and size for the component or control, use the appropriate overloaded CreateTool method.

See also

Applies to

CreateTool(ToolboxItem, Rectangle)

Important

This API is not CLS-compliant.

Creates a component or control from the specified tool and adds it to the current design document within the bounds of the specified rectangle.

protected:
 void CreateTool(System::Drawing::Design::ToolboxItem ^ tool, System::Drawing::Rectangle bounds);
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Rectangle bounds);
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool, System.Drawing.Rectangle bounds);
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Rectangle -> unit
[<System.CLSCompliant(false)>]
member this.CreateTool : System.Drawing.Design.ToolboxItem * System.Drawing.Rectangle -> unit
Protected Sub CreateTool (tool As ToolboxItem, bounds As Rectangle)

Parameters

tool
ToolboxItem

The ToolboxItem to create a component from.

bounds
Rectangle

A Rectangle indicating the location and size for the component created from the tool. The X and Y values of the Rectangle indicate the design-time view screen coordinates of the upper-left corner of the component.

Attributes

Remarks

The new component or control is positioned with its upper left corner at the location specified by the X and Y values of the bounds parameter. The size of the new component or control will be set to the values specified by the Height and Width properties of the bounds parameter.

See also

Applies to

CreateTool(ToolboxItem)

Important

This API is not CLS-compliant.

Creates a component or control from the specified tool and adds it to the current design document.

protected:
 void CreateTool(System::Drawing::Design::ToolboxItem ^ tool);
protected void CreateTool (System.Drawing.Design.ToolboxItem tool);
[System.CLSCompliant(false)]
protected void CreateTool (System.Drawing.Design.ToolboxItem tool);
member this.CreateTool : System.Drawing.Design.ToolboxItem -> unit
[<System.CLSCompliant(false)>]
member this.CreateTool : System.Drawing.Design.ToolboxItem -> unit
Protected Sub CreateTool (tool As ToolboxItem)

Parameters

tool
ToolboxItem

The ToolboxItem to create a component from.

Attributes

Remarks

The new component or control is positioned at the center of the currently selected control. This method uses the default size for the tool, if the tool has a default size specified.

To specify a location or location and size for the component or control, use one of the other overloaded CreateTool methods.

See also

Applies to