listview追加数据行的方法

admin2020-12-16  1.6K+

import win.ui;
/*DSG{{*/
var winform = win.form(text="aardio form";right=759;bottom=469)
winform.add(
button={cls="button";text="add 1";left=32;top=24;right=151;bottom=92;z=2};
button2={cls="button";text="add n";left=32;top=123;right=151;bottom=191;z=3};
listview={cls="listview";left=164;top=26;right=708;bottom=430;edge=1;z=1}
)
/*}}*/

winform.listview.setColumns({"col1","col2","col3"})
winform.listview.items={{1;2;3}}
winform.button.oncommand = function(id,event){
    winform.listview.addItem({3;4;5})
}

winform.button2.oncommand = function(id,event){
    var newItems={
            {1;2;3};
            {4;5;6};
            {7;8;9};
        }
    winform.listview.items=table.concat(winform.listview.items,newItems)
}

winform.show();
win.loopMessage();

转载请注明原文地址: http://www.aardio.net/read-93.html

最新回复(0)
源码分享
aardio源码分享