Module1

C:\Temp\Northwind\Module1.bas
Generated: 1/8/2003 3:25:53 AM


Table of Contents
Main
LoadResStrings

Attribute VB_Name = "Module1" Public fMainForm As frmMain
Sub Main() Table of Contents frmSplash.Show frmSplash.Refresh Set fMainForm = New frmMain Load fMainForm Unload frmSplash fMainForm.Show End Sub
Sub LoadResStrings(frm As Form) Table of Contents On Error Resume Next Dim ctl As Control Dim obj As Object Dim fnt As Object Dim sCtlType As String Dim nVal As Integer 'set the form's caption frm.Caption = LoadResString(CInt(frm.Tag)) 'set the font Set fnt = frm.Font fnt.Name = LoadResString(20) fnt.Size = CInt(LoadResString(21)) 'set the controls' captions using the caption 'property for menu items and the Tag property 'for all other controls 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