emidiod
asked on
using WithEvents with control arrays
I would like to place a control array on a form and in my class which contains an instance of the form, i would like to receive the events from the control array. Can this be done and if so, how?
ASKER
Thanks
This works (not very elegant), but what i really would like is the following:
I have Form1 which has a control array of VB.CommandButtons which are Command1(0) and Command1(1).
I have a Class1 which has a module level variable with events declared as:
Private WithEvents m_oButton as VB.CommandButton
How do i set m_oButton to point to Command1 which is the control array so that i can use the following
Private Sub m_oButton_Click(Index as ingeger)
It seems to me that VB uses some hidden interface when dealing with control arrays and that i cannot use it the way i have outlined here.
This works (not very elegant), but what i really would like is the following:
I have Form1 which has a control array of VB.CommandButtons which are Command1(0) and Command1(1).
I have a Class1 which has a module level variable with events declared as:
Private WithEvents m_oButton as VB.CommandButton
How do i set m_oButton to point to Command1 which is the control array so that i can use the following
Private Sub m_oButton_Click(Index as ingeger)
It seems to me that VB uses some hidden interface when dealing with control arrays and that i cannot use it the way i have outlined here.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks
The raise event will send an event to the caller of the class.
RoverM