当前位置:编程学习 > VB >>

怎样在vb里编计算器?

包括源代码

追问:我是个新手,能否将每个键的代码分清楚。谢啦
答案:
简单的计算器  
Friend WithEvents Button16 As System.Windows.Forms.Button
Friend WithEvents Button15 As System.Windows.Forms.Button
Friend WithEvents Button14 As System.Windows.Forms.Button
Friend WithEvents Button13 As System.Windows.Forms.Button
Friend WithEvents Button12 As System.Windows.Forms.Button
Friend WithEvents Button11 As System.Windows.Forms.Button
Friend WithEvents Button10 As System.Windows.Forms.Button
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
TextBox1.Text = TextBox1.Text & 1
End Sub
Private Sub Button3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button3.Click
TextBox1.Text = TextBox1.Text & 2
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
TextBox1.Text = TextBox1.Text & 3
End Sub
Private Sub Button5_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button5.Click
TextBox1.Text = TextBox1.Text & 4
End Sub
Private Sub Button6_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button6.Click
TextBox1.Text = TextBox1.Text & 5
End Sub
Private Sub Button7_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button7.Click
TextBox1.Text = TextBox1.Text & 6
End Sub
String, z As String

上一个:VB和C语言 怎么学?
下一个:一个vb程序的问题

CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,