
怎么用VB设计代码,响应键盘上的加减乘除,比如,按键盘上的“+”时,程序就可以吧两个数值相加 20
展开全部
界面:
代码:
Private Sub Text2_KeyPress(KeyAscii As Integer)
Text2.Text = ""
Select Case KeyAscii
Case Asc("+")
Text1(2).Text = Val(Text1(0).Text + Val(Text1(1).Text))
Case Asc("-")
Text1(2).Text = Val(Text1(0).Text - Val(Text1(1).Text))
Case Asc("*")
Text1(2).Text = Val(Text1(0).Text * Val(Text1(1).Text))
Case Asc("/")
Text1(2).Text = Val(Text1(0).Text / Val(Text1(1).Text))
End Select
End Sub
运行效果:

2023-06-12 广告
单片机汇编程序是用汇编语言编写的程序,用于控制单片机的操作。汇编语言是一种比较接近计算机硬件语言的低级语言,相对于高级语言来说更容易理解和实现。下面是单片机汇编程序的基本步骤:1. 将代码和数据汇编到规定的段中。2. 在存储器中用未初始化的...
点击进入详情页
本回答由意法半导体(中国)投资有限公司提供
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询
广告 您可能关注的内容 |