MouseHover over many buttons

pierrewhy

Member
Joined
Oct 4, 2005
Messages
14
Programming Experience
5-10
I have a form containing a picturebox representing a map.
Within the picture box I have many buttons representing houses.

When I do a mouseHover on a button I display info on that house on a pop-up form.

My code so far is this:

VB.NET:
[LEFT] 
Private Sub button_mouseHover(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnHouse1.mousehover, btnHouse2.mousehover 'etc etc... 
maphousenumber = DirectCast(sender, Button).Name 
MapMouseHover.Show() End Sub[/LEFT]

It works fine.
I need to know if there is a way to put all the buttons name in an array so that I don't have to write them all in the Handle?
And also, is this the proper way to do this.....using many buttons on a picturebox?

I'm quite new at VB. Any constructive idea will be appreciated.
Thank you,
Pierre
 
Back
Top