Ver Mensaje Individual
  #11 (permalink)  
Antiguo 11/01/2010, 09:26
kitune
 
Fecha de Ingreso: julio-2005
Mensajes: 275
Antigüedad: 18 años, 9 meses
Puntos: 3
Respuesta: Formar nombre de instancia a partir de Strings en C#

podria servir esto que he encontrado para winforms??


Código C++:
Ver original
  1. private void set_values()
  2.         {
  3.             Random my_random = new Random();
  4.             for (int i = 1; i < 5; i++)
  5.             {
  6.                 TextBox txtBoxtemp = (TextBox)this.Controls.Find("txtValue" + i, true)[0];//Use the first found TextBox
  7.                 txtBoxtemp.Text = (random.Next(9) + 1) + ""; // get values from 1 to 9
  8.             }
  9.         }