📄 mdlmain.bas
字号:
Attribute VB_Name = "mdlMain"
Option Explicit
Global Const LISTVIEW_MODE0 = "大图标"
Global Const LISTVIEW_MODE1 = "小图标"
Global Const LISTVIEW_MODE2 = "列表"
Global Const LISTVIEW_MODE3 = "详细资料"
Public fMainForm As frmMain
Public opMType As New clsOpMType
Public opMerch As New clsOpMerch
Public opProvider As New clsOpProvider
Public opAdmin As New clsOpAdmin
Public opBuy As New clsOpBuy
Public opSell As New clsOpSell
Public opDispose As New clsOpDispose
Public g_Account As String
Sub Main()
Dim fLogin As New frmLogin
'初始化数据库链接
Call DBMain
fLogin.Show vbModal
If Not fLogin.OK Then
'登录失败,退出应用程序
End
End If
Unload fLogin
frmSplash.Show
frmSplash.Refresh
Set fMainForm = New frmMain
Load fMainForm
Unload frmSplash
fMainForm.Show
End Sub
Sub LoadResStrings(frm As Form)
On Error Resume Next
Dim ctl As Control
Dim obj As Object
Dim fnt As Object
Dim sCtlType As String
Dim nVal As Integer
'设置窗体的 caption 属性
frm.Caption = LoadResString(CInt(frm.Tag))
'设置字体
Set fnt = frm.Font
fnt.Name = LoadResString(20)
fnt.Size = CInt(LoadResString(21))
'设置控件的标题,对菜单项使用 caption 属性并对所有其他控件使用 Tag 属性
For Each ctl In frm.Controls
Set ctl.Font = fnt
sCtlType = TypeName(ctl)
If sCtlType = "Label" Then
ctl.Caption = LoadResString(CInt(ctl.Tag))
ElseIf sCtlType = "Menu" Then
ctl.Caption = LoadResString(CInt(ctl.Caption))
ElseIf sCtlType = "TabStrip" Then
For Each obj In ctl.Tabs
obj.Caption = LoadResString(CInt(obj.Tag))
obj.ToolTipText = LoadResString(CInt(obj.ToolTipText))
Next
ElseIf sCtlType = "Toolbar" Then
For Each obj In ctl.Buttons
obj.ToolTipText = LoadResString(CInt(obj.ToolTipText))
Next
ElseIf sCtlType = "ListView" Then
For Each obj In ctl.ColumnHeaders
obj.Text = LoadResString(CInt(obj.Tag))
Next
Else
nVal = 0
nVal = Val(ctl.Tag)
If nVal > 0 Then ctl.Caption = LoadResString(nVal)
nVal = 0
nVal = Val(ctl.ToolTipText)
If nVal > 0 Then ctl.ToolTipText = LoadResString(nVal)
End If
Next
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -