⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄

📁 VB开发的ERP系统
💻
字号:
VERSION 5.00
Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
Begin VB.Form Qr_ShowItemsFrm 
   Caption         =   "显示项目"
   ClientHeight    =   5565
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   4770
   Icon            =   "辅助_显示项目选择.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   5565
   ScaleWidth      =   4770
   StartUpPosition =   1  '所有者中心
   Begin VB.CommandButton Cmd_HideAll 
      Caption         =   "全部隐藏"
      Height          =   300
      Left            =   45
      TabIndex        =   4
      Top             =   5175
      Width           =   1120
   End
   Begin VB.CommandButton Cmd_ShowAll 
      Caption         =   "全部显示"
      Height          =   300
      Left            =   1215
      TabIndex        =   3
      Top             =   5175
      Width           =   1120
   End
   Begin VB.CommandButton Cmd_OK 
      Caption         =   "确定(&O)"
      Height          =   300
      Left            =   2385
      TabIndex        =   2
      Top             =   5175
      Width           =   1120
   End
   Begin VB.CommandButton Cmd_Cancel 
      Caption         =   "取消(&C)"
      Height          =   300
      Left            =   3555
      TabIndex        =   1
      Top             =   5175
      Width           =   1120
   End
   Begin VSFlex8Ctl.VSFlexGrid vsFG_Item 
      Height          =   5055
      Left            =   75
      TabIndex        =   0
      Top             =   30
      Width           =   4605
      _ExtentX        =   8123
      _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 = "Qr_ShowItemsFrm"
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()
    
    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
                Exit Sub
            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
    
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
    '显示当前父窗体的网格状态,父窗口网格的列=当前网格的Rows-FixedRows
    With vs
        Me.vsFG_Item.Rows = .Cols - Me.iBeginCol + 1
        Me.vsFG_Item.RowHeight(0) = 400
        Me.vsFG_Item.ColAlignment(0) = flexAlignLeftCenter
        .FixedAlignment(0) = flexAlignCenterCenter
        .FixedAlignment(1) = flexAlignCenterCenter
        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 + -