OFGemini
asked on
Change the language of an exceptions message
How can I change the language of an exception's messsage?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
What operating system? Do you have multi-language packs installed?
Bob
Bob
ASKER
I use winXP pro. How can I tell if I have multi-language packs installed?
I am not sure how Windows XP works with languages, but you might be able to check on the regional control panel applet.
Bob
Bob
ASKER
I tried setting CurrentCulture and CurrentUICulture but I'm still gettting english for my exception's message. What am I missing here?
Here is the code:
Imports System.Globalization
Public Class Form2
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim Spanish As CultureInfo = CultureInfo.CreateSpecific
System.Threading.Thread.Cu
System.Threading.Thread.Cu
Try
Throw New DivideByZeroException
Catch ex As Exception
'I want this message to change language.
MsgBox(ex.Message)
End Try
End Sub
End Class