Form

GPALTab

Everything on Settings Every Control Takes applies here too. GPAL.Tab builds one and WithText sets the text on the tab itself. A tab is a marker rather than a container you fill: add the tab with WithFormControl and every control added after it goes on that tab, until the next tab is added. Activate switches to the tab at runtime, which is how a workflow chooses the tab the form opens on. The Enabled property greys a whole tab out, putting everything on it out of reach, so the control that turns it back on has to live on a tab that stays enabled. WithShortcutKey gives the tab a key combination. GPAL.TabFor(text) is the shorthand.

NOTE

Being the tab on show is what a tab is for, so that is the event a callback gets without saying which one. The page also has a click of its own, meaning the blank area around the controls sitting on it, and that one has to be asked for by name with ForEvent(ControlEventType.Click). Asking for ForEvent(ControlEventType.SelectedIndexChanged) or ForEvent(ControlEventType.Change) gets the same event as saying nothing.

WARNING

Disabling a tab puts every control on it out of reach, including a button that would turn it back on. Keep that button on a tab that is never disabled.

Examples

GPAL Fluent: High-level fluent C# API

//Activate needs the tab to exist, so call it after the chain ends with ToGPALObject and before Show.

GPALTab settings = (GPALTab)GPAL.Tab.WithText("Settings").WithShortcutKey(Keys.Alt | Keys.D1).WithName("settings");

GPALTab advanced = (GPALTab)GPAL.Tab.WithText("Advanced").WithShortcutKey(Keys.Alt | Keys.D2).WithName("advanced");


myForm = GPAL.Form

.WithFormControl(settings)

.WithFormControl(driverPath) // on Settings

.WithFormControl(headless) // on Settings

.WithFormControl(enableAdvanced) // on Settings, and it turns the other tab back on

.WithFormControl(advanced)

.WithFormControl(retries) // on Advanced

.ToGPALObject();


advanced.Enabled = false; // out of reach until the workflow says otherwise

settings.Activate(); // the tab the form opens on


myForm.Show().ShowDialog();

💬 Ask GPAL