Click here to Skip to main content
15,914,416 members
Home / Discussions / C#
   

C#

 
GeneralRe: Access Modifier, protect child classes constructor Pin
DaveyM698-Jan-09 2:46
professionalDaveyM698-Jan-09 2:46 
QuestionCombo Box Text when working in multilingual program Pin
belzer7-Jan-09 9:41
belzer7-Jan-09 9:41 
AnswerRe: Combo Box Text when working in multilingual program Pin
CPallini7-Jan-09 9:54
mveCPallini7-Jan-09 9:54 
GeneralRe: Combo Box Text when working in multilingual program Pin
belzer7-Jan-09 9:59
belzer7-Jan-09 9:59 
AnswerRe: Combo Box Text when working in multilingual program Pin
Rutvik Dave7-Jan-09 10:07
professionalRutvik Dave7-Jan-09 10:07 
GeneralRe: Combo Box Text when working in multilingual program Pin
belzer7-Jan-09 10:10
belzer7-Jan-09 10:10 
GeneralRe: Combo Box Text when working in multilingual program Pin
Colin Angus Mackay7-Jan-09 10:16
Colin Angus Mackay7-Jan-09 10:16 
AnswerRe: Combo Box Text when working in multilingual program Pin
Colin Angus Mackay7-Jan-09 10:13
Colin Angus Mackay7-Jan-09 10:13 
What you can do is create a small object to store your cultural value and your invarient (culture neutral) value.

public class GlobalisedItem
{
    public string DisplayValue { get; set; }
    public string InvarientValue { get; set; }
    public override string ToString()
    {
        return DisplayValue;
    }
}

The override for ToString() is necessary so that the ComboBox displays what you want it to display.

Then when you populate your ComboBox you can do something like this:
GlobalisedItem[] items = new GlobalisedItem[3];
items[0] = new GlobalisedItem { DisplayValue = "Uno", InvarientValue = "One" };
items[1] = new GlobalisedItem { DisplayValue = "Dos", InvarientValue = "Two" };
items[2] = new GlobalisedItem { DisplayValue = "Tres", InvarientValue = "Three" };
comboBox1.Items.AddRange(items);


Finally, when you are examining the SelectedItem you can do this:
label1.Text = ((GlobalisedItem)comboBox1.SelectedItem).InvarientValue;


Basically (GlobalisedItem)comboBox1.SelectedItem takes the selected item and then casts it back into the object that you had in the first place. Then it calls InvarientValue which can be your culture neutral value. It doesn't have to be a string, it can be anything you like really.

Does this help?

* Developer Day Scotland 2 - Free community conference
* The Blog of Colin Angus Mackay


Vogon Building and Loan advise that your planet is at risk if you do not keep up repayments on any mortgage secured upon it. Please remember that the force of gravity can go up as well as down.

GeneralRe: Combo Box Text when working in multilingual program Pin
belzer7-Jan-09 10:17
belzer7-Jan-09 10:17 
AnswerRe: Combo Box Text when working in multilingual program Pin
DaveyM697-Jan-09 10:16
professionalDaveyM697-Jan-09 10:16 
GeneralRe: Combo Box Text when working in multilingual program Pin
Luc Pattyn7-Jan-09 10:41
sitebuilderLuc Pattyn7-Jan-09 10:41 
QuestionSqlDataAdapter.Fill Pin
CodingYoshi7-Jan-09 8:37
CodingYoshi7-Jan-09 8:37 
AnswerRe: SqlDataAdapter.Fill Pin
Wendelius7-Jan-09 8:45
mentorWendelius7-Jan-09 8:45 
GeneralRe: SqlDataAdapter.Fill Pin
CodingYoshi7-Jan-09 9:51
CodingYoshi7-Jan-09 9:51 
GeneralRe: SqlDataAdapter.Fill Pin
Wendelius7-Jan-09 10:06
mentorWendelius7-Jan-09 10:06 
GeneralRe: SqlDataAdapter.Fill Pin
CodingYoshi7-Jan-09 10:22
CodingYoshi7-Jan-09 10:22 
GeneralRe: SqlDataAdapter.Fill Pin
Wendelius7-Jan-09 10:29
mentorWendelius7-Jan-09 10:29 
GeneralRe: SqlDataAdapter.Fill Pin
Dave Kreskowiak7-Jan-09 10:46
mveDave Kreskowiak7-Jan-09 10:46 
GeneralRe: SqlDataAdapter.Fill Pin
Rutvik Dave7-Jan-09 10:15
professionalRutvik Dave7-Jan-09 10:15 
AnswerRe: SqlDataAdapter.Fill Pin
Le centriste8-Jan-09 3:37
Le centriste8-Jan-09 3:37 
QuestionC# launches another program Pin
ipstefan7-Jan-09 8:29
ipstefan7-Jan-09 8:29 
AnswerRe: C# launches another program Pin
Dave Kreskowiak7-Jan-09 10:08
mveDave Kreskowiak7-Jan-09 10:08 
AnswerRe: C# launches another program Pin
Dragonfly_Lee7-Jan-09 19:53
Dragonfly_Lee7-Jan-09 19:53 
AnswerRe: C# launches another program Pin
Pritam Karmakar7-Jan-09 21:45
Pritam Karmakar7-Jan-09 21:45 
GeneralRe: C# launches another program Pin
ipstefan8-Jan-09 0:12
ipstefan8-Jan-09 0:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.