Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
A way refer to a control itself in an event handler
Hi all,
I have 60 controls on a form, and every control will handle an event in the same way, so I decide to abstract the process into a sub and make the sub call with corresponding control. If I can refer to the control itself in its event handler then the calling process will be same across all controls handlers. Could you tell me a way to refer to a form's control itself in one of its event handler , for example, Private Sub txtEI3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) ' here I hope to refer to the control txtEI3 in a generic way like Me because 'there will be universal sub call using the control as parameter like ' FillDate Thiscontrol End Sub Clara thank you so much for your help |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
A way refer to a control itself in an event handler
You will need to this with a Class.
Plenty of examples available. RBS "clara" wrote in message ... Hi all, I have 60 controls on a form, and every control will handle an event in the same way, so I decide to abstract the process into a sub and make the sub call with corresponding control. If I can refer to the control itself in its event handler then the calling process will be same across all controls handlers. Could you tell me a way to refer to a form's control itself in one of its event handler , for example, Private Sub txtEI3_MouseMove(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) ' here I hope to refer to the control txtEI3 in a generic way like Me because 'there will be universal sub call using the control as parameter like ' FillDate Thiscontrol End Sub Clara thank you so much for your help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Event handler | Excel Programming | |||
Autoshape event handler? | Excel Programming | |||
Global event handler?? | Excel Programming | |||
where is the workbook_open event handler??? | Excel Programming | |||
different IDispatch in event handler | Excel Programming |