Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
P

PranavThakur

@PranavThakur
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • GridView Sorting
    P PranavThakur

    Hi, I was trying to sort a GridView programitically but my code is throwing an System.StackOverflowException.Please have a look at the code below and reply what wrong I m doing. protected void GridView2_Sorting(object sender, GridViewSortEventArgs e) { GridView2.Sort("CarrierCode", SortDirection.Descending); } CarrierCode is the name of a column above. Thanks.

    ASP.NET algorithms

  • Setting Labels text specific to the current system culture .
    P PranavThakur

    I am using the concept of satellite assembly in my application.I have created two satellite assemblies as Satellite.fr-FR.resources.dll and Satellite.en-US.resources.dll for french and english respectively. I have initialize resource manager as:- ResourceManager rm = new ResourceManager("Satellite." + System.Globalization.CultureInfo.CurrentCulture.Name, Assembly.GetExecutingAssembly()); From the above code the application automatically detects the current culture of the system.Depending on the current culture I am setting the labels text on a form like this:- private void button1_Click(object sender, EventArgs e) { SetText(this); } void SetText(Control ctl) { string text = rm.GetString(ctl.Name); if (text != null) ctl.Text = text; foreach (Control ctl1 in ctl.Controls) { SetText(ctl1); } } I am trying to find out a way by which my application set the Labels text itself when ever the system language changes. I mean i want to get rid of SetText() method written above.Is there any way by which I don't have to write any method like SetText() for setting all my controls text.If any one has any idea then please let me know. Thanks.

    C# learning

  • Calling SatelliteAssembly in C#.NET
    P PranavThakur

    Going little ahead with the same topic(Satellite assembly),i have to upgrade my code. I have initialize resource manager as:- ResourceManager rm = new ResourceManager("Satellite." + System.Globalization.CultureInfo.CurrentCulture.Name, Assembly.GetExecutingAssembly()); From the above code the application automatically detects the current culture of the system.Depending on the current culture I am setting the labels text on a form like this:- private void button1_Click(object sender, EventArgs e) { SetText(this); } void SetText(Control ctl) { string text = rm.GetString(ctl.Name); if (text != null) ctl.Text = text; foreach (Control ctl1 in ctl.Controls) { SetText(ctl1); } } I am trying to find out a way by which my application set the Labels text itself when ever the system language changes. I mean i want to get rid of SetText() method written above.Is there any way by which I don't have to write any method like SetText() for setting all my controls text.If you have any idea then please let me know. Thanks.

    C# csharp learning

  • Calling SatelliteAssembly in C#.NET
    P PranavThakur

    Thanks for your reply.Now i need to assigned ResourceManager instance only once.

    modified on Wednesday, December 05, 2007 5:26:42 AM

    C# csharp learning

  • Calling SatelliteAssembly in C#.NET
    P PranavThakur

    Hi, I have created two different satellite assemblies corresponding to two languages specific resource files -english and french.I am calling these assemblies on the basis of the language selected from the combobox and changing the label text.Please refer to the code below:- private void comboBox1_SelectedValueChanged(object sender, EventArgs e) { try { ResourceManager rm = null; if (comboBox1.Text == "English") { rm = new ResourceManager("Satellite.en-US", Assembly.GetExecutingAssembly()); label1.Text = rm.GetString("String1"); } else if (comboBox1.Text == "French") { rm = new ResourceManager("Satellite.fr-FR", Assembly.GetExecutingAssembly()); label1.Text = rm.GetString("String1"); } } catch (Exception Ex) { MessageBox.Show(Ex.Message); } } The above code works fine and the label text is getting changed according the language selected.But I don't want to do this: rm = new ResourceManager("Satellite.en-US", Assembly.GetExecutingAssembly()); I want, .NET to detect the current culture of the system and refer the required dll.If the current culture is french then .NET should refer the french dll automatically.Is there any way to do this task.Actually in future if any new language is added then there is no need to add anything in the code.

    C# csharp learning
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups