A General Dialog Box

 

The switch case Statement

The switch case statement is the construct of choice if the program must branch more than two ways at a point in the source code. For only two branches, the if statement works well. The switch case construct works like this:

 int intNumber = 2; switch( intNumber) {   case 0:     // Do something.     break;   case 1:     // Do something.     break;   case 2:     // Do something.     break;   case 3:     // Do something.     break;   default:     // Do something. } 

The default case is optional.

 


Unlocking Microsoft C# V 2.0 Programming Secrets
Unlocking Microsoft C# V 2.0 Programming Secrets (Wordware Applications Library)
ISBN: 1556220979
EAN: 2147483647
Year: 2005
Pages: 129

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net