📄
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
Begin VB.Form Salary_ShowItem_Frm
BorderStyle = 3 'Fixed Dialog
Caption = "显示项目"
ClientHeight = 5625
ClientLeft = 45
ClientTop = 330
ClientWidth = 4050
Icon = "公用_显示项目.frx":0000
LinkTopic = "Form1"
LockControls = -1 'True
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 5625
ScaleWidth = 4050
ShowInTaskbar = 0 'False
StartUpPosition = 1 '所有者中心
Begin VB.CommandButton Cmd_HideAll
Caption = "全部隐藏"
Height = 300
Left = 105
TabIndex = 4
Top = 5280
Width = 930
End
Begin VB.CommandButton Cmd_ShowAll
Caption = "全部显示"
Height = 300
Left = 1085
TabIndex = 3
Top = 5280
Width = 930
End
Begin VB.CommandButton Cmd_OK
Caption = "确定(&O)"
Default = -1 'True
Height = 300
Left = 2065
TabIndex = 2
Top = 5280
Width = 930
End
Begin VB.CommandButton Cmd_Cancel
Cancel = -1 'True
Caption = "取消(&C)"
Height = 300
Left = 3045
TabIndex = 1
Top = 5280
Width = 930
End
Begin VSFlex8Ctl.VSFlexGrid vsFG_Item
Height = 5055
Left = 105
TabIndex = 0
Top = 120
Width = 3870
_ExtentX = 6826
_ExtentY = 8916
Appearance = 1
BorderStyle = 1
Enabled = -1 'True
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MousePointer = 0
BackColor = -2147483643
ForeColor = -2147483640
BackColorFixed = -2147483633
ForeColorFixed = -2147483630
BackColorSel = -2147483635
ForeColorSel = -2147483634
BackColorBkg = -2147483636
BackColorAlternate= -2147483643
GridColor = -2147483633
GridColorFixed = -2147483632
TreeColor = -2147483632
FloodColor = 192
SheetBorder = -2147483642
FocusRect = 1
HighLight = 1
AllowSelection = -1 'True
AllowBigSelection= -1 'True
AllowUserResizing= 0
SelectionMode = 0
GridLines = 1
GridLinesFixed = 2
GridLineWidth = 1
Rows = 50
Cols = 2
FixedRows = 1
FixedCols = 1
RowHeightMin = 0
RowHeightMax = 0
ColWidthMin = 1750
ColWidthMax = 6000
ExtendLastCol = 0 'False
FormatString = ""
ScrollTrack = 0 'False
ScrollBars = 3
ScrollTips = 0 'False
MergeCells = 0
MergeCompare = 0
AutoResize = -1 'True
AutoSizeMode = 0
AutoSearch = 0
MultiTotals = -1 'True
SubtotalPosition= 1
OutlineBar = 0
OutlineCol = 0
Ellipsis = 0
ExplorerBar = 0
PicturesOver = 0 'False
FillStyle = 0
RightToLeft = 0 'False
PictureType = 0
TabBehavior = 0
OwnerDraw = 0
Editable = 0 'False
ShowComboButton = -1 'True
WordWrap = 0 'False
TextStyle = 0
TextStyleFixed = 0
OleDragMode = 0
OleDropMode = 0
DataMode = 0
VirtualData = -1 'True
End
End
Attribute VB_Name = "Salary_ShowItem_Frm"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'******************************************************************
'* 模 块 名 称 :显示项目
'* 功 能 描 述 :
'* 程序员姓名 :苗鹏
'* 最后修改人 :苗鹏
'* 最后修改时间:2002/01/01
'* 备 注:
'******************************************************************
Public vs As vsFlexGrid
Public iBeginCol As Integer
Private Sub Cmd_Cancel_Click()
Unload Me
End Sub
Private Sub Cmd_HideAll_Click()
Dim i As Integer
With Me.vsFG_Item
For i = .FixedRows To .Rows - 1
.TextMatrix(i, 1) = ""
Next i
End With
End Sub
Private Sub Cmd_OK_Click() '确定
On Error GoTo ErrCtrl
Dim i As Integer
Dim j As Integer
'根据当前网格的显示情况判断是否显示项目
With vs
For i = Me.vsFG_Item.FixedRows To Me.vsFG_Item.Rows - 1
For j = 0 To .Cols - 1
If .TextMatrix(.FixedRows - 1, j) = Me.vsFG_Item.TextMatrix(i, 0) Then
Exit For
End If
Next j
'如果当前网格的行与父窗体的网格列对不上,报错退出
If j > .Cols - 1 Then
MsgBox "出现未知错误!", vbOKOnly + vbCritical
GoTo ErrCtrl
End If
'隐藏父窗体网格列
If Me.vsFG_Item.TextMatrix(i, 1) = "√" Then
.ColHidden(j) = False
Else
.ColHidden(j) = True
End If
Next i
End With
Unload Me
Exit Sub
ErrCtrl:
Unload Me
End Sub
Private Sub Cmd_ShowAll_Click() '显示所有项目
Dim i As Integer
With Me.vsFG_Item
For i = .FixedRows To .Rows - 1
.TextMatrix(i, 1) = "√"
Next i
End With
End Sub
Private Sub Form_Load() '窗体装载
Dim i As Integer
'根据父窗体网格属性初始化当前网格,行列交换
With vs
Me.vsFG_Item.Rows = .Cols - Me.iBeginCol + 1
Me.vsFG_Item.RowHeight(0) = 400
Me.vsFG_Item.ColAlignment(0) = flexAlignLeftCenter
Me.vsFG_Item.TextMatrix(0, 0) = "项目"
Me.vsFG_Item.TextMatrix(0, 1) = "显示"
For i = Me.iBeginCol To .Cols - 1
Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 0) = .TextMatrix(.FixedRows - 1, i)
If .ColHidden(i) = True Then
Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 1) = ""
Else
Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 1) = "√"
End If
Next i
End With
End Sub
Private Sub vsFG_Item_DblClick() '显示或隐藏列
With Me.vsFG_Item
.TextMatrix(.Row, .Col) = IIf(Trim(.TextMatrix(.Row, .Col)) = "", "√", "")
End With
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -