计算代码如下 写在 计算 按钮的 click 事件下即可 a=val(alltrim(thisform.text1.value)) &;&;去除前后空格,并将字符型数据转换为 数值型数据 b=val(alltrim(thisform.text2.value)) &;&;由于文本框默认的数据类型是字符型, 所以要转换 if thisform.optiongroup1.value=1 thisform.text3.value=a+b endif if thisform.optiongroup1.value=2 thisform.text3.value=a-b endif if thisform.optiongroup1.value=3 thisform.text3.value=a*b endif if thisform.optiongroup1.value=4 thisform.text3.value=a/b endif 退出命令是 thisform.release