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​
    Chris L.NinjaTrader Customer Service

    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.
        Chris L.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by josiahTrader193541_, Today, 01:57 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Jesse  
        Started by josiahTrader193541_, Today, 01:57 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by FishTrade, Yesterday, 04:10 PM
        4 responses
        18 views
        0 likes
        Last Post FishTrade  
        Started by gustavobp, Today, 01:37 PM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by Peppo, 02-02-2025, 12:39 PM
        8 responses
        67 views
        0 likes
        Last Post Peppo
        by Peppo
         
        Working...
        X