25 pts.
 Object.MouseEnter and/or Object.MouseLeave
I have built a program that is using 75 Control Buttons, laced in a Panel, on one form. Using a ForEach/Loop to loop through all 75 buttons, I am looking for the syntax (code) that will allow me to indentify which of the 75 buttons activated the ForEach/Loop by way on Object.MouseEnter and/or Object.MouseLeave in Visual Basic. Can any one help?

Software/Hardware used:
ASKED: February 20, 2008  7:28 PM
UPDATED: February 22, 2008  9:53 AM

Answer Wiki:
I wonder about a design with 75 buttons on one panel!?! However, if that is the need, I would identify a button by its Text property or, for greater flexibility, its Tag property. Something like: <pre>Dim c As Control For Each c In Panel1.Controls If TypeOf c Is Button Then MsgBox(c.Text, 0, "") End If </pre> I am assuming Visual Basic 2005 here. You could do something very similar in VB6 or the conceptually simpler Control Array.
Last Wiki Answer Submitted:  February 22, 2008  9:53 am  by  BobBeechey   750 pts.
All Answer Wiki Contributors:  BobBeechey   750 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _