ListBox
#
Examples#
Basicimport { Window, ListBox } from 'ave-ui';
export function main(window: Window) { const listBox = new ListBox(window); listBox.Append('a'); listBox.Append('b'); listBox.Append('c'); listBox.OnSelectionEnd((sender) => { console.log(sender.GetSelection()); });
const container = getControlDemoContainer(window, 1, 200, 300); container.ControlAdd(listBox).SetGrid(1, 1); window.SetContent(container);}
Display a list of items, and get index of selected item:
In console:
012
#
APIexport interface IKnob extends IControl { Append(text: string): ListBox; OnSelectionEnd(callback: (sender: ListBox) => void): ListBox; GetSelection(): number;}