Form

GPALLabel

Everything on Settings Every Control Takes applies here too. GPAL.Label builds one and WithText sets what it says. Labels take the font settings: WithFont for the typeface and size, WithTextAlignment for where the text sits in the space the label occupies, and WithAutoSize to let the label size itself to its text rather than hold the size it was given. The Text property changes what it says at runtime, which is how a label becomes a progress or status line. GPAL.LabelFor(text) is the shorthand, and is the usual way to caption another control.

Examples

GPAL Fluent: High-level fluent C# API

//The captions are built inline with LabelFor because nothing reads them back. The heading is a declared field because the workflow changes it.

GPALLabel heading = (GPALLabel)GPAL.Label

.WithText("GPAL Form Tester")

.WithFont(new Font("Georgia", 16))

.WithTextAlignment(ContentAlignment.MiddleCenter)

.WithName("heading");


GPAL.Form

.WithFormControl(heading)

.WithFormControl(GPAL.LabelFor("Driver location:"))

.WithFormControl(driverPath)

.ShowDialog();


heading.Text = "Working...";

💬 Ask GPAL