?? form1.frm
字號:
BackColor = -2147483643
ImageWidth = 16
ImageHeight = 16
MaskColor = 12632256
_Version = 393216
BeginProperty Images {2C247F25-8591-11D1-B16A-00C0F0283628}
NumListImages = 7
BeginProperty ListImage1 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":5BE6
Key = "Drawing"
EndProperty
BeginProperty ListImage2 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":5CF8
Key = "View Details"
EndProperty
BeginProperty ListImage3 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":5E0A
Key = "Print"
EndProperty
BeginProperty ListImage4 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":5F1C
Key = "Help"
EndProperty
BeginProperty ListImage5 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":602E
Key = "Delete"
EndProperty
BeginProperty ListImage6 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":6140
Key = ""
EndProperty
BeginProperty ListImage7 {2C247F27-8591-11D1-B16A-00C0F0283628}
Picture = "Form1.frx":6471
Key = ""
EndProperty
EndProperty
End
Begin MSChart20Lib.MSChart MSChart1
Height = 9450
Left = 3225
OleObjectBlob = "Form1.frx":67C3
TabIndex = 6
Top = 2055
Width = 12540
End
Begin VB.Label Label4
BackStyle = 0 'Transparent
Caption = "Label4"
Height = 165
Left = 0
TabIndex = 9
Top = 0
Visible = 0 'False
Width = 1755
End
Begin VB.Label Label2
BorderStyle = 1 'Fixed Single
Caption = " "
Height = 255
Left = 2550
TabIndex = 4
Top = 555
Width = 3135
End
Begin VB.Label Label1
BorderStyle = 1 'Fixed Single
Caption = " 請選擇傳感器:"
Height = 255
Left = 0
TabIndex = 3
Top = 555
Width = 2535
End
Begin VB.Line Line1
X1 = 0
X2 = 15240
Y1 = 480
Y2 = 480
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim conn As New Connection
Dim rs As New Recordset
Dim sKey, trvkey As String
Dim tipmschart1 As New clsToolTip
Private Declare Function timeGetTime Lib "winmm.dll" () As Long
Private Sub biaoge()
Dim time1, time2 As Long
Dim m As Integer
setxianshi ("grid")
time1 = timeGetTime
sqlstr = "select * from xia_dayreport where ttid = '" & sKey & "' and left(tttime,10) = '2007-08-07' order by tttime"
rs.Open sqlstr, conn, adOpenStatic
m = rs.RecordCount
Set VSFG1.DataSource = rs
VSFG1.Rows = m
setxianshi ("grid")
VSFG1.ColWidth(0) = "300"
For i = 1 To 8
VSFG1.ColAlignment(i) = flexAlignCenterCenter
Next i
VSFG1.TextMatrix(0, 1) = "序號"
VSFG1.TextMatrix(0, 2) = "檔案名稱"
VSFG1.TextMatrix(0, 3) = "科目"
VSFG1.TextMatrix(0, 4) = "項目"
VSFG1.TextMatrix(0, 5) = "分類"
VSFG1.TextMatrix(0, 6) = "部門"
VSFG1.TextMatrix(0, 7) = "客戶"
VSFG1.TextMatrix(0, 8) = "員工"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''MSFLEXGRID使用示例'''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
' Option Explicit
' Private Sub Combo1_Click()
' MSFlexGrid1.text = Combo1.text
' End Sub
' Private Sub Combo1_KeyPress(KeyAscii As Integer)
' If KeyAscii = vbKeyEscape Then
' Combo1.Visible = False
' MSFlexGrid1.SetFocus
' Exit Sub
' End If
' If KeyAscii = vbKeyReturn Then
' MSFlexGrid1.text = Combo1.text
' Combo1.Visible = False
' MSFlexGrid1.SetFocus
' End If
' End Sub
' Private Sub Combo1_LostFocus()
' Combo1.Visible = False
' MSFlexGrid1.SetFocus
' Exit Sub
' End Sub
' Private Sub Form_Load()
' Dim i As Integer
' Dim width, text, Archives
' width = Array("400", "2100", "800", "800", "800", "800", "800", "800", "800","800", "800")
' text = Array("序號", "檔案名稱", "第1級", "第2級", "第3級", "第4級", "第5級", "第6級", "第7級", "第8級", "第9級")
' Archives = Array("null", "科目", "項目分類", "固定資產分類", "部門分類", "員工分類", "供應商分類", "客戶分類", "銷售商分類", "地區分類", "出入庫類別", "存貨分類", "預留12", "預留13", "預留14", "預留15", "預留16", "預留17", "預留18", "預留19","預留20")
' With MSFlexGrid1
' .Rows = 21
' .Cols = 11
' .FixedCols = 2
' .FixedRows = 1
' End With
' For i = 1 To 9
' Combo1.AddItem i
' Next i
' For i = 0 To 10
' MSFlexGrid1.ColWidth(i) = width(i)
' MSFlexGrid1.TextMatrix(0, i) = text(i)
' Next i
' For i = 1 To 20
' With MSFlexGrid1
' .TextMatrix(i, 0) = i
' .TextMatrix(i, 1) = Archives(i)
' .RowHeight(i) = 300
' End With
' Next i
' End Sub
' Private Sub MSFlexGrid1_Click()
' Dim c As Integer, r As Integer
' With MSFlexGrid1
' c = .col
' r = .row
' If c > 1 And r > 0 Then
' Combo1.Left = .Left + .ColPos(c) + 50
' Combo1.Top = .Top + .RowPos(r) + 50
' Combo1.width = .ColWidth(c)
' Combo1.text = .text
' Combo1.Visible = True
' Combo1.SetFocus
' End If
' End With
' End Sub
' Private Sub MSFlexGrid1_KeyPress(KeyAscii As Integer)
' If KeyAscii = vbKeyReturn Then
' Call MSFlexGrid1_Click
' End If
' End Sub
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
rs.Close
time2 = timeGetTime
Label2.Caption = time2 - time1 & "毫秒 共有" & m & "條記錄"
Toolbar1.Buttons.Item(5).Enabled = True
End Sub
Private Sub prt()
Dim time1, time2 As Long
time1 = timeGetTime
VSFG1.ColWidth(0) = "0"
setxianshi ("prt")
VSPrinter1.MarginTop = mtop
VSPrinter1.MarginBottom = mbottom
VSPrinter1.MarginLeft = mleft
VSPrinter1.MarginRight = mright
VSPrinter1.StartDoc
VSPrinter1.FontSize = 24
VSPrinter1.FontBold = True
VSPrinter1.TextAlign = taCenterMiddle
VSPrinter1.Paragraph = "XX這是標題這是標題"
VSPrinter1.Paragraph = ""
VSPrinter1.Zoom = 100 '顯示比例為100%
VSPrinter1.RenderControl = Form1.VSFG1.hWnd
VSPrinter1.EndDoc
time2 = timeGetTime
Label2.Caption = time2 - time1
End Sub
Private Sub cmmset_Click()
Form2.Show
End Sub
Private Sub Form_Load()
Dim node As node
Dim c, c1, c2 As String
Dim sqlstr, key, keyname, key1, keyname1, key2, keyname2 As String
tipmschart1.DelayTime = 2
tipmschart1.VisibleTime = 2000
Form1.KeyPreview = True
VSPrinter1.Visible = False
MSChart1.Visible = False
MSChart1.AllowSeriesSelection = False
VSFG1.Visible = False
VSFG1.Top = 840
VSFG1.Left = 2640
MSChart1.Top = 840
MSChart1.Left = 2640
VSPrinter1.Top = 840
VSPrinter1.Left = 2640
mtop = 900
mbottom = 900
mleft = 900
mright = 900
conn.CursorLocation = adUseClient
With conn
.CommandTimeout = 600
.ConnectionTimeout = 600
End With
'conn.Open "PROVIDER=Microsoft.Jet.OlEDB.4.0;Data Source=" & App.Path & "\COAL.mdb;"
conn.Open "Provider=SQLOLEDB.1;Data Source=LENOVO-D16E7F58;User ID=sa; Password='operator'; Initial Catalog =COAL"
TRV.Nodes.Clear
Set node = TRV.Nodes.Add(, , "boot", "監控探頭列表", 1)
sqlstr = "select * from xia_coal"
rs.Open sqlstr, conn, adOpenStatic
m = rs.RecordCount
rs.Close
For i = 1 To m
c = i
sqlstr = "select top " & c & " * from xia_coal"
rs.Open sqlstr, conn, adOpenStatic
rs.MoveLast
key = "K_" & rs.Fields("mkid").Value
keyname = rs.Fields("mkname").Value
Call AddRootNode("boot", key, keyname)
rs.Close
'----------------------------------------------------------------------
'----------------------------------------------------------------------
' sqlstr = "select * from xia_config where mkid = '" & Right(key, Len(key) - 2) & "'"
' rs.Open sqlstr, conn, adOpenStatic
' m1 = rs.RecordCount
' rs.Close
' For j = 1 To m1
' c1 = j
' sqlstr = "select top " & c1 & " * from xia_config where mkid = '" & Right(key, Len(key) - 2) & "'"
' rs.Open sqlstr, conn, adOpenStatic
' rs.MoveLast
' key1 = "K_" & rs.Fields("ttid").Value
' keyname1 = rs.Fields("ttname").Value
' Call AddChildNode(key, key1, keyname1)
' rs.Close
'--------------------------------------------
'--------------------------------------------
' sqlstr = "select * from xia_dayreport where left(ttid,11) = '" & Right(key, Len(key1) - 2) & "' order by right(ttid,2)"
' rs.Open sqlstr, conn, adOpenStatic
' m2 = rs.RecordCount
' rs.Close
' For k = 1 To m2
' c2 = k
' ' sqlstr = "select top " & c2 & " * from xia_dayreport where left(ttid,11) = '" & Right(key, Len(key1) - 2) & "' order by right(ttid,2)"
' rs.Open sqlstr, conn, adOpenStatic
' rs.MoveLast
' key2 = "K_" & rs.Fields("ttid").Value
' keyname2 = rs.Fields("ttid").Value
' Call AddChildNode(key1, key2, keyname2)
' rs.Close
' Next k
'--------------------------------------------
'--------------------------------------------
' Next j
'----------------------------------------------------------------------
'----------------------------------------------------------------------
Next i
node.Expanded = True
Toolbar1.Buttons.Item(5).Enabled = False
Toolbar1.Buttons.Item(6).Enabled = False
Toolbar1.Buttons.Item(7).Enabled = False
End Sub
Sub AddRootNode(ByRef Root_Key, ByRef str_Key, ByRef str_Name)
Dim ndNewNode As node
Set ndNewNode = TRV.Nodes.Add(Root_Key, tvwChild, str_Key, str_Name, 2)
ndNewNode.Expanded = True
End Sub
Sub AddChildNode(ByRef Child, ByRef Child_key, ByRef str_Name)
Dim ndNewNode As node
Set ndNewNode = TRV.Nodes.Add(Child, tvwChild, Child_key, str_Name, 3)
ndNewNode.Expanded = True
End Sub
Private Sub Form_Resize()
TRV.Height = Form1.Height - 1700
VSFG1.Height = Form1.Height - 1700
VSFG1.Width = Form1.Width - 2775
MSChart1.Height = Form1.Height - 1700
MSChart1.Width = Form1.Width - 2775
VSPrinter1.Height = Form1.Height - 1700
VSPrinter1.Width = Form1.Width - 2775
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub MSChart1_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
' Dim whichPart As Integer, whichSeries As Integer
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -