Jaymond Flurrie
Well-known Member
- Joined
- Sep 22, 2008
- Messages
- 898
- Office Version
-
- 2016
I made a form that has a radio button pair "Suomeksi" - "In English". Now, I want my message boxes to appear in that chosen language.
How do I do that?
This is what I have done so far:
Which works fine - It does change the language of the form.
But how do I display message boxes? I tried to use
Should be pretty easy for anyone who has programmed a multi language program. The problem is probably with variable scope or so.
How do I do that?
This is what I have done so far:
Code:
Option Explicit
Public strLng As String
Private Sub optEnglish_Click()
VaihdaKieli ("Eng")
End Sub
Private Sub optFinnish_Click()
VaihdaKieli ("Fin")
End Sub
Sub VaihdaKieli(strLng As String)
If strLng = "Eng" Then
lblINI.Caption = "INI file:"
lblSource.Caption = "Source file:"
btnGet.Caption = "Get tags"
ElseIf strLng = "Fin" Then
lblINI.Caption = "INI tiedosto:"
lblSource.Caption = "Lähdetiedosto:"
btnGet.Caption = "Hae tagit"
End If
End Sub
But how do I display message boxes? I tried to use
Code:
If Not FileOrDirExists(sFName) Then
If strLng = "Eng" Then
MsgBox Title:="Error!", Buttons:=vbOKOnly + vbCritical, Prompt:="INI-file can't be found!"
Else
MsgBox Title:="Virhe!", Buttons:=vbOKOnly + vbCritical, Prompt:="INI-tiedostoa ei löydy!"
End If
Exit Sub
Else
'...the main code goes here
End If