?? form1.frm
字號:
VERSION 5.00
Begin VB.Form Form1
BorderStyle = 3 'Fixed Dialog
Caption = "語言轉換實例"
ClientHeight = 2775
ClientLeft = 4335
ClientTop = 5070
ClientWidth = 3480
LinkTopic = "Form1"
MaxButton = 0 'False
MinButton = 0 'False
ScaleHeight = 2775
ScaleWidth = 3480
ShowInTaskbar = 0 'False
Begin VB.OptionButton Option2
Caption = "英文"
Height = 375
Left = 1920
TabIndex = 8
Top = 1080
Width = 975
End
Begin VB.Frame Frame1
Caption = "設置語言:"
Height = 1215
Left = 120
TabIndex = 3
Top = 960
Width = 3255
Begin VB.OptionButton Option1
Caption = "中文"
Height = 195
Left = 360
TabIndex = 7
Top = 240
Width = 975
End
Begin VB.CommandButton Command4
Caption = "還原默認值"
Height = 375
Left = 1680
TabIndex = 5
Top = 720
Width = 1215
End
Begin VB.CommandButton Command3
Caption = "保存設置"
Height = 375
Left = 240
TabIndex = 4
Top = 720
Width = 975
End
End
Begin VB.CommandButton Command2
Caption = "英文"
Height = 375
Left = 1920
TabIndex = 1
Top = 0
Width = 735
End
Begin VB.CommandButton Command1
Caption = "中文"
Height = 375
Left = 720
TabIndex = 0
Top = 0
Width = 735
End
Begin VB.Label Label2
Height = 255
Left = 720
TabIndex = 6
Top = 600
Width = 1935
End
Begin VB.Label Label1
Caption = "語言轉換實例,制作:羅文威"
Height = 255
Left = 240
TabIndex = 2
Top = 2400
Width = 2535
End
Begin VB.Menu file
Caption = "文件"
Begin VB.Menu newfile
Caption = "新建"
End
Begin VB.Menu openfile
Caption = "打開"
End
Begin VB.Menu save
Caption = "保存"
End
Begin VB.Menu sav
Caption = "另存為"
End
Begin VB.Menu quit
Caption = "退出"
End
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
'********************************************************
'我是一個VB的初學者,這個完全是自己構思寫代碼的,
'羅文威 QQ:150258019 有興趣的加我交流一下,共同進步
'*********************************************************
Private Declare Function GetPrivateProfileString Lib "kernel32" Alias "GetPrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpDefault As String, ByVal lpReturnedString As String, ByVal nSize As Long, ByVal lpFileName As String) As Long
Private Declare Function WritePrivateProfileString Lib "kernel32" Alias "WritePrivateProfileStringA" (ByVal lpApplicationName As String, ByVal lpKeyName As Any, ByVal lpString As Any, ByVal lpFileName As String) As Long
Dim lpReturnedString1 As String * 6
Dim lpReturnedString2 As String * 12
Dim lpReturnedString3 As String * 6
Dim lpReturnedString4 As String * 6
Dim lpReturnedString5 As String * 6
Dim lpReturnedString6 As String * 6
Dim getsavelanguage As String * 8
Private Sub Command1_Click()
changelanguagechinese
Label2.Caption = "現在的語言環境是中文"
End Sub
Private Sub Command2_Click()
changelanguageenglish
Label2.Caption = "現在的語言環境是英文"
End Sub
Sub changelanguageenglish()
GetPrivateProfileString "英文語言包", "文件", "", lpReturnedString1, 6, App.Path + "\english.ini"
GetPrivateProfileString "英文語言包", "新建", "", lpReturnedString2, 12, App.Path + "\english.ini"
GetPrivateProfileString "英文語言包", "打開", "", lpReturnedString3, 6, App.Path + "\english.ini"
GetPrivateProfileString "英文語言包", "保存", "", lpReturnedString4, 6, App.Path + "\english.ini"
GetPrivateProfileString "英文語言包", "另存為", "", lpReturnedString5, 6, App.Path + "\english.ini"
GetPrivateProfileString "英文語言包", "退出", "", lpReturnedString6, 6, App.Path + "\english.ini"
file.Caption = (Trim(lpReturnedString1))
newfile.Caption = (Trim(lpReturnedString2))
openfile.Caption = (Trim(lpReturnedString3))
save.Caption = (Trim(lpReturnedString4))
sav.Caption = (Trim(lpReturnedString5))
quit.Caption = (Trim(lpReturnedString6))
End Sub
Sub changelanguagechinese()
GetPrivateProfileString "中文語言包", "文件", "", lpReturnedString1, 6, App.Path + "\chinese.ini"
GetPrivateProfileString "中文語言包", "新建", "", lpReturnedString2, 12, App.Path + "\chinese.ini"
GetPrivateProfileString "中文語言包", "打開", "", lpReturnedString3, 6, App.Path + "\chinese.ini"
GetPrivateProfileString "中文語言包", "保存", "", lpReturnedString4, 6, App.Path + "\chinese.ini"
GetPrivateProfileString "中文語言包", "另存為", "", lpReturnedString5, 6, App.Path + "\chinese.ini"
GetPrivateProfileString "中文語言包", "退出", "", lpReturnedString6, 6, App.Path + "\chinese.ini"
file.Caption = (Trim(lpReturnedString1))
newfile.Caption = (Trim(lpReturnedString2))
openfile.Caption = (Trim(lpReturnedString3))
save.Caption = (Trim(lpReturnedString4))
sav.Caption = (Trim(lpReturnedString5))
quit.Caption = (Trim(lpReturnedString6))
End Sub
Private Sub Command3_Click()
If Option1.Value = True Then
WritePrivateProfileString "main", "語言設置", "0", App.Path + "\saveset.ini"
Else
WritePrivateProfileString "main", "語言設置", "1", App.Path + "\saveset.ini"
End If
End Sub
Private Sub Form_Load()
GetPrivateProfileString "main", "語言設置", "", getsavelanguage, 8, App.Path + "\saveset.ini"
Dim temp As Integer
temp = CInt(Trim(getsavelanguage))
If temp = 0 Then
Option1.Value = True
changelanguagechinese
Label2.Caption = "現在的語言環境是中文"
Else
If temp = 1 Then
Option2.Value = True
changelanguageenglish
Label2.Caption = "現在的語言環境是英文"
End If
End If
End Sub
Private Sub newfile_Click()
MsgBox ("這是新建")
End Sub
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -