各位大神这道VB题怎么做??
1个回答
展开全部
我使用了按钮数组做的:
Private Sub button_Click(Index As Integer)
Select Case Index
Case 0
txtShow.Text = ""
txtShow.Text = InputBox("请输入你的姓名:")
Case 1
txtShow.Text = ""
txtShow.Text = Format(Now, "yyyy-mm-dd")
Case 2
If txtShow.Text <> "" Then
Dim num As Single
num = CSng(txtShow.Text)
txtShow.Text = Format(Sin(Val(num * 3.14 / 180)), "0.0000")
End If
Case 3
If txtShow.Text <> "" Then
If Len(txtShow.Text) = 1 Then
txtShow.Text = Asc(txtShow.Text)
End If
End If
End Select
End Sub
Private Sub button_Click(Index As Integer)
Select Case Index
Case 0
txtShow.Text = ""
txtShow.Text = InputBox("请输入你的姓名:")
Case 1
txtShow.Text = ""
txtShow.Text = Format(Now, "yyyy-mm-dd")
Case 2
If txtShow.Text <> "" Then
Dim num As Single
num = CSng(txtShow.Text)
txtShow.Text = Format(Sin(Val(num * 3.14 / 180)), "0.0000")
End If
Case 3
If txtShow.Text <> "" Then
If Len(txtShow.Text) = 1 Then
txtShow.Text = Asc(txtShow.Text)
End If
End If
End Select
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询