TrackBar
#
Examples#
Basicimport { Window, TrackBar } from 'ave-ui';
export function main(window: Window) { const trackBar = new TrackBar(window); trackBar.OnThumbRelease((sender) => { console.log(`on thumb release, current value: ${sender.GetValue()}`); });
const container = getControlDemoContainer(window, 1, 500, 25); container.ControlAdd(trackBar).SetGrid(1, 1); window.SetContent(container);}
Drag it and get value:
In console:
on thumb release, current value: 0on thumb release, current value: 22on thumb release, current value: 46on thumb release, current value: 69on thumb release, current value: 75on thumb release, current value: 85on thumb release, current value: 100...
#
APIexport interface ITrackBar extends IControl { // range is [0,100] GetValue(): number; SetValue(nValue: number): TrackBar;
// OnThumbRelease(fn: (sender: TrackBar) => void): TrackBar;}