| | |
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: 66
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
- Updated : Simple ASP.Net Login Page (ASP.NET)
- Word Association Game (Posting Games)
- 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 |
Tag cloud for VB.NET
.net .net2008 2005 2008 access account application arithmetic array arrays basic bing button buttons c# center check checkbox code convert crystalreport data database datagrid datagridview date dissertation dissertations dropdownlist excel fade file-dialog filter ftp generatetags google gridview hardcopy images inline input insert intel internet listview mobile monitor ms net networking objects output panel passingparameters picturebox picturebox1 port position print printing problem project read remove save searchbox searchvb.net select serial shutdown soap sorting survey table tcp temperature text textbox timer timespan toolbox trim update user validation vb vb.net vb.netformclosing()eventpictureboxmessagebox vb2008 vbnet view visual visualbasic visualbasic.net visualstudio2008 web webbrowser winforms wpf year





