VB 实现国际化
1. 利用资源文件保存国际化列表
2.“外接程序”--“外接程序管理器”--“VB6 资源编辑器”就可以编辑资源文件
3.部分代码
'窗体加载
Private Sub Form_Load()
Dim LocaleID As Long
LocaleID = GetSystemDefaultLCID
Select Case LocaleID
'英文
Case &H409
lang = "1"
'中文简体
Case &H804
lang = "2"
'日文
Case &H411
lang = "3"
End Select
Call LoadString
End Sub
'实现程序多语言化
Sub LoadString()
Me.Caption = LoadResString(Int(lang & "01"))
Me.Command1.Caption = LoadResString(Int(lang & "01"))
Me.Command2.Caption = LoadResString(Int(lang & "03"))
End Sub
相关文档:
在工程中添加一个类模块,名为 Selection
然后加入以下代码:
Dim colRows As Collection
Dim ControlKey As Boolean
Public WithEvents flx As M ......
Private Sub Form_load()
'判断程序是否已经运行
If App.PrevInstance
Then
MsgBox "本程序已经运行!", vbInformation Or vbOKOnly, "提示信息"
Unload
Me
Exit Sub
&n ......
1、Private Sub Form_QueryUnload(Cancel As Integer, UnloadMode As
Integer)
Cancel = True
End Sub
2、Private Sub
Form_Unload(Cancel As Integer)
Cancel = ......
一个CommonDialog,一个CommandButton,一个PictureBOX
Option Explicit
Private Declare Function DrawIcon Lib "user32" (ByVal hdc As Long, ByVal x As Long, ByVal y As Long, ByVal hIcon As Long) As Long
Private Declare Function ExtractIcon Lib "shell32.dll" Alias "ExtractIconA" (ByVal hInst As Long, B ......
Private Declare Function ReleaseCapture Lib "user32" () As Long
Private Declare Function SendMessage Lib "user32" Alias "SendMessageA" (ByVal hwnd As Long, ByVal wMsg As Long, ByVal wParam As Long, lParam As Any) As Long
Private Const WM_NCLBUTTONDOWN = &HA1
Private Const HTCAPTION = 2
Priva ......