ParentControlDesigner.CreateTool 方法

定义

从指定工具创建一个组件或控件并将其添加到当前的设计文档。

重载

CreateTool(ToolboxItem, Point)

从指定工具创建组件或控件,并将其添至当前设计文档中的指定位置。

CreateTool(ToolboxItem, Rectangle)

从指定工具创建组件或控件,并将其添至当前设计文档中所指定矩形的界限内。

CreateTool(ToolboxItem)

从指定工具创建一个组件或控件并将其添加到当前的设计文档。

CreateTool(ToolboxItem, Point)

重要

此 API 不符合 CLS。

从指定工具创建组件或控件,并将其添至当前设计文档中的指定位置。

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)

参数

tool
ToolboxItem

要从中创建组件的 ToolboxItem

___location
Point

设计时视图屏幕坐标中的 Point,此位置将作为组件的中心。

属性

注解

新组件或控件位于 参数指定 ___location 的位置周围。 此方法使用工具组件的默认大小(如果组件具有默认大小)。

若要指定组件或控件的位置和大小,请使用适当的重载 CreateTool 方法。

另请参阅

适用于

CreateTool(ToolboxItem, Rectangle)

重要

此 API 不符合 CLS。

从指定工具创建组件或控件,并将其添至当前设计文档中所指定矩形的界限内。

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)

参数

tool
ToolboxItem

要从中创建组件的 ToolboxItem

bounds
Rectangle

Rectangle,指示从工具中创建的组件的位置和大小。 XYRectangle 值指示组件左上角的设计时视图屏幕坐标。

属性

注解

新组件或控件的左上角位于 参数的 boundsY 值指定X的位置。 新组件或控件的大小将设置为参数 Height 的 和 Width 属性 bounds 指定的值。

另请参阅

适用于

CreateTool(ToolboxItem)

重要

此 API 不符合 CLS。

从指定工具创建一个组件或控件并将其添加到当前的设计文档。

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)

参数

tool
ToolboxItem

要从中创建组件的 ToolboxItem

属性

注解

新组件或控件位于当前所选控件的中心。 如果工具指定了默认大小,则此方法使用该工具的默认大小。

若要指定组件或控件的位置或位置和大小,请使用其他重载 CreateTool 方法之一。

另请参阅

适用于