語言

ParentControlDesigner.CreateTool 方法

定義

從指定的工具建立元件或控制項,並將其加入目前的設計文件中。

多載

名稱 Description
CreateTool(ToolboxItem, Point)

從指定工具建立元件或控制項,並將其加入目前設計文件中指定位置。

CreateTool(ToolboxItem, Rectangle)

從指定工具建立元件或控制項,並在指定矩形範圍內將其加入目前的設計文件中。

CreateTool(ToolboxItem)

從指定的工具建立元件或控制項,並將其加入目前的設計文件中。

CreateTool(ToolboxItem, Point)

來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
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)

來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
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

A Rectangle 表示由工具產生元件的位置與大小。 X的 和 YRectangle 值表示元件左上角的設計時視圖座標。

屬性

備註

新的元件或控制項會將其左上角置於參數 X 的 和 Y 值 bounds 指定的位置。 新元件或控制項的大小會設定為參數 HeightWidthbounds 屬性所指定的值。

另請參閱

適用於

CreateTool(ToolboxItem)

來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
ParentControlDesigner.cs
來源:
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 載方法之一。

另請參閱

適用於