Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to access button content in OnBarUpdate

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

    How to access button content in OnBarUpdate

    NT8, Strategy, I have buttons in a grid, they work properly when clicked, but in OnBarUpdate I want to change the Content that is displayed, but I get an error saying it is owned by another thread.
    I cant find a foreach ... ToList() to get to the button. Any help? Thanks.

    #2
    Hello kenz987,

    Thank you for your post.

    You'd need to use a dispatcher since the button would be on a different thread (OnBarUpdate would be on an instrument thread while buttons would be on a UI thread).

    I'd suggest reviewing this section of our help guide on multi-threading considerations with NinjaScript:

    https://ninjatrader.com/support/help...-threading.htm

    As well as this example that covers making changes to UI elements using WPF modifications:

    Hello All, Moving forward this will be maintained in the help guide reference samples and no longer maintained on the forum. Creating Chart WPF (UI) Modifications from an Indicator - https://ninjatrader.com/support/help...ui)-modifi.htm (https://ninjatrader.com/support/helpGuides/nt8/creating-chart-wpf-(ui)-modifi.htm) I've


    Please let us know if we may be of further assistance to you.

    Comment


      #3
      Thank You Kate, Very Helpful!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Geovanny Suaza, 02-11-2026, 06:32 PM
      0 responses
      571 views
      0 likes
      Last Post Geovanny Suaza  
      Started by Geovanny Suaza, 02-11-2026, 05:51 PM
      0 responses
      331 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
      549 views
      1 like
      Last Post Geovanny Suaza  
      Started by RFrosty, 01-28-2026, 06:49 PM
      0 responses
      549 views
      1 like
      Last Post RFrosty
      by RFrosty
       
      Working...
      X