Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

DrawingTool with Mouse events.

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

    DrawingTool with Mouse events.

    Hello,
    I'm developing a DrawingTool for NT8 and I need to check when mouse is hovering specific area.
    I tried to subscribe to the ChartPanel.ChartControl mouse events OnStateChange function (Historical, SetDefaults, Configure) but every time ChartPanel was null.

    How to correctly subscribe to ChartPanel.ChartControl events in DrawingTool?

    #2
    Hello yyesyyesyyes,

    In a DrawingTool script, the OnMouseMove() would provide the ChartPanel (which you could assign to a variable for use in other methods).
    Chelsea B.NinjaTrader Customer Service

    Comment


      #3
      Hello yyesyyesyyes,

      Thank you for your post.

      As noted in the help guide, ChartControl should only be accessed once the state has reached State.Historical:Which event(s) are you subscribing to in your script? I suggest subscribing in State.Historical as well as adding a null reference check similar to this snippet:
      Code:
      else if (State == State.Historical)
      {
           if (ChartControl != null)
                ChartControl.MouseLeftButtonDown += MouseClicked;​
      }
      If you are still experiencing unexpected behavior, please provide a snippet of what you have within OnStateChange so I may better understand and assist you.

      Please let me know if I may be of further assistance.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      599 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      344 views
      1 like
      Last Post Geovanny Suaza  
      Started by Mindset, 02-09-2026, 11:44 AM
      0 responses
      103 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by Geovanny Suaza, 02-02-2026, 12:30 PM
      0 responses
      558 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      557 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X