Solved

mouse move on shape

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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
message box in access 4 55
How does CurrentUser work? 10 42
Copy a range from 1..n excel sheets to one destination sheet 2 71
backup program with robocopy 6 88
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
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…
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…

737 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