文档详情

VB自动关机.doc

发布:2017-08-09约4.09千字共7页下载文档
文本预览下载声明
以下是本人自制的自动关机小程序,由VB编写,仅供菜鸟参考,高手请绕道吧! 本程序能在XP,win7等等系统下使用 主界面如下: 这是from1 要是您觉得不好看,完全可以自己设置的,只是我做的有点匆忙,所以没有考虑皮肤。 这是from2 这是from3 代码在下面,菜鸟可以直接复制啊,改一改就可以用了,想要源代码的联系我QQ吧,下面有。 下面是参考程序: 在from1里面: Option Explicit Dim a, b, c, hh, mm, ss As Integer Dim sum, time1, aa As Long Private Sub Command1_Click() a = Val(Text1.Text) b = Val(Text2.Text) c = Val(Text3.Text) sum = a * 3600 + b * 60 + c If Command1.Caption = 开启 Then Command1.Caption = 取消 Text1.Enabled = False Text2.Enabled = False Text3.Enabled = False If Label3.Caption = 小时 Then If sum = 0 Then MsgBox (猪,你输错时间了!) Unload Me Me.Show Else Timer2.Enabled = True Timer2.Interval = 1000 End If Else If a = 0 And a = 24 And b = 0 And b = 59 And c = 0 And c = 59 Then Timer2.Enabled = True Timer2.Interval = 1000 Else MsgBox (笨蛋,有这时间吗?) Unload Me Me.Show End If End If Else Text1.Enabled = True Text2.Enabled = True Text3.Enabled = True Text2.SetFocus Command1.Caption = 开启 Text1.Text = Text2.Text = Text3.Text = Timer2.Enabled = False End If End Sub Private Sub Command2_Click() Form3.Show End Sub Private Sub Command3_Click() Unload Form1 Unload Form2 Form1.Show End Sub Private Sub Command4_Click() End End Sub Private Sub Command5_Click() Text1.Text = Text2.Text = Text3.Text = Label3.Caption = 小时 Label4.Caption = 分 Label5.Caption = 秒 Label6.Caption = 后将自动关机 Label7.Caption = 倒计时模式:请输入倒计时间 Text2.SetFocus End Sub Private Sub Command6_Click() Text1.Text = Text2.Text = Text3.Text = Label3.Caption = : Label4.Caption = : Label5.Caption = Label6.Caption = 将自动关机 Label7.Caption = 定时模式:请输入自动关机时间 Text2.SetFocus End Sub Private Sub Form_Activate() Text1.Enabled = True Text2.Enabled = True Text3.Enabled = True Text2.SetFocus End Sub Private Sub Form_Load() Timer1.Enabled = True Timer1.
显示全部
相似文档