Click here to Skip to main content
15,899,124 members
Home / Discussions / C#
   

C#

 
GeneralRe: LookupEdit of DevExpress Pin
nps_ltv18-Dec-05 14:36
nps_ltv18-Dec-05 14:36 
GeneralRe: LookupEdit of DevExpress Pin
AETaylor18-Dec-05 19:37
AETaylor18-Dec-05 19:37 
QuestionGet active window title Pin
ricny04616-Dec-05 11:50
ricny04616-Dec-05 11:50 
AnswerRe: Get active window title Pin
g00fyman16-Dec-05 15:27
g00fyman16-Dec-05 15:27 
AnswerRe: Get active window title Pin
Jared Parsons17-Dec-05 10:59
Jared Parsons17-Dec-05 10:59 
AnswerRe: Get active window title Pin
S. Senthil Kumar18-Dec-05 2:13
S. Senthil Kumar18-Dec-05 2:13 
GeneralRe: Get active window title Pin
Jared Parsons18-Dec-05 8:45
Jared Parsons18-Dec-05 8:45 
QuestionChanging the selection of a combobox based off what was selected Pin
SeanCM16-Dec-05 11:39
SeanCM16-Dec-05 11:39 
Hi,

I am trying to change the selection of a combobox but am unable to do so, or that is to say I am unable to figure out what event I need to use or how to do it properly...perhaps a more detailed explanation will suffice.

I have some items in my combobox like:
Item A (1)
Item B (2)
Item C (43)
Item D (57)

When the user selects one I want to place the number that is in parens in combobox.Text.

The problem is I can't seem to figure out how to do this. I used the event SelectedValueChanged but as soon as the event is done, the picked value goes in. Here is the code:

private void _cbo_SelectedValueChanged(object sender, System.EventArgs e)
{
   int index1 = _cbo.Text.IndexOf("(") + 1;
   int index2 = _cbo.Text.IndexOf(")");
   _cbo.Text = _cbo.Text.Substring(index1, index2 - index1);
}


The code works I see the text in the combobox but then it is replaced with what the user selected again.

Any help would be greatly appreciated.

Sean
AnswerRe: Changing the selection of a combobox based off what was selected Pin
TheGreatAndPowerfulOz16-Dec-05 11:49
TheGreatAndPowerfulOz16-Dec-05 11:49 
GeneralRe: Changing the selection of a combobox based off what was selected Pin
SeanCM2-Jan-06 19:42
SeanCM2-Jan-06 19:42 
Questionhide printers visible in PrintDialog Pin
cobra200516-Dec-05 11:19
cobra200516-Dec-05 11:19 
AnswerRe: hide printers visible in PrintDialog Pin
Dave Kreskowiak17-Dec-05 8:24
mveDave Kreskowiak17-Dec-05 8:24 
Questionfirst frame of video Pin
munmat16-Dec-05 11:13
munmat16-Dec-05 11:13 
QuestionEscape sequence in xml output? Pin
pankazmittal16-Dec-05 11:01
pankazmittal16-Dec-05 11:01 
AnswerRe: Escape sequence in xml output? Pin
Nish Nishant16-Dec-05 11:13
sitebuilderNish Nishant16-Dec-05 11:13 
GeneralRe: Escape sequence in xml output? Pin
pankazmittal16-Dec-05 11:18
pankazmittal16-Dec-05 11:18 
AnswerRe: Escape sequence in xml output? Pin
TheGreatAndPowerfulOz16-Dec-05 11:14
TheGreatAndPowerfulOz16-Dec-05 11:14 
AnswerRe: Escape sequence in xml output? Pin
Guffa16-Dec-05 11:22
Guffa16-Dec-05 11:22 
AnswerRe: Escape sequence in xml output? Pin
Curtis Schlak.16-Dec-05 11:29
Curtis Schlak.16-Dec-05 11:29 
QuestionRe: Escape sequence in xml output? Pin
pankazmittal16-Dec-05 11:45
pankazmittal16-Dec-05 11:45 
AnswerRe: Escape sequence in xml output? Pin
Curtis Schlak.16-Dec-05 12:01
Curtis Schlak.16-Dec-05 12:01 
QuestionListView Color Pin
dbetting16-Dec-05 10:17
dbetting16-Dec-05 10:17 
AnswerRe: ListView Color Pin
Jared Parsons16-Dec-05 11:16
Jared Parsons16-Dec-05 11:16 
GeneralRe: ListView Color Pin
dbetting16-Dec-05 17:57
dbetting16-Dec-05 17:57 
Questiondatagrid cell issue Pin
melanieab16-Dec-05 10:05
melanieab16-Dec-05 10:05 

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.