VB6 PictureBox Mouseover

I am using VB6 PictureBox in my User Control. I set the PictureBox, I set BorderStyle to 0, and I set the BackColor to the BackColor control. The idea is that I want a floating icon. However, I want this icon to appear clickable when the mouse hovers over it.

Two questions:

  • What events am I using? MouseMove seems to be the closest thing to the "MouseOver" event. Are there cleaner alternatives?

  • How can I change the style? I have tried several things, but none of them looks right.

0


source to share


1 answer


  • MouseMove is the correct event in VB6. You will need to do some work to manually detect when the mouse leaves the client area. (My experiments in this world, many years ago, have always believed that this behavior is difficult.)

  • To change the style, I would recommend using GDI to: (a) nudge the image one pixel up and to the left; (b) draw one pixel line in the ButtonHighlightColor along the top and left edges; and (c) draw one pixel line in the ButtonShadowColor along the bottom and right edges. This is harder than it sounds, especially in VB6, so in the end I would recommend ...



What are you looking at the toolbar of the vbAccelerator control panel . They are free and they will probably bring you the most wherever you want. (And yes, they are "classic" VB, which is VB6.)

+2


source







All Articles