⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ve-387.tmp

📁 这是我自己用VB.NET编写的一款监护仪的电脑软件
💻 TMP
字号:

Public Class MainForm
    Public fontcount As Integer = 0
    Private Sub MainForm_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
        Login.Close()
    End Sub

    Private Sub MainForm_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Timer1.Enabled = True
        ToolStripStatusLabel3.Text = ToolStripStatusLabel3.Text + Login.UserID.Text
        ToolStripStatusLabel4.Text = ToolStripStatusLabel4.Text + "已停止"
    End Sub

    Private Sub Timer1_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
        todate.Text = "当前日期" & CStr(Now)
        If Me.Opacity < 100% Then
            Me.Opacity = Me.Opacity + 4 / 100
        End If



    End Sub



    Private Sub Observe_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Observe.Click
        If Observe.Text = "开始监护" Then
            Observe.Text = "停止监护"
            Observe.BackColor = Color.Yellow
            ToolStripStatusLabel4.Text = Replace(ToolStripStatusLabel4.Text, "已停止", "") + "正在监护"
            Timer2.Start()
            Dayin.Enabled = False

        Else
            Observe.Text = "开始监护"
            Observe.BackColor = Color.Lime
            ToolStripStatusLabel4.Text = Replace(ToolStripStatusLabel4.Text, "正在监护", "") + "已停止"
            Timer2.Stop()
            Dayin.Enabled = True
        End If
    End Sub

    Private Sub SysQuit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SysQuit.Click
        Timer2.Stop()
        If Observe.Text = "停止监护" Then
            MsgBox("系统正在监护,请先停止监护后再退出系统!", MsgBoxStyle.Critical, "警告")
            Timer2.Start()
        Else
            Dim i = MsgBox("确实要退出系统吗?", MsgBoxStyle.Question Or MsgBoxStyle.OkCancel, "退出系统")
            If i = vbOK Then
                Close()
            End If
        End If

    End Sub




    Private Sub MainForm_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim g As Graphics
        g = PictureBox1.CreateGraphics
        g.DrawRectangle(Pens.Black, 100, 0, 100, 100)
    End Sub



    Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
        Dim i
        Dim mypen As New Pen(Color.Black, 1)
        mypen.DashStyle = Drawing2D.DashStyle.Dash
        Dim ycount As Integer = 210
        Dim myfont As New Font("宋体", 8, FontStyle.Italic)
        e.Graphics.FillRectangle(Brushes.LightGray, 0, 50, PictureBox1.Width, 40)
        e.Graphics.FillRectangle(Brushes.LightGray, 0, 240, PictureBox1.Width, 40)
        '绘制栅格和文字
        For i = 0 To 150 Step 30
            e.Graphics.DrawLine(New Pen(Color.Blue, 1), 0, i, PictureBox1.Width, i)
            e.Graphics.DrawString(CStr(ycount), myfont, Brushes.Red, 210, i)
            ycount -= 30
        Next
        For i = 0 To 150 Step 10
            e.Graphics.DrawLine(mypen, 0, i, PictureBox1.Width, i)
        Next
        ycount = 210
        For i = 190 To 340 Step 30
            e.Graphics.DrawLine(New Pen(Color.Blue, 1), 0, i, PictureBox1.Width, i)
            e.Graphics.DrawString(CStr(ycount), myfont, Brushes.Red, 208, i)
            ycount -= 30
        Next
        For i = 190 To 340 Step 10
            e.Graphics.DrawLine(mypen, 0, i, PictureBox1.Width, i)
        Next
        ycount = 100
        '心率
        For i = 380 To 480 Step 20
            e.Graphics.DrawLine(New Pen(Color.Blue, 1), 0, i, PictureBox1.Width, i)
            e.Graphics.DrawString(CStr(ycount), myfont, Brushes.Red, 210, i)
            e.Graphics.DrawString(CStr(ycount), myfont, Brushes.Red, 630, i)

            ycount -= 20
        Next
        For i = 380 To 480 Step 10
            e.Graphics.DrawLine(mypen, 0, i, PictureBox1.Width, i)
        Next
        For i = 0 To PictureBox1.Width Step 90
            e.Graphics.DrawLine(New Pen(Color.Black, 1.5), i, 0, i, 150)
            e.Graphics.DrawLine(New Pen(Color.Black, 1.5), i, 190, i, 340)
            e.Graphics.DrawLine(New Pen(Color.Black, 1.5), i, 380, i, 480)
        Next
        For i = 0 To PictureBox1.Width Step 30
            e.Graphics.DrawLine(mypen, i, 0, i, 150)
            e.Graphics.DrawLine(mypen, i, 190, i, 340)
            e.Graphics.DrawLine(mypen, i, 380, i, 480)
        Next

    End Sub

    Private Sub HScrollBar1_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles HScrollBar1.Scroll
        PictureBox1.Left = -HScrollBar1.Value + 100
    End Sub


    Private Sub Timer2_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer2.Tick
        ''走纸
        PictureBox1.Width = PictureBox1.Width + 1
        HScrollBar1.Maximum = PictureBox1.Width / 2
        '纸退后
        PictureBox1.Left -= 1
        HScrollBar1.Value = -PictureBox1.Left + 99
        Dim a As Graphics = Me.PictureBox1.CreateGraphics
        Dim i
        Dim ycount = 210
        Dim myfont As New Font("宋体", 8, FontStyle.Italic)

        For i = 0 To 150 Step 30
            a.DrawString(CStr(ycount), myfont, Brushes.Red, 210 + fontcount, i)
            ycount -= 30
        Next
        fontcount += 210

    End Sub

    Private Sub SysSet_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SysSet.Click
        Dim Myform As New SystemSet
        Myform.ShowDialog()
    End Sub

    Private Sub DangAn_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles DangAn.Click
        Dim MyD As New DangAn
        MyD.ShowDialog()
    End Sub

    Private Sub Print_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Print.Click
        Dim MyF As New PrintF
        MyF.ShowDialog()
    End Sub

    Private Sub Dayin_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Dayin.Click

    End Sub
End Class



⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -