Page 1 of 1
Move rectangle with annotations into it
Posted: Fri Aug 06, 2010 10:02 am
by 15654539
I would like to create a rectangle tool with several annotations tools into it, but with the selector tool when I move the rectangle the annotations don't move.
Is it posible to create an rectangle or something with anotations and drag all of them at the same time?
Thanks
Alain
Re: Move rectangle with annotations into it
Posted: Mon Aug 09, 2010 4:26 pm
by yeray
Hi Alain,
I'm afraid it won't be possible with the actual TeeChart tool set. But you should be able to achieve it with OnMouseDown, OnMouseMove and OnMouseUp events.
If you find troubles with it, don't hesitate to let us know.
Re: Move rectangle with annotations into it
Posted: Mon Aug 23, 2010 9:01 am
by 15654539
I'm trying it, and I can move annotations automatically when I move a rectangle, but I have a strange behaviour, when I add the rectangle and annotation dinamically.
In the Dragging event I always set de annotation 10 pixels more in left and top properties than the rectangle, but I can't do it when I add the rectangle and annotation with the add button.
How can I do it?
I attach an example.
Thanks
Re: Move rectangle with annotations into it
Posted: Tue Aug 24, 2010 10:39 am
by yeray
Hi wakeup,
Try calling tChart1.Refresh(); before initializing the annotation position (Left and Top properties).
Re: Move rectangle with annotations into it
Posted: Tue Aug 24, 2010 11:21 am
by 15654539
Hi Yeray,
As you can see in the example I uploaded I have the refresh and it seems not solve anything...
Thanks
Re: Move rectangle with annotations into it
Posted: Tue Aug 24, 2010 11:25 am
by yeray
Hi wakeup,
I moved the Refresh call to be before the set of the properties and it works for me here:
Code: Select all
tChart1.Refresh();
anotacion.Left = rectangulo.Left + 10;
anotacion.Top = rectangulo.Top + 10;
Re: Move rectangle with annotations into it
Posted: Tue Aug 24, 2010 11:27 am
by 15654539
Ah! Thanks!
I put the refresh before the asings and now it runs too.
Thanks you
Re: Move rectangle with annotations into it
Posted: Tue Aug 24, 2010 11:49 am
by yeray
Hi wakeup,
You're welcome!