Profile Picture

How to resolve exception 'cannot convert from 'System.Windows.Forms.MouseEventArgs' to...

Posted By Niranjan Singh 8 Years Ago
Author
Message
Niranjan Singh
Problem Posted 8 Years Ago
View Quick Profile
Forum Member

Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 49, Visits: 179
Hi,
I have updated my project with newer version of Nevron Chart dlls. Now there are lots of change from version 12.x.x.x to 16.1.5.12. Most of build issues has been resolved but on of my required functionality work with the standard control events. Below is code snippet which was working correct with standard .net library objects.


NDataPanTool chartDataPanTool;
void chartControl_MouseUp(object sender, MouseEventArgs e)
{
  if (chartControl.Controller.Tools.Contains(chartDataPanTool))
  {
   chartDataPanTool.DoEndDrag(sender, e);
  }
}


Now I am looking for quick fix which resolve such issue with the upgrade. 


Thanks,
Niranjan



Niranjan Singh
Posted 8 Years Ago
View Quick Profile
Forum Member

Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)Forum Member (41 reputation)

Group: Forum Members
Last Active: 4 Years Ago
Posts: 49, Visits: 179
Hi,

I have resolved this compile issue by creating a new NMouseEventArgs object from the MouseEventArgs information.

void chartControl_MouseUp(object sender, MouseEventArgs e)
{
  if (chartControl.Controller.Tools.Contains(chartDataPanTool))
  {
   NMouseEventArgs args = new NMouseEventArgs(chartControl.View,
    (Nevron.Chart.Windows.MouseButton)Enum.Parse(typeof(Nevron.Chart.Windows.MouseButton), e.Button.ToString()),
    e.Clicks, e.X, e.Y, e.Delta);
   chartDataPanTool.DoEndDrag(sender, args);
  }
}

but I am not sure that does it effect the existing functionality or not. I looking forward with Nevron guys for the correctness of these changes.
Thanks,
Niranjan

Nevron Support
Posted 8 Years Ago
View Quick Profile
Supreme Being

Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)Supreme Being (4,435 reputation)

Group: Forum Members
Last Active: Last Week
Posts: 3,054, Visits: 4,000
Hi Niranjan,
The workaround is correct - we had to decouple the controller implementation from Winforms classes / enum in order to reuse it in WPF as well...

Best Regards,
Nevron Support Team





Similar Topics


Reading This Topic