display mouse cursor coordinates

Hello,
Is any equivalent picturebox.ToolTipText, this Vb6 function display at runtime on a label mousemove cursor the coordinates (x,y) when flying on the picbox “Canvas”.

[/url][/img]

Not that I am aware of. There are Tooltips in Xojo but they don’t follow mouse position and I am not sure you can update their content once they have popped up

Mousemove event display cursor coordinates only in textbox control, equivalent ToolTipText vb6 seems not available in xojo.

TextEdit (TextField and TextArea) in Xojo.
No. You can display them in a Label, checked, and probably too in a Listbox… in a file, etc.

[quote=419343:@Emile Schwarz]TextEdit (TextField and TextArea) in Xojo.
No. You can display them in a Label, checked, and probably too in a Listbox… in a file, etc.[/quote]

I mean by “textbox” any control displaying text, label, textfield , etc … , equivalent Vb6 ToolTopText does not existe in XOJO ?

I do not know. I never used VB (any version).

But what about using a label you will display below the Mouse and populate (replace its contents) in the MouseMove Event ?
And use a ToogleGPSLocation MenuItem to Display / Hide the Label.

I don’t understand … , label must be attached to mouse pointer for tracking a coordinates x,y (converted to an other unit).

use the mousemove event of the window. it will work on the whole window no matter the underlying control.

You could move the TextField control to match the cursor .

In the MouseMove event of the window:

TextField1.Text=str(x)+" "+ str(y) TextField1.Left=x- TextField1.Width/2 TextField1.Top=y+ TextField1.Height

Not sure how practical it would be though

[quote=419382:@Kuzey Atici]You could move the TextField control to match the cursor .

In the MouseMove event of the window:

TextField1.Text=str(x)+" "+ str(y) TextField1.Left=x- TextField1.Width/2 TextField1.Top=y+ TextField1.Height

Not sure how practical it would be though[/quote]
Very good idea, it works well … !
Thanks Kuzey.

A label will be a better idea with same code.

Add a MenuItem that you may name ToogleGPSLocation… (ON / OFF the feature).

You could also use the helptag of the canvas but it’s not that responsive.

In the MouseMove event of the canvas:

Canvas1.helptag=str(x)+"  "+ str(y)

[quote=419389:@Kuzey Atici]You could also use the helptag of the canvas but it’s not that responsive.

In the MouseMove event of the canvas:

Canvas1.helptag=str(x)+"  "+ str(y)

I have already tried , it does not work .

tooltip works fine, and responds as soon as you invoke tooltip.show.