Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question
Message
De
06/07/2010 08:55:32
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Newbie question
Versions des environnements
Environment:
C# 3.0
Divers
Thread ID:
01471507
Message ID:
01471507
Vues:
128
Here's a newbie C#

I could write the code below in a few lines in VFP

This isn't so bad but now now I have a similar situation with 52 values

What's the best way to do this in VS 2008? (not VS 2010)
 switch (column)
        {
        case 0:
          textBoxColumn1.Text = stack[column, row].ToString();
          textBoxColumn1.ForeColor = textboxforecolor; 
          break;
        case 1: 
           textBoxColumn2.Text = stack[column, row].ToString();
           textBoxColumn2.ForeColor = textboxforecolor; 
          break;
        case 2:
          textBoxColumn3.Text = stack[column, row].ToString();
          textBoxColumn3.ForeColor = textboxforecolor; 
           break;
        case 3:
          textBoxColumn4.Text = stack[column, row].ToString();
          textBoxColumn4.ForeColor = textboxforecolor; 
   
          break;
        case 4:
          textBoxColumn5.Text = stack[column, row].ToString();
          textBoxColumn5.ForeColor = textboxforecolor; 
   
          break;
        case 5:
          textBoxColumn6.Text = stack[column, row].ToString();
          textBoxColumn6.ForeColor = textboxforecolor; 
          break;
        case 6:
          textBoxColumn7.Text = stack[column, row].ToString();
          textBoxColumn7.ForeColor = textboxforecolor; 
         break; 
        } 
     
Anyone who does not go overboard- deserves to.
Malcolm Forbes, Sr.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform