Click here to Skip to main content
15,913,722 members
Home / Discussions / C#
   

C#

 
GeneralRe: Programmatically getting system information using C# Pin
Cadence2.016-Jun-06 9:35
Cadence2.016-Jun-06 9:35 
QuestionComboBox Databinding Pin
Drew McGhie16-Jun-06 7:32
Drew McGhie16-Jun-06 7:32 
QuestionWord interop problem Pin
Amos_Keeto16-Jun-06 7:10
Amos_Keeto16-Jun-06 7:10 
AnswerRe: Word interop problem Pin
Dustin Metzgar16-Jun-06 7:57
Dustin Metzgar16-Jun-06 7:57 
GeneralRe: Word interop problem Pin
Amos_Keeto16-Jun-06 8:02
Amos_Keeto16-Jun-06 8:02 
GeneralRe: Word interop problem Pin
Dustin Metzgar16-Jun-06 8:11
Dustin Metzgar16-Jun-06 8:11 
GeneralRe: Word interop problem Pin
Amos_Keeto17-Jun-06 0:41
Amos_Keeto17-Jun-06 0:41 
QuestionIs there a way to consolidate this? Pin
Blubbo16-Jun-06 6:47
Blubbo16-Jun-06 6:47 
This code below is pretty long. Wonder if its possible to shorten the code?
the sender would be the combo box... I have 7 comboboxes on the window as part for Filtering the data from the raw data and the cbMath<x> comboboxes are independent.
Can anyone make any suggestion?

#region private void cbMath_IndexChanged(object sender, System.EventArgs e)
private void cbMath_IndexChanged(object sender, System.EventArgs e)
{
ComboBox cb = (ComboBox)sender;

switch (cb.Name.ToString())
{
case "cbMathA":
{
if (this.numericUpDownAL.Visible && this.cbMathA.Text == "Range")
{
this.numericUpDownAR.Visible = true;
}
else
{
this.numericUpDownAR.Visible = false;
}

if (this.dateTimePickerAL.Visible && this.cbMathA.Text == "Range")
{
this.dateTimePickerAR.Visible = true;
}
else
{
this.dateTimePickerAR.Visible = false;
}
break;
}

case "cbMathB":
{
if (this.numericUpDownBL.Visible && this.cbMathB.Text == "Range")
{
this.numericUpDownBR.Visible = true;
}
else
{
this.numericUpDownBR.Visible = false;
}

if (this.dateTimePickerBL.Visible && this.cbMathB.Text == "Range")
{
this.dateTimePickerBR.Visible = true;
}
else
{
this.dateTimePickerBR.Visible = false;
}
break;
}

case "cbMathC":
{
if (this.numericUpDownCL.Visible && this.cbMathC.Text == "Range")
{
this.numericUpDownCR.Visible = true;
}
else
{
this.numericUpDownCR.Visible = false;
}

if (this.dateTimePickerCL.Visible && this.cbMathC.Text == "Range")
{
this.dateTimePickerCR.Visible = true;
}
else
{
this.dateTimePickerCR.Visible = false;
}
break;
}

case "cbMathD":
{
if (this.numericUpDownDL.Visible && this.cbMathD.Text == "Range")
{
this.numericUpDownDR.Visible = true;
}
else
{
this.numericUpDownDR.Visible = false;
}

if (this.dateTimePickerDL.Visible && this.cbMathD.Text == "Range")
{
this.dateTimePickerDR.Visible = true;
}
else
{
this.dateTimePickerDR.Visible = false;
}
break;
}

case "cbMathE":
{
if (this.numericUpDownEL.Visible && this.cbMathE.Text == "Range")
{
this.numericUpDownER.Visible = true;
}
else
{
this.numericUpDownER.Visible = false;
}

if (this.dateTimePickerEL.Visible && this.cbMathE.Text == "Range")
{
this.dateTimePickerER.Visible = true;
}
else
{
this.dateTimePickerER.Visible = false;
}
break;
}

case "cbMathF":
{
if (this.numericUpDownFL.Visible && this.cbMathF.Text == "Range")
{
this.numericUpDownFR.Visible = true;
}
else
{
this.numericUpDownFR.Visible = false;
}

if (this.dateTimePickerFL.Visible && this.cbMathF.Text == "Range")
{
this.dateTimePickerFR.Visible = true;
}
else
{
this.dateTimePickerFR.Visible = false;
}
break;
}

case "cbMathG":
{
if (this.numericUpDownGL.Visible && this.cbMathG.Text == "Range")
{
this.numericUpDownGR.Visible = true;
}
else
{
this.numericUpDownGR.Visible = false;
}

if (this.dateTimePickerGL.Visible && this.cbMathG.Text == "Range")
{
this.dateTimePickerGR.Visible = true;
}
else
{
this.dateTimePickerGR.Visible = false;
}
break;
}
default: return;
}
}
AnswerRe: Is there a way to consolidate this? Pin
Dustin Metzgar16-Jun-06 7:09
Dustin Metzgar16-Jun-06 7:09 
GeneralRe: Is there a way to consolidate this? Pin
RonBou16-Jun-06 7:19
RonBou16-Jun-06 7:19 
GeneralRe: Is there a way to consolidate this? Pin
RonBou16-Jun-06 7:33
RonBou16-Jun-06 7:33 
GeneralRe: Is there a way to consolidate this? Pin
Guffa16-Jun-06 8:41
Guffa16-Jun-06 8:41 
GeneralRe: Is there a way to consolidate this? [modified] Pin
Robert Rohde16-Jun-06 9:32
Robert Rohde16-Jun-06 9:32 
GeneralRe: Is there a way to consolidate this? [modified] Pin
Blubbo16-Jun-06 9:48
Blubbo16-Jun-06 9:48 
GeneralRe: Is there a way to consolidate this? Pin
Guffa16-Jun-06 10:07
Guffa16-Jun-06 10:07 
GeneralRe: Is there a way to consolidate this? Pin
Robert Rohde16-Jun-06 10:21
Robert Rohde16-Jun-06 10:21 
QuestionMAC Address Pin
moro14516-Jun-06 6:40
moro14516-Jun-06 6:40 
AnswerRe: MAC Address [modified] Pin
Ravi Bhavnani16-Jun-06 6:52
professionalRavi Bhavnani16-Jun-06 6:52 
GeneralRe: MAC Address Pin
moro14516-Jun-06 8:17
moro14516-Jun-06 8:17 
AnswerRe: MAC Address Pin
Ravi Bhavnani16-Jun-06 8:25
professionalRavi Bhavnani16-Jun-06 8:25 
GeneralRe: MAC Address Pin
moro14516-Jun-06 9:48
moro14516-Jun-06 9:48 
AnswerRe: MAC Address Pin
Ravi Bhavnani16-Jun-06 9:55
professionalRavi Bhavnani16-Jun-06 9:55 
GeneralRe: MAC Address Pin
moro14516-Jun-06 10:23
moro14516-Jun-06 10:23 
AnswerRe: MAC Address Pin
bob1697216-Jun-06 6:56
bob1697216-Jun-06 6:56 
GeneralRe: MAC Address Pin
moro14516-Jun-06 8:12
moro14516-Jun-06 8: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.