Nevron Forum
Back
Login
Register
Login
Register
Home
»
Nevron Vision for NET
»
Nevron Chart for .NET
»
How to add OnDragEnd event to a moveable Legend of a Chart
How to add OnDragEnd event to a moveable Legend of a Chart
Post Reply
How to add OnDragEnd event to a moveable Legend of a Chart
View
Flat Ascending
Flat Descending
Threaded
Options
Subscribe to topic
Print This Topic
Goto Topics Forum
Author
Message
joern kunze
joern kunze
posted 7 Years Ago
ANSWER
Topic Details
Group: Forum Members
Posts: 86,
Visits: 221
Hi Experts,
I have a moveable Legend (using NOffserTool based Controller-Tool) where I want to save Legend-Coordinates after the Legend has been moved so that I can restore Legend position when needed.
Moving the Legend works good - but I have some trouble getting the Legend position after it has been moved. The
NOffsetTool
offers only
OnDoDrag
but no
EndDrag
event:
Within the OnDoDrag I can get the coordinates continously while the Legend is moved - but I would like to get the coordinates only when the Legend Drag has been finished. Is there a way to achieve this ?
Furthermore I wonder if there is an easy way to get the Legend Coordinates in the LegendMoveTool
-
LocationChanged
event.
Present Situation:
LegendMoveTool hLegendMoveTool = new LegendMoveTool();
hLegendMoveTool.
LocationChanged
+=
eventSink_OnLegendEndDrag
;
_NevronChart.Controller.Tools.Add(hLegendMoveTool);
where
public void
eventSink_OnLegendEndDrag
(object sender, EventArgs e) {
Console.WriteLine("OnLegendEndDrag");
// How can I get the Legend coordinates here - EventArgs e seems not to have them ?
}
and
public class
LegendMoveTool
: Nevron.Chart.Windows.
NOffsetTool
{
...
public override void
OnDoDrag
(object sender, NMouseEventArgs e) {
// event is fired continously when Legend is moved ....
NPoint oPoint = e.Location;
Console.WriteLine("OnDoDrag: X=" + oPoint.X + " / Y=" + oPoint.Y); // Coordinates of the Legends lower right corner
base.OnDoDrag(sender, e);
}
}
Thanks for your help,
Best regards,
Joern
Tags
Chart
Coordinates
moveable Legend
Reply
Like
0
GO
Merge Selected
Merge into selected topic...
Merge into merge target...
Merge into a specific topic ID...
Open Merge
Threaded View
Threaded View
How to add OnDragEnd event to a moveable Legend of a Chart
joern kunze
-
7 Years Ago
Hi Joern, You can override the OnEndDrag virtual method: class...
Nevron Support
-
7 Years Ago
... overwritingOnEndDrag basically seems to work. But now 2 other...
joern kunze
-
7 Years Ago
Hi Joern, 1. Problem When the entire form is resized or even...
Nevron Support
-
7 Years Ago
... thanks a lot, specifying PointL as Pixel does the trick :-)
joern kunze
-
7 Years Ago
Post Reply
Similar Topics
Post Quoted Reply
Reading This Topic
Login
Login
Remember Me
Reset Password
Resend Validation Email
Login
Explore
Messages
Mentions
Search