| | |
Globalization
Please support our VB.NET advertiser: Intel Parallel Studio Home
Thread Solved |
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
I have made two resource files,named
1)Form1.en-US.resx
Name Value
Button1.Text English
2)Form1.fr-FR.resx
Name Value
Button1.Text France
My Code is as Under-
But the Button1 text is not changing.Can Somebody tell where i m wrong?
1)Form1.en-US.resx
Name Value
Button1.Text English
2)Form1.fr-FR.resx
Name Value
Button1.Text France
My Code is as Under-
VB.NET Syntax (Toggle Plain Text)
Imports System.Globalization Imports System.Threading Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ci As CultureInfo Dim aL As New ArrayList() For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures) ComboBox1.Items.Add(ci.Name) Next ci End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim lang As String lang = ComboBox1.SelectedItem Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang) 'Changes the Language End Sub End Class
But the Button1 text is not changing.Can Somebody tell where i m wrong?
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
I have made two resource files,named Under the folder MyResources & mine project Name Language
1)myres.en-US.resx
Name Value
Button1.Text English
2)myres.fr-FR.resx
Name Value
Button1.Text France
My Code is as Under
But the Button1 text is not changing.Insted Error is there--Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Lnaguage.MyLocalResources.myRes.resources" was correctly embedded .
Can Somebody help me!!!!!!!!!!!
1)myres.en-US.resx
Name Value
Button1.Text English
2)myres.fr-FR.resx
Name Value
Button1.Text France
My Code is as Under
VB.NET Syntax (Toggle Plain Text)
Imports System.Globalization Imports System.Threading Imports System.Resources Imports System.IO Imports System.Reflection Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ci As CultureInfo Dim aL As New ArrayList() For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures) ComboBox1.Items.Add(ci.Name) Next ci End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim lang As String Dim rm As ResourceManager lang = ComboBox1.SelectedItem ' Thread.CurrentThread.CurrentCulture = New CultureInfo(lang) 'Changes the Language Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang) 'Changes the Language rm = New ResourceManager("Language.MyLocalResources.myRes", Assembly.GetExecutingAssembly()) Button1.Text = rm.GetString("Button1.Text") End Sub End Class
But the Button1 text is not changing.Insted Error is there--Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Lnaguage.MyLocalResources.myRes.resources" was correctly embedded .
Can Somebody help me!!!!!!!!!!!
•
•
Join Date: Jul 2008
Posts: 65
Reputation:
Solved Threads: 6
•
•
•
•
I have made two resource files,named Under the folder MyResources & mine project Name Language
1)myres.en-US.resx
Name Value
Button1.Text English
2)myres.fr-FR.resx
Name Value
Button1.Text France
My Code is as Under
VB.NET Syntax (Toggle Plain Text)
Imports System.Globalization Imports System.Threading Imports System.Resources Imports System.IO Imports System.Reflection Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ci As CultureInfo Dim aL As New ArrayList() For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures) ComboBox1.Items.Add(ci.Name) Next ci End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim lang As String Dim rm As ResourceManager lang = ComboBox1.SelectedItem ' Thread.CurrentThread.CurrentCulture = New CultureInfo(lang) 'Changes the Language Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang) 'Changes the Language rm = New ResourceManager("Language.MyLocalResources.myRes", Assembly.GetExecutingAssembly()) Button1.Text = rm.GetString("Button1.Text") End Sub End Class
But the Button1 text is not changing.Insted Error is there--Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "Lnaguage.MyLocalResources.myRes.resources" was correctly embedded .
Can Somebody help me!!!!!!!!!!!
hi
actualy u r adding mulilang files into project under resources folder. u need add bin/debug/resources/ here u have to create the textfile.not resouces file
•
•
Join Date: Mar 2008
Posts: 324
Reputation:
Solved Threads: 7
THX I Solved it....SOLUTION--
Resource File Names-
Resource.en-US.resx
Resource.fr-FR.resx
VB.NET Syntax (Toggle Plain Text)
Imports System.Globalization Imports System.Threading Imports System.Resources Imports System.IO Imports System.Reflection Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load Dim ci As CultureInfo Dim aL As New ArrayList() For Each ci In CultureInfo.GetCultures(CultureTypes.SpecificCultures) ComboBox1.Items.Add(ci.Name) Next ci End Sub Private Sub ComboBox1_SelectedIndexChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox1.SelectedIndexChanged Dim lang As String Dim rm As ResourceManager lang = ComboBox1.SelectedItem 'IIND Thread.CurrentThread.CurrentUICulture = New CultureInfo(lang) rm = New ResourceManager("Lnaguage.Resource", Assembly.GetExecutingAssembly()) Button1.Text = rm.GetString("Button1") End Sub End Class
Resource File Names-
Resource.en-US.resx
Resource.fr-FR.resx
![]() |
Similar Threads
- Word Association Game (Posting Games)
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Custom error checking (C#)
- Help me in username and password validation through accessing the database (ASP.NET)
- Why app is looking for "Default.aspx" (ASP.NET)
- Forms authorization, only want a few links (ASP.NET)
- Help! What Language is this? (Assembly)
- Students saying no to computer science (IT Professionals' Lounge)
- Company Website (Website Reviews)
Other Threads in the VB.NET Forum
- Previous Thread: textchanged event help
- Next Thread: inserting text at cursor
| Thread Tools | Search this Thread |
"crystal .net .net2005 30minutes 2005 2008 access account arithmetic array assignment basic binary bing button buttons center check code combobox component connectionstring convert crystalreport data database databasesearch datagrid datagridview design dissertation dissertations dissertationthesis dosconsolevb.net dropdownlist excel file-dialog firewall folder ftp google hardcopy image images insert isnumericfuntioncall listview login math memory mobile ms navigate net networking opacity output passingparameters peertopeervideostreaming picturebox picturebox1 port print problemwithinstallation project reports" save savedialog searchbox serial soap sorting string table tcp temp text textbox timer toolbox trim update updown upload useraccounts usercontrol vb vb.net vb.netcode vb.netformclosing()eventpictureboxmessagebox vb.nettoolboxvisualbasic2008sidebar vb2008 vbnet view visual visualbasic visualbasic.net visualstudio web wpf





