Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Mouseover on object

Status
Not open for further replies.

pbworld30

Programmer
Mar 22, 2007
17
US
Anyone has simple solution on how to highlight an object like picture control / picture button when mouse moves over that object?
Thanks,
 
Not sure what you'll want to use to do an actual highlight, but you can use a userevent in that control that usese the pbm_mousemove event ID to know when the mouse is over that object.
 
I already tried using pbm_mousemove but it does not hightlight the object. If I can hightlight the object (picture button), it gives uses a visual hint to click on it. I also changed the pointer to hyperlink but it is not as good as highlighting the object. Any idea?
 
What version of PB are you using? I'm not incredibly up-to-date on when changes were made to PB, but 10.5 does highlight buttons (both picture and standard text), as well as objects like radio buttons, check boxes, and even drop downs...

I'm just spit-ballin' here, but if you're using an older version of PB, then this may be a clunky method of doing this, but I did use it in my Sr. Project a few years back and it worked flawlessly... Create a label behind your picture button. In the mousemove event for your window, store the X1, X2, Y1, Y2 values of your button, then do the simple logic of getting the pointer X,Y, and if it's withing the bounds of the button, then set the backcolor of the blank label to something other than its default. Creates a "halo" effect around an object that is variable in size/color/etc.
 
Thanks...This worked out well. I have only 2 button but I think this way it becomes little probmatic if I have more than few buttons and if I want to highlight and de-highlight button depending on muose on the button. Any idea?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top