Click here to Skip to main content
15,886,199 members
Home / Discussions / C#
   

C#

 
AnswerRe: How to geta an Event? Pin
Calla2-Sep-09 20:25
Calla2-Sep-09 20:25 
GeneralRe: How to geta an Event? Pin
Jacobb Michael2-Sep-09 23:24
Jacobb Michael2-Sep-09 23:24 
QuestionHow to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:00
dean93592-Sep-09 19:00 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Muhammad Mazhar2-Sep-09 19:08
Muhammad Mazhar2-Sep-09 19:08 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93592-Sep-09 19:55
dean93592-Sep-09 19:55 
AnswerRe: How to refresh an updated MenuStrip at runtime? Pin
Orzer2-Sep-09 21:34
Orzer2-Sep-09 21:34 
GeneralRe: How to refresh an updated MenuStrip at runtime? Pin
dean93593-Sep-09 8:20
dean93593-Sep-09 8:20 
QuestionChanging value of several comboboxes Pin
Denis J. González2-Sep-09 16:42
Denis J. González2-Sep-09 16:42 
Hi,
My situation is this, I have 3 comboboxes (drop down list only, not editable), and If the user changes the value of one of the, the other two should change too.

I have used the SelectedIndexChanged Event successfully to update the other two comboboxes. But I have 2 issues with it, first: The code is not pretty, I have to repeat the same 3 times and secondly everytime a call is made to one combobox's SelectedIndexChanged event the other are called too because I update the indexes of those too in the first call. I know it's kind of hard to understand like this, so here's what I'm doing:

private void  SubNetCountCombo_SelectedIndexChanged(System.Object sender, System.EventArgs e)
{
    HostCountCombo.SelectedIndex = SubNetCountCombo.SelectedIndex;
    newsubnetmaskcombo.SelectedIndex = SubNetCountCombo.SelectedIndex; 
}

private void  HostCountCombo_SelectedIndexChanged(object sender, System.EventArgs e)
{
    SubNetCountCombo.SelectedIndex = HostCountCombo.SelectedIndex;
    newsubnetmaskcombo.SelectedIndex = HostCountCombo.SelectedIndex; 
}
private void  newsubnetmaskcombo_SelectedIndexChanged(System.Object sender, System.EventArgs e)
{
    SubNetCountCombo.SelectedIndex = newsubnetmaskcombo.SelectedIndex;
    HostCountCombo.SelectedIndex = newsubnetmaskcombo.SelectedIndex; 
}


I thought of using a bool variable as a switch, so that everytime I enter each of those events it turns true and when it goes to the other methods I use an if to check for that variable, if it's true I just get out. But it's still not pretty... So.. I'm not sure if there's a better way of accomplishing this..

Thanks!
AnswerRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:01
protectorChristian Graus2-Sep-09 17:01 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:06
Denis J. González2-Sep-09 17:06 
GeneralRe: Changing value of several comboboxes Pin
Christian Graus2-Sep-09 17:13
protectorChristian Graus2-Sep-09 17:13 
GeneralRe: Changing value of several comboboxes Pin
Denis J. González2-Sep-09 17:24
Denis J. González2-Sep-09 17:24 
Questionhelp file Pin
AAKAra2-Sep-09 10:54
AAKAra2-Sep-09 10:54 
AnswerRe: help file Pin
Christian Graus2-Sep-09 11:22
protectorChristian Graus2-Sep-09 11:22 
AnswerRe: help file Pin
Abhishek Sur2-Sep-09 11:54
professionalAbhishek Sur2-Sep-09 11:54 
GeneralRe: help file Pin
Christian Graus2-Sep-09 13:38
protectorChristian Graus2-Sep-09 13:38 
GeneralRe: help file Pin
Abhishek Sur2-Sep-09 21:30
professionalAbhishek Sur2-Sep-09 21:30 
AnswerRe: help file Pin
N a v a n e e t h2-Sep-09 15:55
N a v a n e e t h2-Sep-09 15:55 
QuestionDate Format in C# Pin
skhan172-Sep-09 10:20
skhan172-Sep-09 10:20 
AnswerRe: Date Format in C# Pin
Christian Graus2-Sep-09 11:25
protectorChristian Graus2-Sep-09 11:25 
AnswerRe: Date Format in C# Pin
Abhishek Sur2-Sep-09 11:47
professionalAbhishek Sur2-Sep-09 11:47 
Questionurgent: has anyone used mcore? Pin
maham siddiqui2-Sep-09 8:14
maham siddiqui2-Sep-09 8:14 
AnswerRe: urgent: has anyone used mcore? Pin
Dave Kreskowiak2-Sep-09 8:35
mveDave Kreskowiak2-Sep-09 8:35 
GeneralRe: urgent: has anyone used mcore? Pin
maham siddiqui2-Sep-09 9:23
maham siddiqui2-Sep-09 9:23 
AnswerRe: urgent: has anyone used mcore? Pin
Manas Bhardwaj2-Sep-09 9:12
professionalManas Bhardwaj2-Sep-09 9: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.