This documentation is archived and is not being maintained.

ButtonState Enumeration

Specifies the appearance of a button.

This enumeration has a FlagsAttribute attribute that allows a bitwise combination of its member values.

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in

<FlagsAttribute> _
Public Enumeration ButtonState
Dim instance As ButtonState

/** @attribute FlagsAttribute() */ 
public enum ButtonState
public enum ButtonState

 Member nameDescription
AllAll flags except Normal are set. 
CheckedThe button has a checked or latched appearance. Use this appearance to show that a toggle button has been pressed. 
FlatThe button has a flat, two-dimensional appearance. 
InactiveThe button is inactive (grayed). 
NormalThe button has its normal appearance (three-dimensional). 
PushedThe button appears pressed. 

This enumeration represents the different states of a button. The default state is Normal.

In this example, you use the ButtonState enumeration as a parameter to the method DrawButton to specify the state of button1. To run the example, create two buttons, button1 and button2. Then replace the button2_Click method with the example code. Click button2 to redraw button1 and change its state to Flat.

Private Sub button2_Click(sender As Object, e As System.EventArgs)
    ' Draws a flat button on button1.
    ControlPaint.DrawButton(System.Drawing.Graphics.FromHwnd(button1.Handle), 0, 0, button1.Width, button1.Height, ButtonState.Flat)
End Sub 'button2_Click

private void button2_Click(Object sender, System.EventArgs e)
    // Draws a flat button on button1.
        button1.get_Handle()), 0, 0, button1.get_Width(), 
        button1.get_Height(), ButtonState.Flat);
} //button2_Click

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0, 1.1, 1.0