aardio 常用语句整合(10)窗口快捷键,热键

admin2021-10-08  2.7K+

经常会用到窗口快捷键,还有热键的设置。下面例子说明窗口热键的用法

import win.ui;
/*DSG{{*/
var winform = win.form(text="窗口控件快捷键例子";right=759;bottom=469)
winform.add(
button={cls="button";text="按钮(&N)";left=270;top=190;right=437;bottom=249;z=1}
)
/*}}*/
 
winform.button.oncommand = function(id,event){
    win.msgbox("我被调用了")
}
 
/*
//使用超级热键也可以
import key.hotkey
$key = key.hotkey(winform)
$key.reg(
    "ALT","N",
    winform.button.oncommand
)
*/
 
//使用窗口快捷键
import win.ui.accelerator
win.ui.accelerator({
    { alt = true; vkey = 'N'#; oncommand = winform.button.oncommand } 
 
},winform);
 
 
winform.show();
win.loopMessage();



转载请注明原文地址: http://aardio.net/read-217.html
最新回复(0)
aardio问答
aardio编程语言