Share via


IToolboxService.GetSelectedToolboxItem 方法

定義

取得目前選取的工具箱項目。

多載

GetSelectedToolboxItem()

取得目前選取的工具箱項目。

GetSelectedToolboxItem(IDesignerHost)

取得目前選取的工具箱項目 (如果它對所有設計工具是可用的,或它支援指定的設計工具)。

GetSelectedToolboxItem()

取得目前選取的工具箱項目。

public:
 System::Drawing::Design::ToolboxItem ^ GetSelectedToolboxItem();
public System.Drawing.Design.ToolboxItem GetSelectedToolboxItem ();
abstract member GetSelectedToolboxItem : unit -> System.Drawing.Design.ToolboxItem
Public Function GetSelectedToolboxItem () As ToolboxItem

傳回

目前選取的 ToolboxItem,如果還沒有工具箱項目被選取,則為 null

適用於

GetSelectedToolboxItem(IDesignerHost)

取得目前選取的工具箱項目 (如果它對所有設計工具是可用的,或它支援指定的設計工具)。

public:
 System::Drawing::Design::ToolboxItem ^ GetSelectedToolboxItem(System::ComponentModel::Design::IDesignerHost ^ host);
public System.Drawing.Design.ToolboxItem GetSelectedToolboxItem (System.ComponentModel.Design.IDesignerHost host);
abstract member GetSelectedToolboxItem : System.ComponentModel.Design.IDesignerHost -> System.Drawing.Design.ToolboxItem
Public Function GetSelectedToolboxItem (host As IDesignerHost) As ToolboxItem

參數

host
IDesignerHost

IDesignerHost,選取的工具必須與之關聯才能被傳回。

傳回

目前選取的 ToolboxItem,如果目前沒有選取工具箱項目,則為 null

備註

如果目前不是設計工具特定ToolboxItem,這個方法會傳回目前選取ToolboxItem的,而且只有在參數中指定的host設計工具主機類型符合目前選取的設計工具類型支援時,才會傳回目前選取ToolboxItem的設計工具。

適用於