Switch case ,Default,run

Posted by Raja_89 under C# on 3/27/2014 | Points: 10 | Views : 419 | Status : [Member] | Replies : 2
Hai
Is it possible to run some function which is in other cases in c#
Ex:
switch (aa)

{
case 1 : Messagbox.show("a");
break;

case 2:
Messagbox.show("b");
break;
case 3
Messagbox.show("c");
break;
case 4:
Messagbox.show("d");
break;
case 5:
Messagbox.show("a");
break;
..etc
default:
//Here should run case 1,case 2,case 3,...etc
break;

}


Thanks




Responses

Posted by: Allemahesh on: 3/27/2014 [Member] [MVP] Silver | Points: 25

Up
0
Down
Can you explane more clearly?

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Antonydurai on: 4/2/2014 [Member] Starter | Points: 25

Up
0
Down
Hi,

It's not possible. if all case not match then only default is running. other wise it's not run.

Raja_89, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response