Condividi tramite


Proprietà Window2.WindowState

Ottiene o imposta lo stato della finestra, se viene ridotta a icona, normale, e così via.

Spazio dei nomi:  EnvDTE80
Assembly:  EnvDTE80 (in EnvDTE80.dll)

Sintassi

'Dichiarazione
Property WindowState As vsWindowState
vsWindowState WindowState { get; set; }
property vsWindowState WindowState {
    vsWindowState get ();
    void set (vsWindowState value);
}
abstract WindowState : vsWindowState with get, set
function get WindowState () : vsWindowState
function set WindowState (value : vsWindowState)

Valore proprietà

Tipo: EnvDTE.vsWindowState
In vsWindowState costante.

Note

Poiché WindowState la proprietà imposta o restituisce se una finestra viene ingrandita, ridotta a icona, o il normale, l'ambiente deve essere in modalità MDI affinché l'esempio seguente funzionino correttamente.

Esempi

In questo modo viene creato un file di testo generale e visualizza il relativo WindowState proprietà.

Per ulteriori informazioni su come eseguire questo esempio viene illustrato come componente aggiuntivo, vedere Procedura: compilare ed eseguire gli esempi di codice del modello a oggetti di automazione.

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)
    WindowStateExample(_applicationObject)
End Sub
Sub WindowStateExample(ByVal dte As DTE2)
    Dim win As Window2
    win = CType(_applicationObject.ItemOperations.NewFile _
    ("General\Text File"), Window2)
    MsgBox("Windowstate of " & win.Caption & " is "  _
    & (win.WindowState.ToString))
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;
    WindowStateExample(_applicationObject);
}
public void WindowStateExample(DTE2 dte)
{
    Window2 win;
    win = (Window2)_applicationObject.ItemOperations.NewFile
(@"General\Text File", "MyTextFile", Constants.vsViewKindTextView);
    MessageBox.Show("Windowstate of " + win.Caption + " is " 
+ win.WindowState.ToString());
}

Sicurezza di .NET Framework

Vedere anche

Riferimenti

Window2 Interfaccia

Overload WindowState

Spazio dei nomi EnvDTE80