Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

CS0115 error code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    CS0115 error code

    I have "System.Windows.Input and System.Windows.Forms" in my Using Declaration. Every time I tried to compile the following codes, I get error code CS0115 (no suitable method to override).
    Please help resolving this issue. Thanks.

    public override void OnMouseDown(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
    {

    ''''''''''' my code '''''''''''
    }​

    #2
    Hello, thanks for writing in. We have an existing example of how to get a mouse down event through a chart here:


    Kind regards,

    -ChrisL​

    Comment


      #3
      I have "System.Windows.Input and System.Windows.Forms" in my Using Declaration. Every time I tried to compile the following codes, I get error code CS0115 (no suitable method to override).
      Please help resolving this issue. Thanks.

      public override void OnMouseDown(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint)
      {
      switch (DrawingState)
      {
      case DrawingState.Building:
      dataPoint.CopyDataValues(Anchor);
      Anchor.IsEditing = false;
      DrawingState = DrawingState.Normal;
      IsSelected = false;
      break;
      case DrawingState.Normal:
      // make sure they clicked near us. use GetCursor incase something has more than one point
      Point point = dataPoint.GetPoint(chartControl, chartPanel, chartScale);
      if (GetCursor(chartControl, chartPanel, chartScale, point) != null)
      DrawingState = DrawingState.Moving;
      else
      IsSelected = false;
      break;
      }
      }​

      Comment


        #4
        Hi realrich, thanks for the follow up. If you are working on a drawing tool, make sure the class that derives from DrawingTools is within this code exactly:

        Code:
        #region Using declarations
        using System;
        using System.Collections.Generic;
        using System.ComponentModel;
        using System.ComponentModel.DataAnnotations;
        using System.Linq;
        using System.Windows;
        using System.Windows.Media;
        using System.Xml.Serialization;
        using NinjaTrader.Gui;
        using NinjaTrader.Gui.Chart;
        #endregion
        ​
        
        namespace NinjaTrader.NinjaScript.DrawingTools
        {
        [B]    public class MyCustomDrawingTool : DrawingTool
                {
                    public override void OnMouseDown(ChartControl chartControl, ChartPanel chartPanel, ChartScale chartScale, ChartAnchor dataPoint){}
                 }[/B]
        }
        System.Windows.Input and System.Windows.Forms are not required to override this method, so if you are not working on a drawing tool, this override can not be used, and one must use the override from the example I posted earlier.

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        579 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        334 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        101 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        554 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        551 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X