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.
    Brandon H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by memonic, Yesterday, 01:23 PM
    2 responses
    11 views
    0 likes
    Last Post memonic
    by memonic
     
    Started by merc410, Today, 03:41 AM
    2 responses
    10 views
    0 likes
    Last Post merc410
    by merc410
     
    Started by sugalt, 04-30-2024, 04:02 AM
    2 responses
    13 views
    0 likes
    Last Post sugalt
    by sugalt
     
    Started by Ndakotan1313, 03-14-2024, 05:02 PM
    2 responses
    63 views
    0 likes
    Last Post blaise_code  
    Started by claxxical, 05-30-2017, 12:30 PM
    37 responses
    4,461 views
    0 likes
    Last Post Padan
    by Padan
     
    Working...
    X