请问这个小程序用VB如何编译?
来源:百度知道 编辑:UC知道 时间:2024/09/24 17:19:44
谢谢,不过我想要记分牌那样的,两位,最初显示是01,边框可以修饰的,请问可以做到么?
Private Sub Form_Load()
Text1.Text = 1
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 32 Then
Text1.Text = Val(Text1.Text) + 1
If Val(Text1.Text) > 99 Then Text1.Text = 1
End If
End Sub
测试通过
光标放到文本框上,按空格
Dim i As Integer
Private Sub Form_Load()
i = Format(1, "00")
Text1.Locked = True
End Sub
Private Sub Text1_KeyPress(KeyAscii As Integer)
If KeyAscii = 32 Then
i = Format(i + 1, "00")
Text1.Text = Format(i, "00")
End If
If i >= 99 Then i = Format(0, "00")
End Sub
想要界面美观,最好加图片,
Private Sub Form_Load()
Text1.Text = "01"
End Sub
Private Sub Text1_KeyDown(KeyCode As Integer, Shift As Integer)
If KeyCode = 32 Then
Text1.Text = format(Val(Text1.Text) + 1,"00")
If Val(Text1.Text) > 99 Then Text1.Text