📄 fmselect.frm
字号:
VERSION 5.00
Begin VB.Form fmSelect
BackColor = &H00000000&
Caption = "个人财务助手 - V1.2 Beta版"
ClientHeight = 3795
ClientLeft = 60
ClientTop = 420
ClientWidth = 3660
LinkTopic = "Form1"
ScaleHeight = 3795
ScaleWidth = 3660
StartUpPosition = 2 '屏幕中心
Begin VB.CommandButton cmdNew
Caption = "新 建"
Height = 300
Left = 1440
TabIndex = 1
Top = 3240
Width = 735
End
Begin VB.Frame frmSelect
BackColor = &H00000000&
Caption = "请选择用户"
ForeColor = &H0000FF00&
Height = 3000
Left = 0
TabIndex = 4
Top = 0
Width = 3615
Begin VB.ListBox lstUsers
Appearance = 0 'Flat
BackColor = &H00000000&
ForeColor = &H0000FF00&
Height = 2730
Left = 30
TabIndex = 3
Top = 225
Width = 3555
End
End
Begin VB.CommandButton cmdCancel
Caption = "取 消"
Height = 300
Left = 2520
TabIndex = 2
Top = 3240
Width = 735
End
Begin VB.CommandButton cmdOk
Caption = "确 定"
Height = 300
Left = 360
TabIndex = 0
Top = 3240
Width = 735
End
End
Attribute VB_Name = "fmSelect"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'Option Explicit
'获取所有用户
Private Function GetAllUsers()
Dim i As Integer
Dim sum As Integer
sum = GetUsersCount()
lstUsers.Clear
For i = 1 To sum
lstUsers.AddItem GetUserName(i)
Next
End Function
Private Sub cmdCancel_Click()
Unload Me
End Sub
Private Sub cmdNew_Click()
fmNew.Show 1
GetAllUsers
End Sub
Private Sub cmdOk_Click()
If lstUsers.ListIndex >= 0 Then
lstUsers_DblClick
Else
MsgBox "请选择用户"
End If
End Sub
Private Sub Form_Load()
Dim strPath As String
Dim nSize As Integer
If debugFlag Then
g_userPath = App.Path & "\db\" & g_userFileName
Else
'获取数据库完整路径
strPath = Space(260) '!!!设定g_userPath容器
nSize = GetSystemDirectory(strPath, 260)
g_userPath = Mid(strPath, 1, nSize) & "\" & g_userFileName
End If
If Dir(g_userPath) = vbStringNull Then
CreateUserDB
End If
GetAllUsers
End Sub
Private Sub lstUsers_DblClick()
g_szUser = lstUsers.Text
g_nUserID = lstUsers.ListIndex + 1
Load fmPwd
Unload Me
fmPwd.Show
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -