Ver Mensaje Individual
  #2 (permalink)  
Antiguo 04/11/2004, 16:11
rekiller
 
Fecha de Ingreso: julio-2004
Mensajes: 13
Antigüedad: 19 años, 9 meses
Puntos: 0
Bueno, ya logre que me respondiera el evento click, ahora solo me lo hace para el ultimo objeto que inserto

Dim WithEvents botones As CommandButton

Private Sub Form_Load()


Adodc1.Refresh
Dim i As Integer

For i = 1 To Adodc1.Recordset.RecordCount
Set botones = Me.Controls.Add("vb.commandbutton", Adodc1.Recordset.Fields("nombreCategoria"))

botones.Width = AnchoB
botones.Height = AltoB

botones.Left = menuX
botones.Top = menuY
botones.Caption = Adodc1.Recordset.Fields("nombreCategoria")

menuX = menuX + AnchoB + 35
botones.Visible = True

Adodc1.Recordset.MoveNext
Next

End Sub


Private Sub botones_Click()

msgbox botones.caption
End Sub


Se crean dinamicamente por ahorita 4 botones, estos necesito que respondan al dar click, solo me responde el ultimo boton que inserte