Partager via


Window2.WindowState, propriété

Obtient ou définit l'état de la fenêtre : réduite en icône, normale, etc.

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.dll)

Syntaxe

'Déclaration
Property WindowState As vsWindowState
    Get
    Set
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)

Valeur de propriété

Type : EnvDTE.vsWindowState
Constante vsWindowState.

Implémentations

Window.WindowState

Notes

Étant donné que la propriété WindowState définit ou retourne une valeur indiquant si une fenêtre est agrandie, réduite ou normale, l'environnement doit être en mode MDI pour que le code suivant fonctionne correctement.

Exemples

Cela crée un fichier de texte général et affiche sa propriété WindowState.

Pour plus d'informations sur l'exécution de cet exemple comme complément, consultez Comment : compiler et exécuter les exemples de code du modèle objet Automation.

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());
}

Sécurité .NET Framework

Voir aussi

Référence

Window2 Interface

WindowState, surcharge

EnvDTE80, espace de noms