Ver Mensaje Individual
  #3 (permalink)  
Antiguo 20/07/2009, 12:06
Avatar de triqui
triqui
 
Fecha de Ingreso: diciembre-2008
Ubicación: Zaragoza(España)
Mensajes: 624
Antigüedad: 15 años, 5 meses
Puntos: 31
Pregunta Respuesta: ¿Focus en textbox dentro de un GroupBox?

Gracias por responder,

Me funciona, pero no me hace el focus, si pongo lo siguiente, si que me escribe la palabra "hola" en el textbox, pero no me hace el focus, es raro verdad?


Código:
 foreach(Object Obj in this.gboxPersonal.Controls)
             {
             if(Obj is TextBox)
             {
   
                   if(((TextBox)Obj).Name == "TxtNombre")
                   {
                          ((TextBox)Obj).Text = "hola";
                          ((TextBox)Obj).Focus();
                          return;
                   }
  
              }
 
             }
Incluso luego poniendo lo siguiente, la propiedad clear me la haze bien, pero me sigue sin poner el focus en el textbox...

Código:
((TextBox)Obj).Text = "hola";
                      ((TextBox)Obj).Focus();
                      ((TextBox)Obj).Clear();
Alguna otra idea?