Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Read only State error

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

    Read only State error

    Hi
    I am getting the following error
    Error on calling 'OnBarUpdate' method on bar 5: Cannot set a property on object '#FFFFC0CB' because it is in a read-only state.

    The object in question is

    ChartControl.Dispatcher.InvokeAsync((Action)(() =>
    {​
    Dotp myDraw = DrawPlus.Dotp(this,"dot"+CurrentBar,true,0,myDot[0],dotBrush,myDotSize,Brushes.Transparent);
    ​myDraw.AreaBrush.Opacity = 50;
    }));

    if I remove the opacity property it works just fine so clearly there's the issue.

    Is there any way I can set the opacity?

    #2
    Hello Mindset,

    Thanks for your post.

    You will need to use a SolidColorBrush to define opacity. You also need to create a new brush that is not already created since you can't modify the opacity on an existing brush.

    See this forum thread for more information about this error: https://ninjatrader.com/support/foru...40#post1112840

    Also, see this help guide page about working with brushes: https://ninjatrader.com/support/help...gcustombrushes

    Please let me know if I may assist further.
    <span class="name">Brandon H.</span><span class="title">NinjaTrader Customer Service</span><iframe name="sig" id="sigFrame" src="/support/forum/core/clientscript/Signature/signature.php" frameborder="0" border="0" cellspacing="0" style="border-style: none;width: 100%; height: 120px;"></iframe>

    Comment


      #3
      Fantastic. Perfect solution.thank you.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      36 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      14 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      19 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      22 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X