다음을 통해 공유


Window2.WindowState Property

Definition

Gets or sets the state of the window, whether it is minimized, normal, and so forth.

public:
 property EnvDTE::vsWindowState WindowState { EnvDTE::vsWindowState get(); void set(EnvDTE::vsWindowState value); };
public:
 property EnvDTE::vsWindowState WindowState { EnvDTE::vsWindowState get(); void set(EnvDTE::vsWindowState value); };
[System.Runtime.InteropServices.DispId(109)]
public EnvDTE.vsWindowState WindowState { [System.Runtime.InteropServices.DispId(109)] get; [System.Runtime.InteropServices.DispId(109)] set; }
[<System.Runtime.InteropServices.DispId(109)>]
[<get: System.Runtime.InteropServices.DispId(109)>]
[<set: System.Runtime.InteropServices.DispId(109)>]
member this.WindowState : EnvDTE.vsWindowState with get, set
Public Property WindowState As vsWindowState

Property Value

A vsWindowState constant.

Implements

Attributes

Examples

This creates a general text file and displays its WindowState property.

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

Remarks

Because the WindowState property sets or returns whether a window is maximized, minimized, or normal, the environment should be in MDI mode for the following to work correctly.

Applies to