?? mdlmain.bas
字號(hào):
Attribute VB_Name = "mdlMain"
Option Explicit
Global Const LISTVIEW_MODE0 = "大圖標(biāo)"
Global Const LISTVIEW_MODE1 = "小圖標(biāo)"
Global Const LISTVIEW_MODE2 = "列表"
Global Const LISTVIEW_MODE3 = "詳細(xì)資料"
Public fMainForm As frmMain
Sub Main()
Dim fLogin As New frmLogin
fLogin.Show vbModal
If Not fLogin.OK Then
'登錄失敗,退出應(yīng)用程序
End
End If
Unload fLogin
Set fMainForm = New frmMain
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
'設(shè)置窗體的 caption 屬性
frm.Caption = LoadResString(CInt(frm.Tag))
'設(shè)置字體
Set fnt = frm.Font
fnt.Name = LoadResString(20)
fnt.Size = CInt(LoadResString(21))
'設(shè)置控件的標(biāo)題,對(duì)菜單項(xiàng)使用 caption 屬性并對(duì)所有其他控件使用 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
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -