Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
? ? Dim nianxian As Integer '年限变量
? ? Dim dingcun As Integer '定存变量
? ? Dim fuli_big As Long '大复利
? ? Dim fuli_small As Long '小复利
? ? Dim i As Integer '循环变量
? ? Dim DATAstring As String '数据字符串
? ? nianxian = Val(年限_TextBox.Text)
? ? dingcun = Val(定存_TextBox.Text)
? ? DATAstring = ""
? ? For i = 1 To nianxian
? ? ? ? dingcun = fuli_small
? ? ? ? fuli_big = fuli_big + fuli_small
? ? Next
? ? 'fuli_big = fuli_small
? ? TextBox1.Text = DATAstring
? ? 结果_TextBox.Text = Str(fuli_big) + "元"
End Sub
Dim flag As Boolean 'flag它是过程及的变量,在通用里必须声明
'在数字按钮控件单击数组单击事件中获取操作数(没有区分是哪一个操作数)
Private Sub Command1_Click(Index As Integer)
x = Text1.Text
If flag = True Or x = "0" Then '查看数字是否输入完毕或者是否清零了
Text1.Text = CStr(Index) 'CStr将数值转换字符
Else
Text1.Text = Text1.Text + CStr(Index) '"+"今天这一节这个是对字符串的操作的叠加,CStr(Index)是接的数据
End If
flag = False '时刻准备数字的输入
flag = True
s1 = Val(Text1.Text)
Select Case Index
Case 0
a = "+"
Case 1
a = "-"
a = "*"
a = "/"
End Select
Select Case a
Case "+"
Case "-"
Case "*"
Case "/"
Text1.Text = "0"
s1 = 0
a = ""
flag = False
If Text1.Text = "" Then
Text1.Text = Left(Text1.Text, Len(Text1.Text) - 1)
'len求字符串的长度,left(text1.len(text1)-1减1是取字符串从左往右减去一个字符串
Text1 = Text1 "."
Dim temp As Double
temp = -Val(Text1.Text)
Text1.Text = temp
End
Private Sub Form_Load() '窗体初始化
Text1.Text = 0
Text1.Locked = True
'改成这样试试
Sub?Add(ByVal?a?As?Integer,?ByVal?b?As?Integer)
a=a+1
b+b+1
End?Sub
以上就是土嘎嘎小编为大家整理的vb.net代码事例的简单介绍vb.net代码事例的简单介绍相关咨询咨询主题介绍,如果您觉得小编更新的文章只要能对粉丝们有用,就是我们最大的鼓励和动力,不要忘记讲本站分享给您身边的朋友哦!!