Form

GPALSlider

Everything on Settings Every Control Takes applies here too. GPAL.Slider builds one. WithMinimum and WithMaximum set the range, WithValue where the thumb starts, WithTickFrequency how often a tick is drawn along the track, and WithOrientation whether it lies horizontal or vertical. Scroll and ValueChanged are the events to hang a handler on, and the underlying control is a TrackBar, so a handler reads bar.Value from the sender. It reports its range to UIAutomation, which is what the application side's SetRange drives. GPAL.SliderFor(maximum) is the shorthand.

Examples

GPAL Fluent: High-level fluent C# API

//The handler takes the value from the sender rather than from the GPAL control, which is what lets one handler serve several sliders.

GPALSlider width = (GPALSlider)GPAL.Slider

.WithMinimum(75)

.WithMaximum(340)

.WithValue(175)

.WithTickFrequency(25)

.WithOrientation(Orientation.Horizontal)

.WithCallback<EventHandler>(WidthChanged)

.WithName("width");


void WidthChanged(object sender, EventArgs e)

{

if (sender is TrackBar bar)

status.Text = $"Buttons: {bar.Value}px";

}

💬 Ask GPAL