ToolBoxItem2.Select 方法
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
导致此项在集成开发环境 (IDE) 中变为活动状态。
public:
void Select();
public:
void Select();
void Select();
[System.Runtime.InteropServices.DispId(4)]
public void Select ();
[<System.Runtime.InteropServices.DispId(4)>]
abstract member Select : unit -> unit
Public Sub Select ()
实现
- 属性
示例
Sub SelectExample(ByVal dte As DTE2)
' Add a new tab to the Toolbox.
Dim box As ToolBox = dte.ToolWindows.ToolBox
Dim tab As ToolBoxTab = box.ToolBoxTabs.Add("Sample ToolBoxTab")
' Add two ToolBoxItem objects to the new Toolbox tab.
Dim item As ToolBoxItem = tab.ToolBoxItems.Add("Text Item", _
"Hello, text item!")
tab.ToolBoxItems.Add("HTML Item", "Hello, HTML item!", _
vsToolBoxItemFormat.vsToolBoxItemFormatHTML)
' Select the "Text Item" ToolBox item.
box.Parent.AutoHides = False
box.Parent.Activate()
tab.Activate()
item.Select()
If MsgBox("Delete the selected ToolBox item?", MsgBoxStyle.YesNo) _
= MsgBoxResult.Yes Then
item.Delete()
End If
End Sub
public void SelectExample(DTE2 dte)
{
// Add a new tab to the Toolbox.
ToolBox box = dte.ToolWindows.ToolBox;
ToolBoxTab tab = box.ToolBoxTabs.Add("Sample ToolBoxTab");
// Add two ToolBoxItem objects to the new Toolbox tab.
ToolBoxItem item = tab.ToolBoxItems.Add("Text Item",
"Hello, text item!",
vsToolBoxItemFormat.vsToolBoxItemFormatText);
tab.ToolBoxItems.Add("HTML Item", "Hello, HTML item!",
vsToolBoxItemFormat.vsToolBoxItemFormatHTML);
// Select the "Text Item" ToolBox item.
box.Parent.AutoHides = false;
box.Parent.Activate();
tab.Activate();
item.Select();
if (MessageBox.Show("Delete the selected ToolBox item?", "",
MessageBoxButtons.YesNo) == DialogResult.Yes)
item.Delete();
}
注解
此方法导致在 "工具箱" 中选择此项。