# WaynesButtonState class
{: .no_toc }

A bundle of the four style objects that describe a single visual state of a [**WaynesButton**](/tB/Packages/CustomControls/WaynesButton/index.md) --- its corners, background fill, borders, and text rendering. Each button has four parallel instances accessed as [**NormalState**](/tB/Packages/CustomControls/WaynesButton/index.md#normalstate), [**HoverState**](/tB/Packages/CustomControls/WaynesButton/index.md#hoverstate), [**FocusedState**](/tB/Packages/CustomControls/WaynesButton/index.md#focusedstate), and [**PressedState**](/tB/Packages/CustomControls/WaynesButton/index.md#pressedstate); the button picks one at each repaint depending on the mouse / focus state.

Newly-constructed **WaynesButtonState** objects pre-set their **BackgroundFill** to a solid mid-blue and all four corners to a 15-pixel curve. Override per-state to give the button a different look in each state.

The type itself is `Private Class` --- instances are accessed only through the **WaynesButton.…State** properties, and a variable typed as **WaynesButtonState** cannot be declared from outside the package.

```tb check_build
With btnGo.NormalState
    .BackgroundFill.ColorPoints.SetSolidColor vbBlue
    .TextRendering.Fill.ColorPoints.SetSolidColor vbWhite
End With

With btnGo.HoverState
    .BackgroundFill.SetSimplePattern vbBlue, &HE0E0FF, _
            Pattern:=tbGradientNorthToSouth
    .Borders.SetSimpleBorder StrokeSize:=2, ColorRGB:=vbBlue
End With
```

## Properties

### BackgroundFill
{: .no_toc }

The [**Fill**](/tB/Packages/CustomControls/Styles/Fill.md) that paints the button's background.

### Borders
{: .no_toc }

The [**Borders**](/tB/Packages/CustomControls/Styles/Borders.md) that draws the button's border strokes.

### Corners
{: .no_toc }

The [**Corners**](/tB/Packages/CustomControls/Styles/Corners.md) that controls the per-corner shape and radius.

### TextRendering
{: .no_toc }

The [**TextRendering**](/tB/Packages/CustomControls/Styles/TextRendering.md) that controls how the button's [**Caption**](/tB/Packages/CustomControls/WaynesButton/index.md#caption) is drawn.

## Methods

### InitializeDefaults
{: .no_toc }

Resets the state object to the package's defaults --- solid mid-blue **BackgroundFill** and 15-pixel curved corners. Called automatically the first time the parent button is initialized, if no serialized data was loaded.

Syntax: *object*.**InitializeDefaults**

## Events

### OnChanged
{: .no_toc }

Raised whenever any of the four contained style objects raises its own **OnChanged**. The parent [**WaynesButton**](/tB/Packages/CustomControls/WaynesButton/index.md) listens for this and requests a repaint.
