# Styles

The shared appearance helper classes used by the [**CustomControls**](/tB/Packages/CustomControls/index.md) package's concrete `Waynes…` controls. Each is a small container of related visual settings --- a [**Fill**](/tB/Packages/CustomControls/Styles/Fill.md) is a colour or gradient, a [**Borders**](/tB/Packages/CustomControls/Styles/Borders.md) is an array of border strokes, a [**Corners**](/tB/Packages/CustomControls/Styles/Corners.md) is the shape and radius of each corner, and so on. Controls compose them through `Public WithEvents …` properties: a [**WaynesButton**](/tB/Packages/CustomControls/WaynesButton/index.md) holds four [**WaynesButtonState**](/tB/Packages/CustomControls/WaynesButton/WaynesButtonState.md) sub-objects (Normal / Hover / Focused / Pressed), each of which has its own [**BackgroundFill**](/tB/Packages/CustomControls/WaynesButton/WaynesButtonState.md#backgroundfill), [**Borders**](/tB/Packages/CustomControls/WaynesButton/WaynesButtonState.md#borders), [**Corners**](/tB/Packages/CustomControls/WaynesButton/WaynesButtonState.md#corners), and [**TextRendering**](/tB/Packages/CustomControls/WaynesButton/WaynesButtonState.md#textrendering).

Every style object raises an **OnChanged** event whenever any of its public fields is assigned. The hosting control listens for that event on each of its sub-objects and asks the framework to repaint, so style changes made at runtime are reflected immediately.

| Class | Role |
|-------|------|
| [Anchors](/tB/Packages/CustomControls/Styles/Anchors.md) | which sides of a control are attached to the container when it resizes |
| [Borders](/tB/Packages/CustomControls/Styles/Borders.md) | an array of border strokes drawn around a region; contains the per-stroke `Border` sub-object |
| [Corners](/tB/Packages/CustomControls/Styles/Corners.md) | the four corner shapes / radii of a region; contains the per-corner `Corner` sub-object |
| [Fill](/tB/Packages/CustomControls/Styles/Fill.md) | the colour or gradient that paints a region; contains the `FillColorPoint` and `FillColorPoints` sub-objects that hold the gradient stops |
| [Line](/tB/Packages/CustomControls/Styles/Line.md) | a single grid- or resizer-line stroke; a thinner shape than a full border |
| [Padding](/tB/Packages/CustomControls/Styles/Padding.md) | per-side padding around text inside a [**TextRendering**](/tB/Packages/CustomControls/Styles/TextRendering.md) |
| [TextRendering](/tB/Packages/CustomControls/Styles/TextRendering.md) | font, padding, fill, outlines, alignment, and overflow for text; contains the `FontStyle` sub-object that holds the font metrics |

The style classes are declared `Private Class` in the **CustomControlsPackage** source --- they cannot be created with `New` from outside the package, and a variable cannot be typed as e.g. `Dim x As Fill` from a referencing project. Application code accesses every style object exclusively through the property chain that hangs off a concrete control.
