Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Passing properies as parameter
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
01146810
Message ID:
01147225
Vues:
22
Hi Richard,

If I understand you correctly, you could use something like this:
	public partial class Form1 : Form
	{
		TextBox[][] Rack;

		public Form1()
		{
			InitializeComponent();
			Rack = new TextBox[][] {
			new TextBox[] {textBoxAA, textBoxAB, textBoxAC, textBoxAD },
			new TextBox[] {textBoxBA, textBoxBB, textBoxBC, textBoxBD },
			new TextBox[] {textBoxCA, textBoxCB, textBoxCC, textBoxCD }
		};
		}

		private void button1_Click(object sender, EventArgs e)
		{
			ProcessRack(2);
		}

		void ProcessRack(int nr)
		{
			for (int box = 0; box < Rack[nr].Length-1; box++)
			{
				Rack[nr][box].Text = "Processed: " + box.ToString();
			}
		}
	}
ProcessRack receives the line (0=AA-AD, 1=BA-BD, 2=CA-CD). The loop in the method processes all textboxes except the last one (Length-1). If you add textboxes AE and AF, the code would automatically process AA-AE. If you add further lines (DA-DD, EA-ED, etc.) those would be accessible to ProcessRack, too.
--
Christof
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform