Solved

mouse move on shape

Posted on 2007-11-29
3
163 Views
Last Modified: 2013-12-25
have a shape1 on form.
is possible to use a mouse move event or other controll, and when the cursor go on shape1, show tootltip "this is the shape1"

in effect i intercept position of this shape1 with the code above and when the cursor go in this coordinate show the tooltip "this is the sahpe1"

part of code
Private Sub Image1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

    lDC = GetWindowDC(0)
    Call GetCursorPos(tPOS)
    lColor = GetPixel(lDC, tPOS.X, tPOS.Y)

If tPOS.X >= 440 And tPOS.X <= 460 And tPOS.Y >= 340 And tPOS.Y <= 360 Then
'"show the tooltip when the mouse go here"      
        Me.Label5.Caption = "CAMPANIA": Exit Sub
    Else
        Me.Label5.Caption = ""
    End If
0
Comment
Question by:sal21
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
3 Comments
 
LVL 23

Accepted Solution

by:
ahammar earned 500 total points
ID: 20380296
Put an image box the same size as your shape on top of (or under) the shape.  Do not put a picture in it.  Do not change any of the properties except for the tool tip.  Set it to be whatever you want it to be.  When you open your form, you will not be able to see the image box, but it will be there, and the tool tip will still show up when you put your mouse over the shape as long as the image box is the same size and shape as our shape, and directly over or under it...

:-)
Albert
0
 
LVL 23

Expert Comment

by:ahammar
ID: 20380305
Also...you can put code in the image box click event (or whatever other events you want) and when you click on the shape, the image box code will run.  It will look like you are clicking on the shape, but you will really be clicking on the image box that you can't see.

ps...make sure you do not change the visible property to false...leave it as true.  You still will not be able to see it if you don't put a picture in it...

:-)
Albert


0
 
LVL 23

Expert Comment

by:ahammar
ID: 20380322
Actually, you can use a label or any other control that you can remove all text and set to transparent.  It does not have to be an Image box control.  As long as you leave the visible property set to true, you can make it transparent, you still will not be able to see it, but all code events will still work, just as if you could see it...it will appear as if you are acting on the shape, but you will really be acting on the transparent control...


:-)
Albert
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http://www.experts-exchange.com/Q_27402310.html) in the VB classic zone, I wrote some VB code in the (Office) VBA environment, rather than fire up my older PC.  I didn't post completely correct code o…
When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…

696 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