I cant find a foreach ... ToList() to get to the button. Any help? Thanks.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
How to access button content in OnBarUpdate
Collapse
X
-
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.Tags: None
-
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.
Latest Posts
Collapse
| Topics | Statistics | Last Post | ||
|---|---|---|---|---|
|
Started by CarlTrading, 03-31-2026, 09:41 PM
|
1 response
80 views
1 like
|
Last Post
|
||
|
Started by CarlTrading, 04-01-2026, 02:41 AM
|
0 responses
40 views
0 likes
|
Last Post
by CarlTrading
04-01-2026, 02:41 AM
|
||
|
Started by CaptainJack, 03-31-2026, 11:44 PM
|
0 responses
63 views
2 likes
|
Last Post
by CaptainJack
03-31-2026, 11:44 PM
|
||
|
Started by CarlTrading, 03-30-2026, 11:51 AM
|
0 responses
63 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:51 AM
|
||
|
Started by CarlTrading, 03-30-2026, 11:48 AM
|
0 responses
54 views
0 likes
|
Last Post
by CarlTrading
03-30-2026, 11:48 AM
|
Comment