龙盟编程博客 | 无障碍搜索 | 云盘搜索神器
快速搜索
主页 > 软件开发 > VB开发 >

vb.net实现简单的眼睛保护系统(2)

时间:2009-12-30 15:42来源:未知 作者:admin 点击:
分享到:
Handles Me.FormClosing If flag Then e.Cancel = True End If End Sub Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Me.Timer1.Interval = CLng(Form1
Handles Me.FormClosing
        If flag Then
            e.Cancel = True
        End If
    End Sub
    Private Sub Form2_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Me.Timer1.Interval = CLng(Form1.MaskedTextBox2.Text) * 1000 * 60
        Me.ProgressBar1.Minimum = 0
        Me.ProgressBar1.Maximum = CLng(Form1.MaskedTextBox2.Text) * 60

    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick

        Form1.Timer2.Enabled = True

        Me.Close()

    End Sub

    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        If i <= CInt(Form1.MaskedTextBox2.Text) * 60 Then
            Me.Focus()
            Me.TopMost = True
            If i = CInt(Form1.MaskedTextBox2.Text) * 60 - 10 Then
                flag = False

            End If
            Me.WindowState = FormWindowState.Maximized
            i = i + 1
            Me.ProgressBar1.Value = i
        End If

    End Sub

End Class

   4.小结:这个软件基本上实现了保护眼睛和身体的作用,可以阻止疯狂的使用电脑而不休息。对于保护好自己的眼睛和身体有重要的作用!特色:打开后不能关闭。除非在任务管理器中结束进程!需要.NET Framework支持。强制保护你的身体!有好的身体才有好的明天!建议用1分钟测试!

精彩图集

赞助商链接