Attribute VB_Name = "MainMod"
Global Const LISTVIEW_MODE0 = "戝偒偄辈狠"
Global Const LISTVIEW_MODE1 = "彫偝偄辈狠"
Global Const LISTVIEW_MODE2 = "堦棗"
Global Const LISTVIEW_MODE3 = "徻嵶"
Public fMainForm As frmMain


Sub Main()
    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


    '太把偺番踢籍輦饜輶鑲祩軅穪B
    frm.Caption = LoadResString(CInt(frm.Tag))
    

    '太菽傪愝掕偟傑偡丅
    Set fnt = frm.Font
    fnt.Name = LoadResString(20)
    fnt.Size = CInt(LoadResString(21))
    

    '移崁栚偱偼 Caption 踢凼呙▊饋A偦偺懠偺
    '偡傋偰偺狠嫩百偱偼 Tag 踢凼呙▊饚g梡偟偰
    '狠嫩百偺番踢籍輦饜輶鑲祩軅穪B
    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

