?? 收銀員查詢結(jié)果.frm
字號(hào):
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form 收銀員查詢結(jié)果
Caption = "收銀員查詢結(jié)果"
ClientHeight = 9870
ClientLeft = 60
ClientTop = 345
ClientWidth = 11940
LinkTopic = "Form1"
ScaleHeight = 9870
ScaleWidth = 11940
StartUpPosition = 3 '窗口缺省
Begin MSFlexGridLib.MSFlexGrid msglist
Height = 8235
Left = 90
TabIndex = 1
Top = 1680
Width = 11895
_ExtentX = 20981
_ExtentY = 14526
_Version = 393216
End
Begin VB.Label lbltitle
BackStyle = 0 'Transparent
Caption = "收銀員查詢結(jié)果"
BeginProperty Font
Name = "華文中宋"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 645
Left = 3240
TabIndex = 0
Top = 1050
Width = 2985
End
End
Attribute VB_Name = "收銀員查詢結(jié)果"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Public txtSQL As String
Public mrc As ADODB.Recordset
Dim MsgText As String
Private Sub Form_Load()
ShowTitle
ShowData
End Sub
Private Sub Form_Resize()
If Me.WindowState <> vbMinimized And main.WindowState <> vbMinimized Then
'邊界處理
If Me.ScaleHeight < 10 * lbltitle.Height Then
Exit Sub
End If
If Me.ScaleWidth < lbltitle.Width + lbltitle.Width / 2 Then
Exit Sub
End If
'控制控件的位置
lbltitle.Top = lbltitle.Height
lbltitle.Left = (Me.Width - lbltitle.Width) / 2
msglist.Top = lbltitle.Top + lbltitle.Height + lbltitle.Height / 2
msglist.Width = Me.ScaleWidth - 200
msglist.Left = Me.ScaleLeft + 100
msglist.Height = Me.ScaleHeight - msglist.Top - 200
End If
End Sub
Public Sub FormClose()
Unload Me
End Sub
Private Sub ShowData()
Dim j As Integer
Dim i As Integer
Set mrc = ExecuteSQL(txtSQL, MsgText)
With msglist
.Rows = 1
Do While Not mrc.EOF
.Rows = .Rows + 1
For i = 1 To mrc.Fields.Count
Select Case mrc.Fields(i - 1).Type
Case adDBDate
.TextMatrix(.Rows - 1, i) = Format(mrc.Fields(i - 1) & "", "yyyy-mm-dd")
Case Else
.TextMatrix(.Rows - 1, i) = mrc.Fields(i - 1) & ""
End Select
Next i
mrc.MoveNext
Loop
End With
mrc.Close
End Sub
'顯示Grid表頭
Private Sub ShowTitle()
Dim i As Integer
With msglist
.Cols = 35
.TextMatrix(0, 1) = "收銀員名字"
.TextMatrix(0, 2) = "收銀員編號(hào)"
.TextMatrix(0, 3) = "收銀員聯(lián)系方式"
.TextMatrix(0, 4) = "收銀員聯(lián)系地址"
.TextMatrix(0, 5) = ""
.TextMatrix(0, 6) = ""
.TextMatrix(0, 7) = ""
.TextMatrix(0, 8) = ""
.TextMatrix(0, 9) = ""
.TextMatrix(0, 10) = ""
.TextMatrix(0, 11) = ""
.TextMatrix(0, 12) = ""
.TextMatrix(0, 13) = ""
.TextMatrix(0, 14) = ""
.TextMatrix(0, 15) = ""
.TextMatrix(0, 16) = ""
.TextMatrix(0, 17) = ""
.TextMatrix(0, 18) = ""
.TextMatrix(0, 19) = ""
.TextMatrix(0, 20) = ""
.TextMatrix(0, 21) = ""
.TextMatrix(0, 22) = ""
.TextMatrix(0, 23) = ""
.TextMatrix(0, 24) = ""
.TextMatrix(0, 25) = ""
.TextMatrix(0, 26) = ""
.TextMatrix(0, 27) = ""
.TextMatrix(0, 28) = ""
.TextMatrix(0, 29) = ""
.TextMatrix(0, 30) = ""
.TextMatrix(0, 31) = ""
.TextMatrix(0, 32) = ""
.TextMatrix(0, 33) = ""
.TextMatrix(0, 34) = ""
'固定表頭
.FixedRows = 1
'設(shè)置各列的對(duì)齊方式
For i = 0 To 11
.ColAlignment(i) = 0
Next i
'表頭項(xiàng)居中
.FillStyle = flexFillRepeat
.Col = 0
.Row = 0
.RowSel = 1
.ColSel = .Cols - 1
.CellAlignment = 4
'設(shè)置單元大小
.ColWidth(0) = 1000
.ColWidth(1) = 1000
.ColWidth(2) = 2000
.ColWidth(3) = 2000
.ColWidth(4) = 2000
.ColWidth(5) = 0
.ColWidth(6) = 0
.ColWidth(7) = 0
.ColWidth(8) = 0
.ColWidth(9) = 0
.ColWidth(10) = 0
.ColWidth(11) = 0
.ColWidth(12) = 0
.ColWidth(13) = 0
.ColWidth(14) = 0
.ColWidth(15) = 0
.ColWidth(16) = 0
.ColWidth(17) = 0
.ColWidth(18) = 0
.ColWidth(19) = 0
.ColWidth(20) = 0
.ColWidth(21) = 0
.ColWidth(22) = 0
.ColWidth(23) = 0
.ColWidth(24) = 0
.ColWidth(25) = 0
.ColWidth(26) = 0
.ColWidth(27) = 0
.ColWidth(28) = 0
.ColWidth(29) = 0
.ColWidth(30) = 0
.ColWidth(31) = 0
.ColWidth(32) = 0
.ColWidth(33) = 0
.ColWidth(34) = 0
.Row = 1
End With
End Sub
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -