上传用户:zhpu1995
上传日期:2013-09-06
资源大小:61151k
文件大小:7k
源码类别:

企业管理

开发平台:

Visual Basic

  1. VERSION 5.00
  2. Object = "{D76D7128-4A96-11D3-BD95-D296DC2DD072}#1.0#0"; "VSOCX7.OCX"
  3. Begin VB.Form Qr_ShowItemsFrm 
  4.    Caption         =   "显示项目"
  5.    ClientHeight    =   5565
  6.    ClientLeft      =   60
  7.    ClientTop       =   345
  8.    ClientWidth     =   4770
  9.    Icon            =   "辅助_显示项目选择.frx":0000
  10.    LinkTopic       =   "Form1"
  11.    MaxButton       =   0   'False
  12.    MinButton       =   0   'False
  13.    ScaleHeight     =   5565
  14.    ScaleWidth      =   4770
  15.    StartUpPosition =   1  '所有者中心
  16.    Begin VB.CommandButton Cmd_HideAll 
  17.       Caption         =   "全部隐藏"
  18.       Height          =   300
  19.       Left            =   45
  20.       TabIndex        =   4
  21.       Top             =   5175
  22.       Width           =   1120
  23.    End
  24.    Begin VB.CommandButton Cmd_ShowAll 
  25.       Caption         =   "全部显示"
  26.       Height          =   300
  27.       Left            =   1215
  28.       TabIndex        =   3
  29.       Top             =   5175
  30.       Width           =   1120
  31.    End
  32.    Begin VB.CommandButton Cmd_OK 
  33.       Caption         =   "确定(&O)"
  34.       Height          =   300
  35.       Left            =   2385
  36.       TabIndex        =   2
  37.       Top             =   5175
  38.       Width           =   1120
  39.    End
  40.    Begin VB.CommandButton Cmd_Cancel 
  41.       Caption         =   "取消(&C)"
  42.       Height          =   300
  43.       Left            =   3555
  44.       TabIndex        =   1
  45.       Top             =   5175
  46.       Width           =   1120
  47.    End
  48.    Begin VSFlex8Ctl.VSFlexGrid vsFG_Item 
  49.       Height          =   5055
  50.       Left            =   75
  51.       TabIndex        =   0
  52.       Top             =   30
  53.       Width           =   4605
  54.       _ExtentX        =   8123
  55.       _ExtentY        =   8916
  56.       Appearance      =   1
  57.       BorderStyle     =   1
  58.       Enabled         =   -1  'True
  59.       BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851} 
  60.          Name            =   "宋体"
  61.          Size            =   9
  62.          Charset         =   134
  63.          Weight          =   400
  64.          Underline       =   0   'False
  65.          Italic          =   0   'False
  66.          Strikethrough   =   0   'False
  67.       EndProperty
  68.       MousePointer    =   0
  69.       BackColor       =   -2147483643
  70.       ForeColor       =   -2147483640
  71.       BackColorFixed  =   -2147483633
  72.       ForeColorFixed  =   -2147483630
  73.       BackColorSel    =   -2147483635
  74.       ForeColorSel    =   -2147483634
  75.       BackColorBkg    =   -2147483636
  76.       BackColorAlternate=   -2147483643
  77.       GridColor       =   -2147483633
  78.       GridColorFixed  =   -2147483632
  79.       TreeColor       =   -2147483632
  80.       FloodColor      =   192
  81.       SheetBorder     =   -2147483642
  82.       FocusRect       =   1
  83.       HighLight       =   1
  84.       AllowSelection  =   -1  'True
  85.       AllowBigSelection=   -1  'True
  86.       AllowUserResizing=   0
  87.       SelectionMode   =   0
  88.       GridLines       =   1
  89.       GridLinesFixed  =   2
  90.       GridLineWidth   =   1
  91.       Rows            =   50
  92.       Cols            =   2
  93.       FixedRows       =   1
  94.       FixedCols       =   1
  95.       RowHeightMin    =   0
  96.       RowHeightMax    =   0
  97.       ColWidthMin     =   1750
  98.       ColWidthMax     =   6000
  99.       ExtendLastCol   =   0   'False
  100.       FormatString    =   ""
  101.       ScrollTrack     =   0   'False
  102.       ScrollBars      =   3
  103.       ScrollTips      =   0   'False
  104.       MergeCells      =   0
  105.       MergeCompare    =   0
  106.       AutoResize      =   -1  'True
  107.       AutoSizeMode    =   0
  108.       AutoSearch      =   0
  109.       MultiTotals     =   -1  'True
  110.       SubtotalPosition=   1
  111.       OutlineBar      =   0
  112.       OutlineCol      =   0
  113.       Ellipsis        =   0
  114.       ExplorerBar     =   0
  115.       PicturesOver    =   0   'False
  116.       FillStyle       =   0
  117.       RightToLeft     =   0   'False
  118.       PictureType     =   0
  119.       TabBehavior     =   0
  120.       OwnerDraw       =   0
  121.       Editable        =   0   'False
  122.       ShowComboButton =   -1  'True
  123.       WordWrap        =   0   'False
  124.       TextStyle       =   0
  125.       TextStyleFixed  =   0
  126.       OleDragMode     =   0
  127.       OleDropMode     =   0
  128.       DataMode        =   0
  129.       VirtualData     =   -1  'True
  130.    End
  131. End
  132. Attribute VB_Name = "Qr_ShowItemsFrm"
  133. Attribute VB_GlobalNameSpace = False
  134. Attribute VB_Creatable = False
  135. Attribute VB_PredeclaredId = True
  136. Attribute VB_Exposed = False
  137. '******************************************************************
  138. '*    模 块 名 称 :显示项目
  139. '*    功 能 描 述 :
  140. '*    程序员姓名  :苗鹏
  141. '*    最后修改人  :苗鹏
  142. '*    最后修改时间:2002/01/01
  143. '*    备        注:
  144. '******************************************************************
  145. Public vs As vsFlexGrid
  146. Public iBeginCol As Integer
  147. Private Sub Cmd_Cancel_Click()
  148.     
  149.     Unload Me
  150.     
  151. End Sub
  152. Private Sub Cmd_HideAll_Click()
  153.     
  154.     Dim i As Integer
  155.     With Me.vsFG_Item
  156.         For i = .FixedRows To .Rows - 1
  157.             .TextMatrix(i, 1) = ""
  158.         Next i
  159.     End With
  160.     
  161. End Sub
  162. Private Sub Cmd_OK_Click()
  163.     
  164.     Dim i As Integer
  165.     Dim j As Integer
  166.     With vs
  167.         ''根据当前网格的显示情况判断是否显示项目
  168.         For i = Me.vsFG_Item.FixedRows To Me.vsFG_Item.Rows - 1
  169.             For j = 0 To .Cols - 1
  170.               If .TextMatrix(.FixedRows - 1, j) = Me.vsFG_Item.TextMatrix(i, 0) Then
  171.                 Exit For
  172.               End If
  173.             Next j
  174.             '如果当前网格的行与父窗体的网格列对不上,报错退出
  175.             If j > .Cols - 1 Then
  176.                 MsgBox "未知错误!           ", vbOKOnly + vbCritical
  177.                 Exit Sub
  178.             End If
  179.             '隐藏父窗体网格列
  180.             If Me.vsFG_Item.TextMatrix(i, 1) = "√" Then
  181.                 .ColHidden(j) = False
  182.             Else
  183.                 .ColHidden(j) = True
  184.             End If
  185.         Next i
  186.     End With
  187.   
  188.     Unload Me
  189.     
  190. End Sub
  191. Private Sub Cmd_ShowAll_Click() '显示所有列
  192.     
  193.     Dim i As Integer
  194.     With Me.vsFG_Item
  195.         For i = .FixedRows To .Rows - 1
  196.             .TextMatrix(i, 1) = "√"
  197.         Next i
  198.     End With
  199.     
  200. End Sub
  201. Private Sub Form_Load()
  202.     
  203.     Dim i As Integer
  204.     '显示当前父窗体的网格状态,父窗口网格的列=当前网格的Rows-FixedRows
  205.     With vs
  206.         Me.vsFG_Item.Rows = .Cols - Me.iBeginCol + 1
  207.         Me.vsFG_Item.RowHeight(0) = 400
  208.         Me.vsFG_Item.ColAlignment(0) = flexAlignLeftCenter
  209.         .FixedAlignment(0) = flexAlignCenterCenter
  210.         .FixedAlignment(1) = flexAlignCenterCenter
  211.         Me.vsFG_Item.TextMatrix(0, 0) = "项目"
  212.         Me.vsFG_Item.TextMatrix(0, 1) = "显示"
  213.         For i = Me.iBeginCol To .Cols - 1
  214.             Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 0) = .TextMatrix(.FixedRows - 1, i)
  215.             If .ColHidden(i) = True Then
  216.                 Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 1) = ""
  217.             Else
  218.                 Me.vsFG_Item.TextMatrix(i - Me.iBeginCol + 1, 1) = "√"
  219.             End If
  220.         Next i
  221.     End With
  222.     
  223. End Sub
  224. Private Sub vsFG_Item_DblClick()
  225.     
  226.     With Me.vsFG_Item
  227.         .TextMatrix(.Row, .Col) = IIf(Trim(.TextMatrix(.Row, .Col)) = "", "√", "")
  228.     End With
  229.     
  230. End Sub