文件名称:vb计算器编程详解
文件大小:74KB
文件格式:DOC
更新时间:2015-01-08 04:39:49
vb 计算器 代码 详解
vb计算器编程的详细过程 部分代码如下 用到控件有 一个按钮控件数组command1 0-16共 17个 一个frame 一个label 一个文本框 代码如下: Private Sub Command1_Click(Index As Integer) Dim jia, jian, cheng, chu As Double Dim qian, hou As String If Index = 0 Then If jisuan = 1 Then Text1.Text = 7 End If Text1.Text = Text1.Text & 7 jisuan = 0 ElseIf Index = 1 Then Text1.Text = Text1.Text & 8 ElseIf Index = 2 Then Text1.Text = Text1.Text & 9 ElseIf Index = 3 Then Text1.Text = Text1.Text & 4 ElseIf Index = 4 Then Text1.Text = Text1.Text & 5 ElseIf Index = 5 Then Text1.Text = Text1.Text & 6 ElseIf Index = 6 Then Text1.Text = Text1.Text & 1 ElseIf Index = 7 Then Text1.Text = Text1.Text & 2 ElseIf Index = 8 Then Text1.Text = Text1.Text & 3