📄 frm_ystat.frm
字号:
VERSION 5.00
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Object = "{65E121D4-0C60-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCHRT20.OCX"
Begin VB.Form Frm_YStat
BorderStyle = 1 'Fixed Single
Caption = "出入库现金年统计数据"
ClientHeight = 6300
ClientLeft = 45
ClientTop = 330
ClientWidth = 11880
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
ScaleHeight = 6300
ScaleWidth = 11880
StartUpPosition = 3 '窗口缺省
Begin VB.Frame Frame1
Height = 5805
Left = 70
TabIndex = 3
Top = 0
Width = 11760
Begin MSChart20Lib.MSChart MSChart1
Height = 5565
Left = 75
OleObjectBlob = "Frm_YStat.frx":0000
TabIndex = 4
Top = 195
Width = 11520
End
End
Begin VB.OptionButton Option1
Caption = "条型显示"
Height = 345
Left = 7920
TabIndex = 2
Top = 5895
Width = 1260
End
Begin VB.OptionButton Option2
Caption = "线型显示"
Height = 345
Left = 9330
TabIndex = 1
Top = 5895
Value = -1 'True
Width = 1260
End
Begin VB.CommandButton Command1
Caption = "取消"
Height = 345
Left = 10800
TabIndex = 0
Top = 5865
Width = 1050
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 345
Top = 6525
Visible = 0 'False
Width = 2025
_ExtentX = 3572
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 8
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = ""
OLEDBString = ""
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = ""
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
End
Attribute VB_Name = "Frm_YStat"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim i As Integer
Private Sub Command1_Click()
Unload Me
End Sub
Private Sub Command2_Click()
Unload Me
End Sub
Private Sub Form_Load()
rtn = SetWindowPos(Me.hwnd, -1, 0, 0, 0, 0, 3) '运用API函数SetWindowPos,来实现使窗体置前的功能
Me.Left = (Screen.Width - Me.Width) / 2
Me.Top = (Screen.Height - Me.Height) / 2
Adodc1.ConnectionString = CnnStr
Adodc1.RecordSource = "select * from tb_YMoney"
Adodc1.Refresh
Call LoadNumO '调用显示图表中的数据的过程
Call Option2_Click
End Sub
Private Sub Option1_Click()
MSChart1.chartType = VtChChartType2dBar '使图表中的数据条型显示
End Sub
Private Sub Option2_Click()
MSChart1.chartType = VtChChartType2dLine '使图表中的数据线形显示
End Sub
'*** 自定义在图表中显示数据的过程 ***
Private Sub LoadNumO()
Dim j As Integer
Dim Nums As Integer
On Error Resume Next
Adodc1.RecordSource = "select * from tb_YMoney order by id"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount > 0 Then
Adodc1.Recordset.MoveFirst
Nums = Adodc1.Recordset.RecordCount
ReDim arrValues(1 To Nums, 1 To 2) '定义动态数组
For j = 1 To Nums '给数组赋值
arrValues(j, 1) = " " & Adodc1.Recordset!Dates
arrValues(j, 2) = Adodc1.Recordset!Moneys
Adodc1.Recordset.MoveNext
Next j
MSChart1.ChartData = arrValues '图表显示数据
End If
End Sub
Private Sub Form_Unload(Cancel As Integer)
frm_main.Enabled = True
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -