ToolBoxTab2.Activate Yöntem
Odağı geçerli öğeye hareket ettirir.
Ad alanı: EnvDTE80
Derleme: EnvDTE80 (EnvDTE80.dll içinde)
Sözdizimi
'Bildirim
Sub Activate
void Activate()
void Activate()
abstract Activate : unit -> unit
function Activate()
Notlar
Zaman Activate olduğundan çağrılan, bu kullanıcı öğesini tıklattıysanız, ancak hiçbir click olayı ortaya gibi olur.
Örnekler
Bunu yapmak kullanıcı seçerse, bu örnek, yeni bir öğeye bir Toolbox sekmesi etkinleştirir ve onu da siler ekler.Bu örnek, bir eklenti çalıştırma hakkında daha fazla bilgi için bkz: Nasıl yapılır: derlemek ve Otomasyon nesne modeli kod örneklerini çalıştırmak.
Sub ActivateExample(ByVal dte As DTE2)
' Add a new tab to the Toolbox.
Dim box As ToolBox = dte.ToolWindows.ToolBox
Dim tab As ToolBoxTab2 = CType(box.ToolBoxTabs.Add _
("Sample ToolBoxTab"),ToolBoxTab2)
' 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 ActivateExample(DTE2 dte)
{
// Add a new tab to the Toolbox.
ToolBox box = dte.ToolWindows.ToolBox;
ToolBoxTab2 tab = (ToolBoxTab2)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();
}
.NET Framework Güvenliği
- Anında arayanlar için tam güven. Bu üye kısmen güvenilen kodla kullanılamaz. Daha fazla bilgi için bkz. Kısmen güvenilen kod kitaplıklarını kullanma.