Window2.Width プロパティ

ウィンドウの幅を文字単位で取得または設定します。

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

構文

'宣言
Property Width As Integer
int Width { get; set; }
property int Width {
    int get ();
    void set (int value);
}
abstract Width : int with get, set
function get Width () : int 
function set Width (value : int)

プロパティ値

型 : Int32
ウィンドウの幅 (文字単位)。

この例では、Windows コレクションの最初のウィンドウを選択して、Width プロパティを表示します。

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

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)
    WidthExample(_applicationObject)
End Sub
Sub WidthExample(ByVal dte As DTE2)
    Dim objWin As Window2
    objWin = CType(_applicationObject.Windows.Item(1), Window2)
    MsgBox("Window width of " & objWin.Caption & " is " & objWin.Width)
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;
    WidthExample(_applicationObject);
}
public void WidthExample(DTE2 dte)
{
    Window2 objWin;
    objWin = (Window2)_applicationObject.Windows.Item(1);
    MessageBox.Show("Window width of " + objWin.Caption + " is " 
+ objWin.Width);
}

.NET Framework セキュリティ

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

参照

関連項目

Window2 インターフェイス

EnvDTE80 名前空間