Chinaunix首页 | 论坛 | 博客
  • 博客访问: 4739971
  • 博文数量: 206
  • 博客积分: 5240
  • 博客等级: 大校
  • 技术积分: 3224
  • 用 户 组: 普通用户
  • 注册时间: 2010-08-12 21:40
文章分类

全部博文(206)

文章存档

2013年(13)

2012年(8)

2011年(33)

2010年(152)

我的朋友

分类:

2010-10-19 21:25:47

import win.ui;
/*DSG{{*/
var winform = win.form(parent=...; text="AAuto Form";right=454;bottom=249 )
winform.add( 
num1={ bottom=78;right=78;left=24;top=57;font=LOGFONT( name=
"宋体";h=-12 );z=2;text="";edge=1;cls="edit" };
num2={ bottom=78;right=217;left=162;top=57;font=LOGFONT( name=
"宋体";h=-12 );z=3;text="";edge=1;cls="edit" };
button={ bottom=78;text=
"=";left=228;top=58;font=LOGFONT( name="宋体";h=-12 );z=4;right=261;cls="button" };
num3={ notify=1;right=353;left=275;top=52;font=LOGFONT( name=
"宋体";h=-12 );bottom=78;z=5;transparent=1;text="";edge=1;cls="static" };
combobox={ bottom=79;right=140;left=91;top=59;font=LOGFONT( name=
"宋体";h=-12 );text=" ";z=1;
items={ 
"+";"-";"*";"/" };mode="dropdownlist";edge=1;cls="combobox" }
)
/*}}*/

winform.combobox.oncommand = 
function(id,event){
    
//win.msgbox( winform.combobox.text );
    if(event==0x9/*_CBN_SELENDOK*/){
        str=winform.combobox.selIndex
    }
    
}
//endproc



winform.button.oncommand = 
function(id,event){
    
//win.msgbox( winform.button.text );
    
    
select(str) {
    
case 1 {winform.num3.text=winform.num1.text+winform.num2.text
    }
    
case 2 {winform.num3.text=winform.num1.text-winform.num2.text
    }
    
case 3 {winform.num3.text=winform.num1.text*winform.num2.text
    }
    
case 4 {winform.num3.text=winform.num1.text/winform.num2.text
    }
    
else {break ;
    }
    
    }
    

        
}
//endproc



winform.show() 
win.loopMessage();



阅读(1569) | 评论(0) | 转发(0) |
0

上一篇:控制台 倒计时函数

下一篇:combobox练习2

给主人留下些什么吧!~~