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 anmir55, Today, 12:58 AM
      0 responses
      0 views
      0 likes
      Last Post anmir55
      by anmir55
       
      Started by Powerbucker, Today, 12:52 AM
      0 responses
      2 views
      0 likes
      Last Post Powerbucker  
      Started by eduardopoletto, 10-10-2023, 11:47 AM
      7 responses
      642 views
      0 likes
      Last Post onemoretime  
      Started by BadA$$B3ast, Yesterday, 09:15 PM
      0 responses
      6 views
      0 likes
      Last Post BadA$$B3ast  
      Started by Davereye99, Yesterday, 09:02 PM
      0 responses
      8 views
      0 likes
      Last Post Davereye99  
      Working...
      X