ParentControlDesigner.CreateToolCore 方法

定義

重要

此 API 不符合 CLS 規範。

提供所有 CreateTool(ToolboxItem) 方法的核心功能。

C#
protected virtual System.ComponentModel.IComponent[] CreateToolCore(System.Drawing.Design.ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool hasSize);
C#
[System.CLSCompliant(false)]
protected virtual System.ComponentModel.IComponent[] CreateToolCore(System.Drawing.Design.ToolboxItem tool, int x, int y, int width, int height, bool hasLocation, bool hasSize);

參數

tool
ToolboxItem

用來建立元件的 ToolboxItem

x
Int32

如果指定了大小,則為工具左邊緣位置的水平位置 (以設計階段檢視座標表示);如果未指定大小,則為工具中心的水平位置。

y
Int32

如果指定了大小,則為工具上邊緣位置的垂直位置 (以設計階段檢視座標表示);如果未指定大小,則為工具中心的垂直位置。

width
Int32

工具的寬度。 如果 hasSize 參數設定為 false,會忽略這個參數。

height
Int32

工具的高度。 如果 hasSize 參數設定為 false,會忽略這個參數。

hasLocation
Boolean

如果指定了元件的位置,則為 true;如果元件要放置在目前選取的控制項的中央,則為 false

hasSize
Boolean

如果指定了元件的大小,則為 true;如果要使用元件的預設高度和寬度值,則為 false

傳回

利用工具建立的元件陣列。

屬性

備註

這是唯一 CreateTool 可以覆寫的方法。

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9, 10

另請參閱