📄 frmtreefind.frm
字号:
Set mclsMainControl = gclsSys.MainControls.Add(Me)
' SetHelpID 10001
Utility.LoadFormResPicture Me
tvwFilter.ImageList = frmMain.ImageListFilter
mWhdmsgselect = MsgSelected.hWnd
mlngViewID = ConViewID
#If conVersionType = 16 Then
If gclsBase.ControlAccount = False Then
mlngViewID = 776
End If
#End If
InitChooseGrd
PicAccount.Enabled = False
PicDate.Enabled = False
MsgSelected.Enabled = False
CmdGoto.Enabled = False
CmdReport.Enabled = False
Set mclsHook = New Hook
Set mclsHookSelect = New Hook
mclsHook.SetHook MsgFilter.hWnd
mclsHookSelect.SetHook MsgSelected.hWnd
#If conVersionType = 1 Then
strCondVersionField = " And (ViewField.bytVersion IN (1,3,7,5,9,11,13,15,17,19,21,23,25,27,29,31))"
strCondVersionEnum = " And (EnumTable.bytVersion IN (1,3,7,5,9,11,13,15,17,19,21,23,25,27,29,31))"
strCondVersion = "(1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31)"
#Else
#If conVersionType = 2 Then
#Else
#If conVersionType = 4 Then
strCondVersionField = " And (ViewField.bytVersion IN (4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31))"
strCondVersionEnum = " And (EnumTable.bytVersion IN (4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31))"
strCondVersion = "(4,5,6,7,12,13,14,15,20,21,22,23,28,29,30,31)"
#ElseIf conVersionType = 8 Then
strCondVersionField = " And (ViewField.bytVersion IN (8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31))"
strCondVersionEnum = " And (EnumTable.bytVersion IN (8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31))"
strCondVersion = "(8,9,10,11,12,13,14,15,24,25,26,27,28,29,30,31)"
#Else
strCondVersionField = " And (ViewField.bytVersion IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31))"
strCondVersionEnum = " And (EnumTable.bytVersion IN (16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31))"
strCondVersion = "(16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31)"
#End If
#End If
#End If
InitTree
Utility.InitDate ReferText2
ReferText2.ColWidth(1) = 1000
CmdReport.Visible = False
ReferText1.SeekCol = "2,1"
ReferText2.SeekCol = "-1,1"
ReferText1.Locked = False
ReferText2.Locked = False
tvwFilter_nodeClick tvwFilter.Nodes(1)
Exit Sub
ErrHandle:
Unload Me
End Sub
Private Sub Form_Resize()
If Me.Left + Me.width < 0 Or Me.Left > Screen.width Then
Me.Left = 300
End If
If Me.WindowState = 1 Then Exit Sub
If Me.WindowState = 2 Then
RedrawForm
Exit Sub
End If
If Me.width < MinFormWidth Then Me.width = MinFormWidth
If Me.Height < MinFormHeigh Then Me.Height = MinFormHeigh
RedrawForm
End Sub
Private Sub RedrawForm()
Dim IntKeyX As Double
Dim IntKeyY As Double
Dim IntTempWidth As Integer
Dim intTemp As Integer
On Error GoTo ErrHandle
If Me.width < MinFormWidth Then GoTo ErrHandle
If Me.Height < MinFormHeigh Then GoTo ErrHandle
'按钮组1
CmdFind.top = FirstButtTop
intTemp = Me.width - 1450
CmdNo.top = CmdFind.top + ButtHeight + 5
CmdHelp.top = CmdNo.top + ButtHeight + Butt2ToButt3
CmdFind.Left = intTemp
CmdNo.Left = intTemp
CmdHelp.Left = intTemp
IntTempWidth = Me.width - (ButtToRight + 200)
IntKeyX = (intTemp - 100) / (MinFormWidth - 1315 - 100)
IntKeyY = (Me.Height - 200) / (MinFormHeigh - 200)
'Frame3 Handle
Frame3.Left = 90
Frame3.top = 90
Frame3.width = CInt(3165 * IntKeyX)
Frame3.Height = CInt(3525 * IntKeyY)
tvwFilter.Left = Frame3.Left + 60
tvwFilter.top = Frame3.top + 120
tvwFilter.width = Frame3.width - 240
tvwFilter.Height = Frame3.Height - 300
'Frame1handle
Frame1.top = 90
Frame1.Left = Frame3.Left + Frame3.width + 200
Frame1.Height = 1605
Frame1.width = IntTempWidth - Frame3.Left - Frame3.width - 500
IntKeyX = Frame1.width / 4515
PicAccount.top = 180
PicDate.top = 180
PicAccount.Left = 120
PicDate.Left = 120
PicAccount.Height = Frame1.Height - 240
PicDate.Height = Frame1.Height - 240
PicAccount.width = Frame1.width - 400
PicDate.width = Frame1.width - 400
'In The PicAccount
ReferText1.width = IntKeyX * 1960
lblFrom2.Left = ReferText1.Left + ReferText1.width + 100
lblTo2.Left = lblFrom2.Left
TxtFrom.Left = ReferText1.Left + ReferText1.width + 700
TxtFrom.width = IntKeyX * 1215
TxtTo.Left = TxtFrom.Left
TxtTo.width = TxtFrom.width
'In The PicDate
ReferText2.width = IntKeyX * 1725
DateOne.width = IntKeyX * 1305
lblFrom.Left = PicDate.width / 2
DateFrom.Left = lblFrom.Left + 510
DateFrom.width = IntKeyX * 1275
lblTo.Left = PicDate.width / 2
DateTo.Left = lblTo.Left + 510
DateTo.width = IntKeyX * 1275
'Fram2Handle
Frame2.top = Frame1.top + 120 + Frame1.Height
Frame2.Left = Frame1.Left
Frame2.width = Frame1.width
Frame2.Height = Frame3.Height - Frame1.Height - 120
MsgFilter.top = 200
MsgFilter.Left = 120
MsgFilter.width = Frame2.width - 240
MsgFilter.Height = Frame2.Height - 300
'MsgSelectedhandle
intTemp = Me.Height - Frame3.Height - Frame3.top - 600
MsgSelected.Left = 120
MsgSelected.Height = intTemp
MsgSelected.top = Me.Height - 500 - MsgSelected.Height
MsgSelected.width = IntTempWidth - 400
'按钮组2
CmdGoto.Left = CmdFind.Left
CmdReport.Left = CmdFind.Left
CmdReset.Left = CmdFind.Left
CmdGoto.top = MsgSelected.top
CmdReset.top = CmdGoto.top + ButtHeight + 5
' CmdReport.top = CmdGoto.top + ButtHeight + 5
' CmdReset.top = CmdReport.top + ButtHeight + Butt2ToButt3
ErrHandle:
End Sub
Private Sub Form_Unload(Cancel As Integer)
mWhdmsgselect = 0
Set mclsHook = Nothing
Set mclsHookSelect = Nothing
Utility.UnLoadFormResPicture Me
gclsSys.MainControls.Remove Me
End Sub
Private Sub MsgSelected_Click()
Static lngSortType As Long
With MsgSelected
If .MouseRow = 0 Then
.SelectionMode = flexSelectionByColumn
Select Case .col
Case 9, 10, 11, 12, 13, 15, 16
If lngSortType <> 3 Then
.Sort = 3
lngSortType = 3
Else
.Sort = 4
lngSortType = 4
End If
Case Else
If lngSortType <> 5 Then
.Sort = 5
lngSortType = 5
Else
.Sort = 6
lngSortType = 6
End If
End Select
Else
.SelectionMode = flexSelectionByRow
End If
End With
End Sub
Private Sub MsgSelected_DblClick()
If MsgSelected.SelectionMode = flexSelectionByColumn Then Exit Sub
CmdGoto_Click
End Sub
Private Sub ReferText1_ItemNotExist()
mItemNotExit = True
End Sub
Private Sub ReferText1_LostFocus()
mblnRefertext1 = False
End Sub
Private Sub ReferText1_MouseDown(Button As Integer, Shift As Integer, x As Single, y As Single)
mblnRefertext1 = True
End Sub
Private Sub ReferText1_KeyPress(KeyAscii As Integer)
mblnRefertext1 = True
End Sub
Private Sub dateone_lostfocus()
Dim Index As Long
Dim index2 As Long
If Trim(DateOne.Text) = "" Then
'删出当前行
If Left(tvwFilter.Nodes(mCurLineOfSelect).Tag, 1) = "*" Then
DelCurentline
End If
Else
'Add One line of dateclass.
Modifyrefertext1
mstrSelected(mCurentline, 5) = DateOne.Text
mstrSelected(mCurentline, 6) = ""
mstrSelected(mCurentline, 7) = ""
mstrSelected(mCurentline, 8) = Trim(mstrSelected(mCurentline, 2)) & "='" & Trim(mstrSelected(mCurentline, 5)) & "'"
AddSelectedTag
MsgFilter.TextMatrix(mCurentline, 1) = Trim(mstrSelected(mCurentline, 5))
AddMsgFilter
End If
End Sub
Private Sub InitChooseGrd()
Dim Count As Integer
With MsgFilter
' InitNumLine
.Rows = 2
' InitNumberCol
.Cols = 2
For Count = 0 To .Cols - 1
.FixedAlignment(Count) = 4
Next Count
' Init FixedLine
.TextMatrix(0, 0) = "过滤项目"
.TextMatrix(0, 1) = "过滤条件"
.ColWidth(0) = 1250
.ColWidth(1) = 3000
.RowHeight(1) = 0
End With
With MsgSelected
' InitNumLine
.Rows = 2
' InitNumberCol
.Cols = conLineOfFind + 1
For Count = 0 To .Cols - 1
.FixedAlignment(Count) = 4
Next Count
' Init FixedLine
.TextMatrix(0, 0) = "日期"
.ColAlignment(0) = 4
.TextMatrix(0, 1) = "单据类型"
.ColAlignment(1) = 1
.TextMatrix(0, 2) = "单据号"
.ColAlignment(2) = 1
.TextMatrix(0, 3) = "币种"
.ColAlignment(3) = 1
.TextMatrix(0, 4) = "科目"
.ColAlignment(4) = 1
.TextMatrix(0, 5) = "单位"
.ColAlignment(5) = 1
.TextMatrix(0, 6) = "部门"
.ColAlignment(6) = 1
.TextMatrix(0, 7) = "职员"
.ColAlignment(7) = 1
.TextMatrix(0, 8) = "商品"
.ColAlignment(8) = 1
.TextMatrix(0, 9) = "数量"
.TextMatrix(0, 10) = "原币单价"
.TextMatrix(0, 11) = "扣率%"
.TextMatrix(0, 12) = "本币金额"
.TextMatrix(0, 13) = "原币金额"
.TextMatrix(0, 14) = "税率"
.ColAlignment(2) = 1
.TextMatrix(0, 15) = "本币税额"
.TextMatrix(0, 16) = "原币税额"
.TextMatrix(0, 17) = "统计"
.ColAlignment(17) = 1
.TextMatrix(0, 18) = "项目"
.ColAlignment(18) = 1
.TextMatrix(0, 19) = "工程"
.ColAlignment(19) = 1
.TextMatrix(0, 21) = "备注"
.ColAlignment(21) = 1
.TextMatrix(0, 20) = "制单"
.ColAlignment(20) = 1
.TextMatrix(0, conLineOfFind) = "凭单ID号"
If mlngViewID = 776 Then
.TextMatrix(0, 1) = "凭证类型"
.ColAlignment(1) = 1
.TextMatrix(0, 2) = "凭证号"
.TextMatrix(0, 19) = "制单"
.ColAlignment(19) = 1
.TextMatrix(0, 21) = "记帐"
.ColAlignment(21) = 1
.TextMatrix(0, 20) = "复核"
.ColAlignment(20) = 1
End If
Dim Index As Long
For Index = 0 To conLineOfFind - 1
.ColWidth(Index) = 1300
Next
.ColWidth(14) = 1800
.ColWidth(conLineOfFind) = 0
.RowHeight(1) = 0
#If conVersionType = 16 Then
If mlngViewID = 776 Then
.ColWidth(8) = 0
.ColWidth(11) = 0
.ColWidth(14) = 0
.ColWidth(15) = 0
.ColWidth(16) = 0
Else
.ColWidth(11) = 0
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -