语言

ParentControlDesigner.CreateTool 方法

定义

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

重载

名称 说明
CreateTool(ToolboxItem, Point)

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

CreateTool(ToolboxItem, Rectangle)

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

CreateTool(ToolboxItem)

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

CreateTool(ToolboxItem, Point)

Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs

重要

此 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)

Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs

重要

此 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 指示从工具创建的组件的位置和大小。 指示 X 组件的左上角的设计时视图屏幕坐标和 Y 值 Rectangle 。

特性

注解

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

另请参阅

适用于

CreateTool(ToolboxItem)

Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs
Source:
ParentControlDesigner.cs

重要

此 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 方法之一。

另请参阅

适用于