MainWindow Property

Applies To

VBE object.

Description

Returns a Window object representing the main window of the Visual Basic development environment. Read-only.

Remarks

You can use the Window object returned by the MainWindow property to add or remove docked windows. You can also use the Window object returned by the MainWindow property to maximize, minimize, hide, or restore the main window of the Visual Basic development environment.

See Also

ActiveWindow property, Add method, Caption property, Close method, Remove method, SetFocus method, Visible property, Window object, Windows collection.

Example

The following example uses the MainWindow property to return the Window object representing the main window, and then prints the caption of the main window.

Debug.Print Application.VBE.MainWindow.Caption