Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Is it possible to shift text created with Draw.TextFixed from edge of screen?

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

    Is it possible to shift text created with Draw.TextFixed from edge of screen?

    This may not be possible using Draw.TextFixed, but is it possible to shift an object created there n-spaces from the edge of the screen?

    I have one I have created via: "Draw.TextFixed(this,"myTextFixed", myTextString, TextPosition.TopRight, TextColorUp, myTextFont, Brushes.Transparent, Brushes.Transparent, 100);"

    Where the text string is stored in "myTextString"

    This places it in the top right corner, but if I wanted to shift it to the left a bit, is this possible?

    I have tried to add white spaces by concatenating a blank string to "MyTextString" by doing this:
    var displayText = Draw.TextFixed(this,"myTextFixed", (myTextString+" "), TextPosition.TopRight, TextColorDn, myTextFont, Brushes.Transparent, Brushes.Transparent, 100);

    This also does not work. I tried using the .PadRight(10) method, but this also does not work.

    Is this possible?

    #2
    Hello forrestang,

    Thanks for your post.

    You can try adding escape characters such as \t (tab) to the end of the line.

    I've done that in this example to provide a label and then a price after the label.

    Draw.TextFixed() was not intended to be used this way and for more precise control I would suggest using OnRender() directly but that is a lot of work if you only need a little display.

    Click image for larger version

Name:	DrawTextFixedColorExample.PNG
Views:	412
Size:	19.4 KB
ID:	1132699

    [ATTACH]n1132700[/ATTACH]

    You can do an internet search for additional c# escape characters.

    Comment


      #3
      Originally posted by NinjaTrader_PaulH View Post
      Hello forrestang,

      Thanks for your post.

      You can try adding escape characters such as \t (tab) to the end of the line.

      Thank you paul, this works perfectly for what I need. I wound up escaping with "\b".

      I REALLY need to learn how to use the SharpDK stuff!!!

      Comment


        #4
        Hello forrestang,

        Thanks for your reply.

        Glad you were able to find something that worked in this case.

        A somewhat easy entry into that other world would be looking at the indicator in your platform SampleCustomRender. It is well documented in the comments and you can make a copy and try adjusting things.

        Comment

        Latest Posts

        Collapse

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