📄 frmtimecurve.frm
字号:
VERSION 5.00
Begin VB.Form TimeDisply
Caption = "Form2"
ClientHeight = 8175
ClientLeft = 60
ClientTop = 450
ClientWidth = 11430
LinkTopic = "Form2"
ScaleHeight = 8175
ScaleWidth = 11430
StartUpPosition = 3 '窗口缺省
Begin VB.Data Data1
Caption = "Data1"
Connect = "Access"
DatabaseName = ""
DefaultCursorType= 0 '缺省游标
DefaultType = 2 '使用 ODBC
Exclusive = 0 'False
Height = 345
Left = 540
Options = 0
ReadOnly = 0 'False
RecordsetType = 1 'Dynaset
RecordSource = ""
Top = 6570
Width = 1635
End
Begin VB.CommandButton Command2
Caption = "Command2"
Height = 285
Left = 2040
TabIndex = 2
Top = 60
Width = 2085
End
Begin VB.Timer Timer1
Left = 0
Top = 450
End
Begin VB.PictureBox picOut
Height = 5745
Left = 570
ScaleHeight = 5685
ScaleWidth = 7545
TabIndex = 1
Top = 390
Width = 7605
End
Begin VB.CommandButton cmdDemo
Caption = "PIC"
Height = 345
Left = 1200
TabIndex = 0
Top = 0
Width = 525
End
End
Attribute VB_Name = "TimeDisply"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
'下面的是modGDI模块
'===========================================================
'GDI实时曲线绘制演示
' =========================================
' 新建一个工程 , 在窗体中添加按钮cmdDemo, 图片框picOut, 时钟控件Timer
' 下面的是frmMain窗体
Dim CurveDrawer As clsCurve
Dim tempDatabase, tempData As Single
Private Sub cmdDemo_Click()
Dim nY As Long
CurveDrawer.SetView picOut.hdc, picOut.Width - 10, picOut.Height - 10, 50, 50
Timer1.Enabled = True
End Sub
Private Sub Form_Load()
ScaleMode = 3
Timer1.Interval = 200000
Timer1.Enabled = False
Set CurveDrawer = New clsCurve
tempDatabase = App.Path + "\Data\InnerData\数据管理器97.mdb"
Data1.DatabaseName = tempDatabase
End Sub
Private Sub picOut_Paint()
CurveDrawer.RedrawCurve
End Sub
Private Sub Timer1_Timer()
'度数据
Data1.RecordSource = "实时工程参数" '读取当前数据点????
Data1.Refresh
Do While Not Data1.Recordset.EOF
If Not IsNull(Data1.Recordset("立压")) Then tempData = Data1.Recordset("立压")
If Data1.Recordset.EOF Then
Data1.Recordset.MoveFirst
Exit Do 'GoTo Eee
Else
Data1.Recordset.MoveNext
End If
Loop
' CurveDrawer.DrawCurve CLng(tempData)
CurveDrawer.DrawCurve CLng(Rnd * 50)
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -