📄 报表项目.frm
字号:
VERSION 5.00
Begin VB.Form frmRptItem
BorderStyle = 1 'Fixed Single
Caption = "报表项目选择"
ClientHeight = 3795
ClientLeft = 1155
ClientTop = 1980
ClientWidth = 5280
Icon = "报表项目.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 3795
ScaleWidth = 5280
Begin VB.Frame Frame1
Height = 2730
Index = 1
Left = 150
TabIndex = 2
Top = 330
Width = 4785
Begin VB.ListBox List1
Height = 2040
ItemData = "报表项目.frx":000C
Left = 300
List = "报表项目.frx":000E
Sorted = -1 'True
TabIndex = 8
Top = 480
Width = 1695
End
Begin VB.ListBox List2
Height = 2040
ItemData = "报表项目.frx":0010
Left = 2790
List = "报表项目.frx":0012
Sorted = -1 'True
TabIndex = 7
Top = 480
Width = 1695
End
Begin VB.CommandButton Command1
Caption = ">>"
Height = 285
Index = 0
Left = 2220
TabIndex = 6
Top = 600
Width = 405
End
Begin VB.CommandButton Command1
Caption = ">"
Height = 285
Index = 1
Left = 2220
TabIndex = 5
Top = 1095
Width = 405
End
Begin VB.CommandButton Command1
Caption = "<"
Height = 285
Index = 2
Left = 2220
TabIndex = 4
Top = 1575
Width = 405
End
Begin VB.CommandButton Command1
Caption = "<<"
Height = 285
Index = 3
Left = 2220
TabIndex = 3
Top = 2070
Width = 405
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "不显示列项"
Height = 180
Index = 1
Left = 390
TabIndex = 10
Top = 240
Width = 900
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "显示列项"
Height = 180
Index = 2
Left = 2880
TabIndex = 9
Top = 240
Width = 720
End
End
Begin VB.CommandButton Command2
Cancel = -1 'True
Height = 365
Index = 1
Left = 3570
Style = 1 'Graphical
TabIndex = 1
Top = 3240
Width = 1080
End
Begin VB.CommandButton Command2
Default = -1 'True
Height = 365
Index = 0
Left = 1980
Style = 1 'Graphical
TabIndex = 0
Top = 3240
Width = 1080
End
Begin VB.Label Label1
AutoSize = -1 'True
Caption = "请选择可视列项:"
Height = 180
Index = 0
Left = 240
TabIndex = 11
Top = 120
Width = 1440
End
End
Attribute VB_Name = "frmRptItem"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'软件著作权: 北京用友软件集团有限公司
'系统名称: 资金管理8.0
'功能说明: 报表项目选择
'作者: 赵春立
Option Explicit
Public mGrid As Object
Public mStartCol As Long
Public mEndCol As Long
Public mCollectColWidth As Collection
Private Sub Command1_Click(Index As Integer)
Select Case Index
Case 0
AllItem List1, List2
Case 1
SingleItem List1, List2
Case 2
SingleItem List2, List1
Case 3
AllItem List2, List1
End Select
End Sub
Private Sub SingleItem(lstFrom As ListBox, lstTo As ListBox)
Dim i As Long
lstTo.AddItem lstFrom.List(lstFrom.ListIndex)
If lstTo.ListIndex = -1 Then
lstTo.Selected(0) = True
End If
i = lstFrom.ListIndex
lstFrom.RemoveItem lstFrom.ListIndex
If lstFrom.ListCount <> 0 Then
If i < lstFrom.ListCount Then
lstFrom.Selected(i) = True
Else
lstFrom.Selected(i - 1) = True
End If
End If
If List1.ListCount > 0 Then
stList1
Else
exList1
End If
If List2.ListCount > 0 Then
stList2
Else
exList2
End If
End Sub
Private Sub AllItem(lstFrom As ListBox, lstTo As ListBox)
Dim i As Long
For i = 0 To lstFrom.ListCount - 1
lstTo.AddItem lstFrom.List(i)
Next i
lstFrom.Clear
If lstTo.ListIndex = -1 Then lstTo.Selected(0) = True
If lstFrom.Name = "List1" Then
exList1
stList2
Else
stList1
exList2
End If
End Sub
Private Sub Command2_Click(Index As Integer)
Select Case Index
Case 0
MakeVisible
Unload Me
Case 1
Unload Me
End Select
End Sub
Private Sub Form_Load()
Me.Icon = LoadResPicture(109, vbResIcon)
Command2(0).Picture = LoadResPicture(103, vbResBitmap)
Command2(1).Picture = LoadResPicture(104, vbResBitmap)
GridInfo
If List2.ListCount > 0 Then
List2.Selected(0) = True
stList2
Else
exList2
End If
If List1.ListCount > 0 Then
List1.Selected(0) = True
stList1
Else
exList1
End If
CenterForm Me
End Sub
Private Sub MakeVisible()
Dim i As Integer, iCol As Integer
For i = 1 To List1.ListCount
iCol = mID(List1.List(i - 1), 2, 2) + mStartCol - 1
mGrid.ColWidth(iCol) = 0
Next i
For i = 1 To List2.ListCount
iCol = mID(List2.List(i - 1), 2, 2) + mStartCol - 1
If mGrid.ColWidth(iCol) = 0 Then
mGrid.ColWidth(iCol) = mCollectColWidth(CStr(iCol))
End If
Next i
End Sub
Private Sub GridInfo()
Dim i As Integer
If mEndCol = 0 Then mEndCol = mGrid.Cols - 1
For i = 1 To mEndCol - mStartCol + 1
If mGrid.ColWidth(i + mStartCol - 1) = 0 Then
List1.AddItem "[" & Right("0" & i, 2) & "]" & mGrid.TextMatrix(0, i + mStartCol - 1)
Else
List2.AddItem "[" & Right("0" & i, 2) & "]" & mGrid.TextMatrix(0, i + mStartCol - 1)
End If
Next i
End Sub
Private Sub stList1()
Command1(0).Enabled = True
Command1(1).Enabled = True
End Sub
Private Sub exList1()
Command1(0).Enabled = False
Command1(1).Enabled = False
End Sub
Private Sub stList2()
Command1(2).Enabled = True
Command1(3).Enabled = True
End Sub
Private Sub exList2()
Command1(2).Enabled = False
Command1(3).Enabled = False
End Sub
Private Sub Form_Unload(Cancel As Integer)
'mStartCol = 0
'mEndCol = 0
'Set mCollectColWidth = Nothing
End Sub
Private Sub List1_dblClick()
SingleItem List1, List2
End Sub
Private Sub List2_DblClick()
SingleItem List2, List1
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -