急求一vb小程序,校选的期末作业,简单点的,自己做的就好,不胜感激!
老师给我们安装的是visualstudio2008这个程序,听了几节课,就是什么windows窗体,什么button的一些东西,完全不知道怎么做程序啊,现在交作业了,大家...
老师给我们安装的是visual studio 2008 这个程序,听了几节课,就是什么windows窗体,什么button的一些东西,完全不知道怎么做程序啊,现在交作业了,大家帮帮,有成品发到965287602@qq.com
展开
2个回答
展开全部
VB简单计时代码:
代码如下:
Dim s
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Command3_Click()
Text2.Text = ""
Text3.Text = "0"
s = 0
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Form1.Caption = "综合应用"
Label1.Caption = "现在时间:"
Label2.Caption = "计时(秒):"
Label3.Caption = "总用时(秒):"
Text1.Text = ""
Text2.Text = ""
Text3.Text = "0"
Command1.Caption = "开始"
Command2.Caption = "停止"
Command3.Caption = "重新计时"
Command4.Caption = "关闭"
s = 0
Timer1.Interval = 1000
Timer1.Enabled = False
Timer2.Interval = 1000
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
s = s + 1
Text2.Text = s
Text3.Text = s
End Sub
Private Sub Timer2_Timer()
Text1.Text = Now
End Sub
代码如下:
Dim s
Private Sub Command1_Click()
Timer1.Enabled = True
End Sub
Private Sub Command2_Click()
Timer1.Enabled = False
End Sub
Private Sub Command3_Click()
Text2.Text = ""
Text3.Text = "0"
s = 0
End Sub
Private Sub Command4_Click()
End
End Sub
Private Sub Form_Load()
Form1.Caption = "综合应用"
Label1.Caption = "现在时间:"
Label2.Caption = "计时(秒):"
Label3.Caption = "总用时(秒):"
Text1.Text = ""
Text2.Text = ""
Text3.Text = "0"
Command1.Caption = "开始"
Command2.Caption = "停止"
Command3.Caption = "重新计时"
Command4.Caption = "关闭"
s = 0
Timer1.Interval = 1000
Timer1.Enabled = False
Timer2.Interval = 1000
Timer2.Enabled = True
End Sub
Private Sub Timer1_Timer()
s = s + 1
Text2.Text = s
Text3.Text = s
End Sub
Private Sub Timer2_Timer()
Text1.Text = Now
End Sub
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询