Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Trying to get text string and brush color of text drawingtool

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

    Trying to get text string and brush color of text drawingtool

    I'm using:

    protected override void OnBarUpdate()
    {
    // Loops through the DrawObjects collection via a threadsafe list copy
    foreach (DrawingTool draw in DrawObjects.ToList())
    {
    if (draw is DrawingTools.Text)
    {
    ​DrawingTools.Text myText = draw as DrawingTools.Text;
    }
    }

    }

    I am unable to figure out how to get the actual text string and the color from MyText but can't figure it out.

    Please help.
    Jim


    #2
    Hello Jim,

    Thanks for your post.

    Please see the example script on the forum thread linked below which demonstrates getting a Drawing Object's properties, such as Brush color, by looping through the DrawObjects collection.

    https://ninjatrader.com/support/foru...54#post1231354

    Note that there are no documented means for getting the Text of a Draw.Text() object.

    DrawObjects: https://ninjatrader.com/support/help...rawobjects.htm
    DrawingTool Objects: https://ninjatrader.com/support/help...rawingtool.htm

    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

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    109 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    59 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    37 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    40 views
    0 likes
    Last Post TheRealMorford  
    Started by Mindset, 02-28-2026, 06:16 AM
    0 responses
    77 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X