Solved

mouse move on shape

Posted on 2007-11-29
3
157 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
  • 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

6 Surprising Benefits of Threat Intelligence

All sorts of threat intelligence is available on the web. Intelligence you can learn from, and use to anticipate and prepare for future attacks.

Join & Write a Comment

Introduction I needed to skip over some file processing within a For...Next loop in some old production code and wished that VB (classic) had a statement that would drop down to the end of the current iteration, bypassing the statements that were c…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
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…
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…

744 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now