Imagebox, show a Shape when the user clicks on it

L

LaggerChr

hey all!

so i have this image box on a form and load the pictures out of the
database in that picturebox. now i wanna realize that the user can
click on the picture and some shape appears, like an arrow to the point
where the user clicked. then i wanna store the coordinates of that
click in the database too and show it when the image is shown again.
(that should not be the problem).

is there an "easy" way or SOME way to do this?

i appreciate every tip or help!

thanks in advance, lc
 
G

Guest

Hi LaggerChr,


To duplicate this, I've created one image and a label. When the user clicks
the label displays the coordinates

Private Sub Image0_MouseDown(Button As Integer, Shift As Integer, X As
Single, Y As Single)
Label2.Caption = "X: " & X & " - Y: " & Y
End Sub

From your post, this seemed to be the problem. Post back if it's not.
(It sounds like the database update is easy enough)
 
L

LaggerChr

Hey Denny!

Thanks for ur tip but there is a little bit more:

I want to display a certain shape on the image box, like an arrow,
which points to the position (x, y) the user clicked. Thats the hard
part!

Maybe u or someone else can help me out!

thanks in advance!
 
P

PC Datasheet

Here's an idea to try ---

Create a textbox and change the font to WingDings or something that has an
arrow. Reduce the size of the textbox so it just surrounds the arrow.
Determine the height of the textbox. Now once you have the position (x, y)
the user clicked, set the Left property of the textbox to X and the Top
property of the textbox to Y - 1/2 the height of the textbox. (Just setting
it to Y would position the arrow in the textbox below the x,y position by
1/2 the height of the textbox.
 
L

LaggerChr

Hello!

This tip was great and worked perfect. Thanks for your advice, you
saved me a lot of time.

Best regard, LC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top