?
Solved

image - button when mouse pass

Posted on 1998-10-19
5
Medium Priority
?
151 Views
Last Modified: 2010-04-30
In VB5 disign window, when the mouse cursor sets on an icon of a toolbar, the icon becomes a button, and back to the plain icon when the mouse leaves the place.

I want to do this for an image.

I tried to use Mousepass event of the image to display the button and that looks fine, but I got no good way to let it disapear when the mouse leave the image.

Any good idea?
0
Comment
Question by:victorlong
  • 3
  • 2
5 Comments
 
LVL 14

Accepted Solution

by:
waty earned 150 total points
ID: 1440618
You have to add code in your MouseMove event of your form.

Do as follow :

Declare a global variable ex : gbOverImage

in the MouseMove of your form, add this
if gbOverImage then
   ' *** Set your image properly

   gbOverImage= False
end if

in the MouseMove of your image
gbOverImage= True


I have done this way some years ago for something similar
0
 

Author Comment

by:victorlong
ID: 1440619
Hi Waty

Thank you.

In my case, there are many other controls on the form. So, not only the form, I need put the mousemove event for each control as well, and I may forget to put such code for a newly added control.

I wish we have a MouseLeave event for the image....Can we create an ActiveX control with this event?

Cheers.
0
 
LVL 14

Expert Comment

by:waty
ID: 1440620
You could write a new Image OCX implementing this events.
It should be possible.

Another possibility, is store the hwnd of the image you are working on, add a timer, and check in that timer the control under the mouse position. I have seen something like that some years ago.
0
 

Author Comment

by:victorlong
ID: 1440621
Hi Waty

Image OCX is interesting. But there are at least two problems:

1. The base of an ActiveX control is a form which is not an image stype....for example, you may not see the background.
2. Still have the problem how to make the Sub Mouse_Leave.
0
 
LVL 14

Expert Comment

by:waty
ID: 1440622
In the OCX, you could add a timer wich check the hwnd of the current hwnd where the mouse is over. If this is not the same of the hwnd of your created activex, your generate a Leave event, otherwise nothing.

0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I’ve seen a number of people looking for examples of how to access web services from VB6.  I’ve been using a test harness I built in VB6 (using many resources I found online) that I use for small projects to work out how to communicate with web serv…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
Suggested Courses
Course of the Month16 days, 9 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question