en class1
Código:
..en el form, para 2 textbox (text1 y text2)Private WithEvents ElText As TextBox Public Sub Iniciar(UnText As TextBox) Set ElText = UnText End Sub Private Sub ElText_KeyDown(KeyCode As Integer, Shift As Integer) MsgBox KeyCode End Sub
Código:
Como dije los intercepta bien y asi funciona, Dim obj1 As Class1 Dim obj2 As Class1 Private Sub Form_Load() Set obj1 = New Class1 Set obj2 = New Class1 obj1.Iniciar Text1 obj2.Iniciar Text2 End Sub Private Sub Form_Unload(Cancel As Integer) Set obj1 = Nothing Set obj2 = Nothing End Sub
La pregunta: ¿como hago para interceptar eventos en controles que forman una matriz ??? ..ya probé obviamente declarando en el procedimiento de evento el parámetro Index as Integer, tambien pasarlo como Object en ves de As TextBox
Código:
pero no lo toma Private Sub Text_KeyDown(Index As Integer, KeyCode As Integer, Shift As Integer)


..gracias por cualquier dato :)
----------------
saludos