Question : if statement in C#

I have statement in visual basic
if me.combo1 = "123451" Then
me.TextBox2 = "LCAB13"
else if me.combo = "1456525" Then
me.TextBox2 = "AEC125"       etc.......
Can I write a similar statement in C# with combo box and textbox?
thank you

Answer : if statement in C#

Hi,

yes you can write it like this,



1:
2:
3:
4:
5:
6:
7:
8:
if(this.combo1.SelectedValue == "123451")
{
   this.TextBox2.Text = "LCAB13";
}
else if(this.combo1.SelectedValue == "1456525")
{
   this.TextBox2.Text ="AEC125";
}
Random Solutions  
 
programming4us programming4us