📄 frmreceiptlist.frm
字号:
VERSION 5.00
Object = "{5E9E78A0-531B-11CF-91F6-C2863C385E30}#1.0#0"; "MSFLXGRD.OCX"
Object = "{F6125AB1-8AB1-11CE-A77F-08002B2F4E98}#2.0#0"; "MSRDC20.OCX"
Begin VB.Form frmReceiptList
BackColor = &H8000000A&
BorderStyle = 0 'None
ClientHeight = 3780
ClientLeft = 0
ClientTop = 0
ClientWidth = 5145
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3780
ScaleWidth = 5145
ShowInTaskbar = 0 'False
StartUpPosition = 3 '窗口缺省
Begin MSRDC.MSRDC datGrid
Height = 345
Left = 990
Top = 1500
Visible = 0 'False
Width = 1200
_ExtentX = 2117
_ExtentY = 609
_Version = 393216
Options = 0
CursorDriver = 0
BOFAction = 0
EOFAction = 0
RecordsetType = 1
LockType = 3
QueryType = 0
Prompt = 3
Appearance = 1
QueryTimeout = 30
RowsetSize = 100
LoginTimeout = 15
KeysetSize = 0
MaxRows = 0
ErrorThreshold = -1
BatchSize = 15
BackColor = -2147483643
ForeColor = -2147483640
Enabled = -1 'True
ReadOnly = 0 'False
Appearance = -1 'True
DataSourceName = ""
RecordSource = ""
UserName = ""
Password = ""
Connect = ""
LogMessages = ""
Caption = "MSRDC1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
End
Begin MSFlexGridLib.MSFlexGrid grdRefer
Bindings = "frmReceiptList.frx":0000
Height = 1785
Left = 30
TabIndex = 0
TabStop = 0 'False
Top = 360
Width = 3555
_ExtentX = 6271
_ExtentY = 3149
_Version = 393216
Rows = 4
Cols = 4
FixedCols = 0
BackColor = 16777215
BackColorBkg = 16777215
GridColorFixed = 16777215
FocusRect = 0
GridLines = 0
ScrollBars = 2
SelectionMode = 1
BorderStyle = 0
Appearance = 0
End
Begin MSFlexGridLib.MSFlexGrid grdTotal
Height = 225
Left = 60
TabIndex = 1
TabStop = 0 'False
Top = 2160
Width = 3525
_ExtentX = 6218
_ExtentY = 397
_Version = 393216
Rows = 1
Cols = 4
FixedRows = 0
FixedCols = 0
BackColor = 16777215
BackColorBkg = 16777215
GridColorFixed = 16777215
FocusRect = 0
HighLight = 0
GridLines = 2
GridLinesFixed = 1
ScrollBars = 2
SelectionMode = 1
BorderStyle = 0
Appearance = 0
End
End
Attribute VB_Name = "frmReceiptList"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private m_blnFirst As Boolean
Private WithEvents m_clsHook As SubClass32.SubClass
Attribute m_clsHook.VB_VarHelpID = -1
Private mblnbusy As Boolean
Private Sub cmbCode_Click()
mobjRpList.RaiseCtlEvent 1
End Sub
Private Sub Form_Activate()
SetCapture grdRefer.hwnd
If grdRefer.Row = 0 Then
grdRefer.Row = grdRefer.Rows - 1
End If
End Sub
Private Sub Form_Load()
If UserControls.mblnShowCombox Then
' cmbCode.Clear
' With UserControls.mrstForCombox
' If .rowcount <> 0 Then
' .MoveFirst
' End If
' Do While Not .EOF
' cmbCode.AddItem .rdocolumns(0).Value
' .MoveNext
' Loop
' End With
End If
grdRefer.Cols = 2
grdRefer.FixedCols = 1
m_blnFirst = True
' Set datGrid.Resultset = UserControls.mrstForGrid
' intCol = 0
' For Each fldTemp In UserControls.mrstForGrid.rdoColumns
' strName = fldTemp.Name
' If InStr(1, strName, "数量") <> 0 Or InStr(1, strName, "金额") <> 0 Then
' grdRefer.ColAlignment(intCol + 1) = 7
' End If
' intCol = intCol + 1
' Next
' For intCol = 0 To grdRefer.Cols - 1
' grdRefer.Row = 0
' grdRefer.col = intCol
' grdRefer.CellAlignment = 4
' Next
' grdRefer.FixedCols = 0
' grdRefer.TextMatrix(0, 0) = "选择"
' ChangeWidth
' SubWin1.SetWin grdRefer.hwnd
End Sub
Private Sub ChangeWidth()
Dim intCol As Integer
With grdRefer
.ColWidth(0) = 600
.ColAlignment(0) = 4
For intCol = 1 To datGrid.Resultset.rdoColumns.Count
If intCol = UserControls.mintCodeIdCol Or intCol = UserControls.mintSubIdCol Then
.ColWidth(intCol) = 0
Else
Select Case Trim(.TextMatrix(0, intCol))
Case "科目"
.ColWidth(intCol) = 3000
Case Else
' If Me.TextWidth("A") * (StrLen(.TextMatrix(0, intCol)) + 1) > Me.TextWidth("A") * (datGrid.Resultset.rdoColumns(intCol - 1).Size + 1) Then
If InStr(.TextMatrix(0, intCol), "日期") <> 0 Then
.ColWidth(intCol) = Me.TextWidth("A") * 11
ElseIf InStr(.TextMatrix(0, intCol), "商品") <> 0 Then
.ColWidth(intCol) = Me.TextWidth("A") * 18
ElseIf InStr(.TextMatrix(0, intCol), "金额") <> 0 Then
.ColWidth(intCol) = Me.TextWidth("A") * 16
Else
.ColWidth(intCol) = Me.TextWidth("A") * (StrLen(.TextMatrix(0, intCol)) + 3)
End If
' Else
' .ColWidth(intCol) = Me.TextWidth("A") * (datGrid.Resultset.rdoColumns(intCol - 1).Size + 5) / 2
' End If
End Select
End If
Next intCol
End With
End Sub
Private Sub Form_Paint()
'黑
Me.ForeColor = &H80000007
Me.Line (5, 5)-(Me.ScaleWidth - 10, 5)
Me.Line (5, 5)-(5, Me.ScaleHeight - 10)
Me.Line (Me.ScaleWidth - 10, 5)-(Me.ScaleWidth - 10, Me.ScaleHeight)
Me.Line (5, Me.ScaleHeight - 10)-(Me.ScaleWidth - 10, Me.ScaleHeight - 10)
End Sub
Public Sub Form_Resize()
Dim fldTemp As rdoColumn
Dim strName As String
Dim intCol As Integer, intCount As Integer
Dim lngGridWid As Long
Dim lngLeft As Long
Dim lngScrollWid As Long
Static Resized As Boolean
If m_blnFirst Then
m_blnFirst = False
Set datGrid.Resultset = UserControls.mrstForGrid
grdRefer.TextMatrix(0, 0) = "选择"
' For intCol = 0 To grdRefer.Cols - 1
' grdRefer.TextMatrix(0, intCol) = Trim(grdRefer.TextMatrix(0, intCol))
' Next
intCol = 0
For Each fldTemp In UserControls.mrstForGrid.rdoColumns
strName = fldTemp.Name
If InStr(1, strName, "数量") <> 0 Or InStr(1, strName, "金额") <> 0 Then
grdRefer.ColAlignment(intCol + 1) = 7
End If
intCol = intCol + 1
Next
For intCol = 0 To grdRefer.Cols - 1
grdRefer.Row = 0
grdRefer.col = intCol
grdRefer.CellAlignment = 4
Next
grdRefer.FixedCols = 0
ChangeWidth
' SubWin1.SetWin grdRefer.hwnd
mblnbusy = False
Set m_clsHook = New SubClass32.SubClass
m_clsHook.hwnd = grdRefer.hwnd
m_clsHook.Messages(WM_PAINT) = True
mblnbusy = False
intCol = 0
End If
If Resized Then
Exit Sub
End If
Resized = True
With grdRefer
For intCol = 0 To .Cols - 1
lngGridWid = lngGridWid + .ColWidth(intCol)
Next intCol
End With
grdRefer.Height = grdRefer.RowHeight(0) * 12
If grdRefer.Rows > 12 Then
lngScrollWid = gclsEniv.VScrollWidth
End If
Me.width = lngGridWid + 65 + lngScrollWid
grdRefer.width = lngGridWid + lngScrollWid
If mblnShowCombox Then
' lblCode.top = 60
' cmbCode.top = 30
' grdRefer.top = cmbCode.top + 330
Else
' lblCode.top = -1000
' cmbCode.top = -1000
grdRefer.top = 30
End If
Me.Height = grdRefer.Height + grdRefer.top + grdTotal.Height + 30
grdTotal.top = Me.Height - grdTotal.Height - 10
grdTotal.Left = grdRefer.Left
grdTotal.width = grdRefer.width
intCol = 0
For intCount = 0 To grdRefer.Cols - 1
If grdRefer.ColWidth(intCount) <> 0 Then
grdTotal.Cols = intCol + 1
If intCount = grdRefer.Cols - 1 Then
grdTotal.ColWidth(intCol) = grdRefer.ColWidth(intCount) + lngScrollWid - 30
Else
grdTotal.ColWidth(intCol) = grdRefer.ColWidth(intCount)
End If
intCol = intCol + 1
End If
Next intCount
CalTotal
On Error Resume Next
If grdRefer.Rows = 1 Then
grdRefer.Rows = 2
grdRefer.RowHeight(1) = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -