How can I convert from teeChart screen coordinates to VisualBasic form screen coordinates?
I want to position a control in a form in a click on the teeChart.
thank you
Coordinates
Hi Hermes,
You could convert chart screen coordinates to form screen coordinates simply adding the chart's position to the desired coordinate. Something like this:
But note that chart coordinates are expressed in pixels and the form in twips (15 pixels). So you should make your form count in pixels as follows:
Or you could also count chart coordinates by 15 on 15:
You could convert chart screen coordinates to form screen coordinates simply adding the chart's position to the desired coordinate. Something like this:
Code: Select all
FormXCoord = ChartXCoord + TChart1.Left
FormYCoord = ChartYCoord + TChart1.Top
Code: Select all
Me.ScaleMode = vbPixels
Code: Select all
FormXCoord = ChartXCoord * 15 + TChart1.Left
FormYCoord = ChartYCoord * 15 + TChart1.Top
Best Regards,
Yeray Alonso Development & Support Steema Software Av. Montilivi 33, 17003 Girona, Catalonia (SP) | |
Please read our Bug Fixing Policy |