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

📄 frmselectcarryforwardtable.frm

📁 一个用VB写的财务软件源码
💻 FRM
字号:
VERSION 5.00
Begin VB.Form frmSelectCarryForwardTable 
   BorderStyle     =   3  'Fixed Dialog
   Caption         =   "选择结转表"
   ClientHeight    =   4005
   ClientLeft      =   45
   ClientTop       =   330
   ClientWidth     =   4275
   Icon            =   "frmSelectCarryForwardTable.frx":0000
   LinkTopic       =   "Form1"
   MaxButton       =   0   'False
   MinButton       =   0   'False
   ScaleHeight     =   4005
   ScaleWidth      =   4275
   ShowInTaskbar   =   0   'False
   StartUpPosition =   2  '屏幕中心
   Begin VB.CommandButton cmdCancel 
      Caption         =   "取消(&C)"
      Height          =   345
      Left            =   3060
      TabIndex        =   5
      Top             =   3210
      Width           =   1065
   End
   Begin VB.CommandButton cmdOK 
      Caption         =   "确定(&O)"
      Height          =   345
      Left            =   3060
      TabIndex        =   4
      Top             =   2350
      Width           =   1065
   End
   Begin VB.CommandButton cmdClearAll 
      Caption         =   "清空(&C)"
      Height          =   345
      Left            =   3060
      TabIndex        =   3
      Top             =   1490
      Width           =   1065
   End
   Begin VB.CommandButton cmdSelectAll 
      Caption         =   "全选(&A)"
      Height          =   345
      Left            =   3060
      TabIndex        =   2
      Top             =   630
      Width           =   1065
   End
   Begin VB.ListBox lstTable 
      Height          =   3630
      Left            =   60
      Style           =   1  'Checkbox
      TabIndex        =   0
      Top             =   300
      Width           =   2805
   End
   Begin VB.Label lblInf 
      AutoSize        =   -1  'True
      Caption         =   "结转表如下所示:"
      Height          =   180
      Left            =   90
      TabIndex        =   1
      Top             =   60
      Width           =   1440
   End
End
Attribute VB_Name = "frmSelectCarryForwardTable"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit

Dim i As Integer

'Public usCarryForwardTableCode As Variant         '需要结转表的代码
Public usCarryForwardTableName As Variant         '需要结转表的名称
Public OK As Boolean


Private Sub cmdCancel_Click()
    OK = False
    Me.Hide
End Sub

Private Sub cmdClearAll_Click()
    Dim saveIndex As Long, saveTop As Long
    
    '保存当前状态
    saveIndex = lstTable.ListIndex
    saveTop = lstTable.TopIndex
    '不可见
    lstTable.Visible = False
    
    '改变所有项的状态为true
    For i = 0 To lstTable.ListCount - 1
        lstTable.Selected(i) = False
    Next i
    
    '恢复焦点到点击按钮前光标所在行
    lstTable.TopIndex = saveTop
    lstTable.ListIndex = saveIndex
    lstTable.Visible = True
    
End Sub

Private Sub cmdOk_Click()
    OK = True
    Me.Hide
End Sub

Private Sub cmdSelectAll_Click()
    Dim saveIndex As Long, saveTop As Long
    
    '保存当前状态
    saveIndex = lstTable.ListIndex
    saveTop = lstTable.TopIndex
    '不可见
    lstTable.Visible = False
    
    '改变所有项的状态为true
    For i = 0 To lstTable.ListCount - 1
        lstTable.Selected(i) = True
    Next i
    
    '恢复焦点到点击按钮前光标所在行
    lstTable.TopIndex = saveTop
    lstTable.ListIndex = saveIndex
    lstTable.Visible = True
    
End Sub

Private Sub Form_Load()
    
    For i = LBound(usCarryForwardTableName) To UBound(usCarryForwardTableName)
        lstTable.AddItem usCarryForwardTableName(i)
        lstTable.Selected(lstTable.NewIndex) = True
    Next i
End Sub

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -