Ver Mensaje Individual
  #2 (permalink)  
Antiguo 15/02/2011, 08:14
Avatar de Aquaventus
Aquaventus
 
Fecha de Ingreso: junio-2010
Ubicación: Lima-Peru , En el alba de la naturaleza
Mensajes: 2.105
Antigüedad: 14 años, 8 meses
Puntos: 267
Respuesta: Porgramar controles dinamicos en C#

tu error esta aqui domanion en tu boton, pues no le asignas un nombre al control :
Código vb.net:
Ver original
  1. Dim btn As New MiBoton
  2. btn.Name = "botonX" '<-- TE FALTA ESTO
  3. btn.BackColor = Color.Black
  4. btn.Width = 50
  5. btn.Height = 50
  6. btn.Location = New Point(x, y)
  7. btn.Text = j.ToString + " " + i.ToString
  8. 'Y AQUI TIENES QUE LLAMARLO POR EL NOMBRE QUE SE LE ASIGNA
  9. 'AL BOTON
  10. 'AddHandler btn.Click, AddressOf clicboton
  11. AddHandler this.Controls("botonX").Click, AddressOf clicboton
  12. Me.Panel1.Controls.Add(botones(j, i))
Espero te haya servido. Saludos!
__________________
Internet es tener todo el conocimiento global a tu disposición.
Desarrollo de Software - Ejemplos .Net