Window2.LinkedWindowFrame 属性

定义

获取一个 Window 对象,该对象表示包含窗口的窗口框架。

public:
 property EnvDTE::Window ^ LinkedWindowFrame { EnvDTE::Window ^ get(); };
public:
 property EnvDTE::Window ^ LinkedWindowFrame { EnvDTE::Window ^ get(); };
[System.Runtime.InteropServices.DispId(117)]
public EnvDTE.Window LinkedWindowFrame { [System.Runtime.InteropServices.DispId(117)] get; }
[<System.Runtime.InteropServices.DispId(117)>]
[<get: System.Runtime.InteropServices.DispId(117)>]
member this.LinkedWindowFrame : EnvDTE.Window
Public ReadOnly Property LinkedWindowFrame As Window

属性值

Window

Window 对象。

实现

属性

示例

此示例将创建一个链接的窗口框架,将 输出窗口解决方案资源管理器 添加到作为垂直窗口的链接框架,激活链接的窗口框架,然后从该框架取消停靠窗口。

Imports EnvDTE  
Imports EnvDTE80  
Sub LinkedWindowFrameExample(ByVal dte As DTE2)  
    Dim Frame As Window2  
    Dim w1 As Window2 = _  
    CType(dte.Windows.Item _  
(Constants.vsWindowKindSolutionExplorer),Window2)  
     Dim w2 As Window2 = CType(dte.Windows.Item _  
(Constants.vsWindowKindOutput), Window2)  
    ' Create a linked window frame and dock Solution Explorer   
    ' and the Ouput window together inside it.  
    Frame = Ctype(dte.Windows.CreateLinkedWindowFrame(w1, w2, _  
    vsLinkedWindowType.vsLinkedWindowTypeVertical), Window2)  
    MsgBox("Activating the linked window frame...")  
    Frame.LinkedWindows.Item(1).LinkedWindowFrame.Activate()  
    MsgBox("Removing Solution Explorer from the linked frame...")  
    Frame.LinkedWindows.Remove(w1)  
    MsgBox("Removing the Output window from the linked frame...")  
    Frame.LinkedWindows.Remove(w2)  
End Sub  
using EnvDTE;  
using EnvDTE80;  
using System.Windows.Forms;  
public void LinkedWindowFrameExample(DTE2 dte)  
{  
    Window2 w1 = (Window2)_applicationObject.Windows.Item  
(Constants.vsWindowKindSolutionExplorer);  
    Window2 w2 = (Window2)_applicationObject.Windows.Item  
(Constants.vsWindowKindOutput);  
    Window2 Frame =   
(Window2)_applicationObject.Windows.CreateLinkedWindowFrame  
(w1, w2, vsLinkedWindowType.vsLinkedWindowTypeVertical);  
    MessageBox.Show("Activating the linked window frame...");  
    Frame.LinkedWindows.Item(1).LinkedWindowFrame.Activate();  
    MessageBox.Show("Removing Solution Explorer   
from the linked frame...");  
    Frame.LinkedWindows.Remove(w1);  
    MessageBox.Show("Removing the Output window from the   
linked frame...");  
    Frame.LinkedWindows.Remove(w2);  
}  

注解

请注意,如果窗口停靠在主窗口的一侧,则 LinkedWindowFrame 是与主环境窗口相同的对象。

如果窗口未链接,为类型 LinkedWindowFrame 、为隐藏或为文档,则 LinkedWindowFrame 返回 Nothing 。 隐藏的窗口不会被视为已链接,因为它们不在窗口框架中。

适用于