📄 form1.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Begin VB.Form Form1
Caption = "Form1"
ClientHeight = 7680
ClientLeft = 60
ClientTop = 345
ClientWidth = 11220
LinkTopic = "Form1"
ScaleHeight = 7680
ScaleWidth = 11220
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command1
Caption = "Command1"
Height = 375
Left = 360
TabIndex = 1
Top = 7080
Width = 975
End
Begin MSFlexGridLib.MSFlexGrid MSFlexGrid1
Height = 4335
Left = 840
TabIndex = 0
Top = 1080
Width = 6855
_ExtentX = 12091
_ExtentY = 7646
_Version = 393216
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Dim Rst As ADODB.Recordset
Public Sub Init(tRst As ADODB.Recordset)
Dim I As Integer
If tRst.RecordCount > 0 Then
tRst.MoveLast
tRst.MoveFirst
With MSFlexGrid1
.Rows = tRst.RecordCount + 1
.Cols = 12
.FixedRows = 1
.FixedCols = 0
.TextMatrix(0, 0) = "手牌"
.TextMatrix(0, 1) = "性别"
.TextMatrix(0, 2) = "消费项目"
.TextMatrix(0, 3) = "项目类型"
.TextMatrix(0, 4) = "金额"
.TextMatrix(0, 5) = "技师"
.TextMatrix(0, 6) = "消费时间"
.TextMatrix(0, 7) = "现金"
.TextMatrix(0, 8) = "赠券"
.TextMatrix(0, 9) = "记帐"
.TextMatrix(0, 10) = "转总"
.TextMatrix(0, 11) = "免费"
Do Until tRst.EOF
.Row = tRst.AbsolutePosition
For I = 0 To 6
.TextMatrix(tRst.AbsolutePosition, I) = tRst(I).Value & ""
Next I
.Col = 7
.CellAlignment = flexAlignCenterCenter
.ColWidth(7) = 500
.Col = 8
.CellAlignment = flexAlignCenterCenter
.Col = 9
.CellAlignment = flexAlignCenterCenter
.Col = 10
.CellAlignment = flexAlignCenterCenter
.Col = 11
.CellAlignment = flexAlignCenterCenter
.TextMatrix(.Row, 7) = IIf(tRst!xj > 0, "√", "")
.TextMatrix(.Row, 8) = IIf(tRst!zj > 0, "√", "")
.TextMatrix(.Row, 9) = IIf(tRst!jzh > 0, "√", "")
.TextMatrix(.Row, 10) = IIf(tRst!zhzt > 0, "√", "")
.TextMatrix(.Row, 11) = IIf(tRst!mf > 0, "√", "")
tRst.MoveNext
Loop
End With
Else
End If
Set Rst = tRst
Me.Show vbModal
End Sub
Private Sub Command1_Click()
' Dim I As Long
'
' For I = 1 To Rst.RecordCount
' Rst.AbsolutePosition = I
'
' Rst!xj = IIf(MSFlexGrid1.TextMatrix(I, 6) <> "", Rst!recje, 0)
' Rst!zj = IIf(MSFlexGrid1.TextMatrix(I, 7) <> "", Rst!recje, 0)
' Rst!jzh = IIf(MSFlexGrid1.TextMatrix(I, 8) <> "", Rst!recje, 0)
' Rst!zhzt = IIf(MSFlexGrid1.TextMatrix(I, 9) <> "", Rst!recje, 0)
' Rst!mf = IIf(MSFlexGrid1.TextMatrix(I, 10) <> "", Rst!recje, 0)
' Rst.Update
' Next I
End Sub
Private Sub MSFlexGrid1_DblClick()
Dim I As Integer, tCol As Integer
If MSFlexGrid1.MouseRow = 0 Then Exit Sub
If MSFlexGrid1.Col = 8 Then
'DO
If MSFlexGrid1.TextMatrix(MSFlexGrid1.Row, 3) <> "基础类" Then Exit Sub
End If
If MSFlexGrid1.MouseCol >= 7 And MSFlexGrid1.MouseCol <= 11 Then
With MSFlexGrid1
tCol = .MouseCol
.Row = .MouseRow
For I = 7 To 11
If I <> tCol Then
.CellAlignment = flexAlignCenterCenter
.Col = I
.Text = ""
End If
Next I
.Col = .MouseCol
.CellAlignment = flexAlignCenterCenter
.Text = "√"
Rst.AbsolutePosition = .Row
Rst!xj = IIf(MSFlexGrid1.TextMatrix(.Row, 7) <> "", Rst!recje, 0)
Rst!zj = IIf(MSFlexGrid1.TextMatrix(.Row, 8) <> "", Rst!recje, 0)
Rst!jzh = IIf(MSFlexGrid1.TextMatrix(.Row, 9) <> "", Rst!recje, 0)
Rst!zhzt = IIf(MSFlexGrid1.TextMatrix(.Row, 10) <> "", Rst!recje, 0)
Rst!mf = IIf(MSFlexGrid1.TextMatrix(.Row, 11) <> "", Rst!recje, 0)
Rst.Update
End With
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -