?? form6.frm
字號:
VERSION 5.00
Object = "{CFA7AFF4-3242-4269-9172-7389D695AE01}#1.0#0"; "StoneXP.ocx"
Object = "{DAAC6951-59A4-4C08-9D6E-FE3919B64861}#1.0#0"; "FlexCell.ocx"
Begin VB.Form Form6
BorderStyle = 3 'Fixed Dialog
Caption = "油價信息查詢"
ClientHeight = 4425
ClientLeft = 45
ClientTop = 375
ClientWidth = 6885
LinkTopic = "Form6"
MaxButton = 0 'False
MDIChild = -1 'True
MinButton = 0 'False
ScaleHeight = 4425
ScaleWidth = 6885
ShowInTaskbar = 0 'False
Begin FlexCell.Grid Grid1
Height = 3375
Left = 0
TabIndex = 0
Top = 240
Width = 6855
_ExtentX = 12091
_ExtentY = 5953
Cols = 5
Rows = 30
End
Begin StoneXP.XPButton XPButton3
Height = 375
Left = 2640
TabIndex = 1
Top = 3840
Width = 1455
_ExtentX = 2566
_ExtentY = 661
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋體"
Size = 10.5
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Caption = "退出查詢"
MouseIcon = "Form6.frx":0000
MousePointer = 99
End
End
Attribute VB_Name = "Form6"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim str As String
Private Sub Form_Load()
On Error GoTo finish
mdi = False
str = "select * from 油價表"
Grid1.SetRegisterInformation "CNwinndy", "W]vyY-nonvk-u\nty-Zbl_e-`hms^" '進行注冊
Grid1.Cols = 5
Grid1.Column(1).Width = 80
Grid1.Column(2).Width = 120
Grid1.Column(3).Width = 80
Grid1.Column(4).Width = 80
With Grid1
.AllowUserResizing = True
.DisplayFocusRect = False
.ExtendLastCol = True
.Appearance = Flat
.FixedRowColStyle = Flat
.ScrollBarStyle = Flat
.DefaultFont.Name = "Tahoma"
.DefaultFont.Size = 8
.BackColorFixed = RGB(84, 201, 134)
.BackColorFixedSel = RGB(167, 111, 177)
.BackColorBkg = RGB(198, 229, 211)
.BackColorScrollBar = RGB(167, 111, 177)
.BackColor1 = RGB(231, 235, 247)
.BackColor2 = RGB(198, 229, 211)
.GridColor = RGB(148, 190, 231)
.Column(0).Width = 0
End With
Set mdbrs = mdbconn.Execute(str)
Call callmain
Exit Sub
finish:
MsgBox Err.Description
End Sub
Private Sub Form_Unload(Cancel As Integer)
mdi = True
End Sub
Private Sub XPButton3_Click()
Unload Me
End Sub
Private Sub callmain()
On Error GoTo finish
Grid1.Rows = 1
i = 4
Grid1.Cols = i + 1
For i = 0 To 3
If i = 3 Then
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name & "(元/升)"
Else
Grid1.Cell(0, i + 1).Text = mdbrs.Fields(i).Name
End If
Next
i = 1
Do While Not mdbrs.EOF
Grid1.Rows = Grid1.Rows + 1
For j = 1 To 4 '設定讀取列
If mdbrs.Fields(j - 1) = Null Then '空值的處理
Grid1.Cell(i, j).Text = ""
Else
Grid1.Cell(i, j).Text = mdbrs.Fields(j - 1)
End If
Next
i = i + 1
mdbrs.MoveNext '讀取下一記錄
Loop
For i = 1 To 4
Grid1.Column(i).Locked = True
Next
Exit Sub
finish:
MsgBox Err.Description
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -