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.
      Emily C.NinjaTrader Customer Service

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by gustavobp, Today, 03:15 AM
      0 responses
      5 views
      0 likes
      Last Post gustavobp  
      Started by gustavobp, Today, 03:00 AM
      0 responses
      5 views
      0 likes
      Last Post gustavobp  
      Started by nicbizz, Today, 02:14 AM
      0 responses
      5 views
      0 likes
      Last Post nicbizz
      by nicbizz
       
      Started by Ringer13, Today, 01:59 AM
      0 responses
      7 views
      0 likes
      Last Post Ringer13  
      Started by NINZAMANA, 02-06-2025, 09:03 AM
      2 responses
      24 views
      0 likes
      Last Post Fertryd2  
      Working...
      X