Bonjours je veux convertir un string en Label

je veux faire ceci parce que je dois faire la même chose 216 fois

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
e->Graphics->DrawString(label3->Text,label3->Font,Brushes::Black,label3->Location.X,label3->Location.Y);
			e->Graphics->DrawString(label4->Text,label4->Font,Brushes::Black,label4->Location.X,label4->Location.Y);
			e->Graphics->DrawString(label5->Text,label5->Font,Brushes::Black,label5->Location.X,label5->Location.Y);
			e->Graphics->DrawString(label6->Text,label6->Font,Brushes::Black,label6->Location.X,label6->Location.Y);
			e->Graphics->DrawString(label7->Text,label7->Font,Brushes::Black,label7->Location.X,label7->Location.Y);
			e->Graphics->DrawString(label8->Text,label8->Font,Brushes::Black,label8->Location.X,label8->Location.Y);
			e->Graphics->DrawString(label9->Text,label9->Font,Brushes::Black,label9->Location.X,label9->Location.Y);
			e->Graphics->DrawString(label10->Text,label10->Font,Brushes::Black,label10->Location.X,label10->Location.Y);
			e->Graphics->DrawString(label11->Text,label11->Font,Brushes::Black,label11->Location.X,label11->Location.Y);
j'avais pensé faire ca comme ca mais ca fonctionne pas

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
for (int i=0 ; i<216 ; i++) 
			{
			   String ^NomLabel = "label"+i;
			   Label^ Lb = safe_cast< Label^ >(NomLabel);
			   e->Graphics->DrawString(Lb->Text,Lb->Font,Brushes::Black,Lb->Location.X,Lb->Location.Y);
			}
Est-ce quelqu'un pourrais m'aider S.V.P Merci

TrollTop c++.net