WindowState

This property returns and sets a value that indicates the visual state of a form window at run time.

Syntax

object.WindowState [= value]

Parameters

object
Object expression that evaluates to a Form or Window object.
value
Integer that specifies the state of the object. The following table shows the settings for value.
Constant
Value
Description
vbNormal 0 (default) Normal
vbMinimized 1 Minimized (minimized to an icon)
vbMaximized 2 Maximized (enlarged to maximum size)

Remarks

Before a form is displayed, the WindowState property is always set to Normal (0), regardless of its initial setting. This is reflected in the Height, Left, ScaleHeight, ScaleWidth, Top, and Width property settings. If a form is hidden after it has been shown, these properties reflect the previous state until the form is shown again, regardless of any changes made to the WindowState property in the meantime.