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