?
Solved

mouse move on shape

Posted on 2007-11-29
3
Medium Priority
?
165 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 2000 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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

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…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses
Course of the Month11 days, 5 hours left to enroll

770 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