次の方法で共有


Window2.Caption プロパティ

ウィンドウのタイトルを取得または設定します。

名前空間:  EnvDTE80
アセンブリ:  EnvDTE80 (EnvDTE80.dll 内)

構文

'宣言
Default Property Caption As String
string this { get; set; }
property String^ default {
    String^ get ();
    void set (String^ value);
}
abstract Caption : string with get, set
function get Caption () : String
function set Caption (value : String)

プロパティ値

型 : System.String
ウィンドウのタイトル。

解説

Caption はツール ウィンドウに設定できます。

この例では、出力ウィンドウコマンド ウィンドウ、およびソリューション エクスプローラーをリンクします。次に、リンクされたウィンドウの幅と高さを操作し、Caption を含む、いくつかのプロパティを表示します。

このアドインの例を実行する方法の詳細については、「方法 : オートメーション オブジェクト モデルのコード例をコンパイルおよび実行する」を参照してください。

Imports EnvDTE
Imports EnvDTE80
Public Sub OnConnection(ByVal application As Object, _
ByVal connectMode As ext_ConnectMode, ByVal addInInst As Object, _
 ByRef custom As Array) Implements IDTExtensibility2.OnConnection
    _applicationObject = CType(application, DTE2)
    _addInInstance = CType(addInInst, AddIn)
    CaptionExample(_applicationObject)
End Sub
Sub CaptionExample(ByVal dte As DTE2)
    Dim Frame As Window
    Dim w1 As Window = _
 _applicationObject.Windows.Item(Constants.vsWindowKindSolutionExplorer)
    Dim w2 As Window = _
_applicationObject.Windows.Item(Constants.vsWindowKindOutput)
    ' Create a linked window frame and dock Solution Explorer 
    ' and the Ouput window together inside it.
    Frame = _applicationObject.Windows.CreateLinkedWindowFrame(w1, w2, _
    vsLinkedWindowType.vsLinkedWindowTypeDocked)
    MsgBox("Total number of windows in the linked window frame: " & _
    Frame.LinkedWindows.Count)
    ' View some window properties.
    MsgBox("Window ObjectKind property value: " & Frame.ObjectKind)
    MsgBox("Window Caption for w1: " & w1.Caption)
    ' Resize the entire linked window frame.
    Frame.Width = 500
    Frame.Height = 600
    Frame.Left = 100
    MsgBox("Frame height, width, and position changed.")
End Sub
using EnvDTE;
using EnvDTE80;
using System.Windows.Forms;
public void OnConnection(object application,
 ext_ConnectMode connectMode, object addInInst, ref Array custom)
{
    _applicationObject = (DTE2)application;
    _addInInstance = (AddIn)addInInst;
    CaptionExample(_applicationObject);
}
public void CaptionExample(DTE2 dte)
{
    Window Frame;
    Window w1 = 
_applicationObject.Windows.Item(Constants.vsWindowKindSolutionExplorer);
    Window w2 = 
_applicationObject.Windows.Item(Constants.vsWindowKindOutput);
    // Create a linked window frame and dock Solution Explorer
    // and the Output window together inside it.
    Frame = _applicationObject.Windows.CreateLinkedWindowFrame
(w1, w2,vsLinkedWindowType.vsLinkedWindowTypeDocked);
    MessageBox.Show("Total number of windows in the linked 
window frame: " + Frame.LinkedWindows.Count.ToString());
    // View some window properties.
    MessageBox.Show("Window ObjectKind property value: " 
+ Frame.ObjectKind);
    MessageBox.Show("Window Caption for w1: " + w1.Caption);
    // Resize the entire linked window frame.
    Frame.Width = 500;
    Frame.Height = 600;
    Frame.Left = 100;
    MessageBox.Show("Frame height, width, and position changed.");
}

.NET Framework セキュリティ

  • 直前の呼び出し元に対する完全な信頼。このメンバーは、部分的に信頼されているコードから使用することはできません。詳細については、「部分信頼コードからのライブラリの使用」を参照してください。

参照

関連項目

Window2 インターフェイス

Caption オーバーロード

EnvDTE80 名前空間