Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

Partner 728x90

Collapse

Text Underline

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

    Text Underline

    I use the following to draw text above certain bars

    DrawText("Tag"+CurrentBar,true,"String",0, High[0],0,myColor,textFont,StringAlignment.Center,Color.E mpty,Color.Empty,10);

    When a certain set of conditions are met I want to underline the text-
    textFont has a property called Underline but how do I get it to work please?

    textFont.Underline scans but does not compile.

    #2
    Mindset,

    I believe that property is a read only property. You would likely need to create/change the Font object with the underline setting.
    Josh P.NinjaTrader Customer Service

    Comment


      #3
      Font Object

      Isn't textFontBold a font object?
      sorry for being so dim but how would I change it?

      Comment


        #4
        Code:
        Font f = new Font("Arial",8,FontStyle.Underline );
        replace textFont with f

        google "font C#" for more. that way its much easier.

        Comment


          #5
          Font object

          Isn't that a new instance of an object?- I did look at the msdn site but it uses TextCollections which seemed very complicated for something that is very simple.

          So I need to serialize the new font f object as well?

          edit oops - how do I make text bold and underlined?
          Last edited by Mindset; 03-05-2010, 03:48 AM.

          Comment


            #6
            Mindset, not tested right now, but believe this should do it -

            Code:
             
            Font f = new Font("Arial", 8, FontStyle.Bold & FontStyle.Underline);
            BertrandNinjaTrader Customer Service

            Comment


              #7
              Bold + Underline

              thanks Bertrand that would have taken me an age to figure out!
              I understood | to mean 'or' - logically shouldn't it be '&'?

              mmm - we ought to see that your post has been edited... your revision with the & strangely doesn't work, but | does. Bizarre.
              Last edited by Mindset; 03-05-2010, 04:56 AM. Reason: Question

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by GussJ, 03-04-2020, 03:11 PM
              15 responses
              3,268 views
              0 likes
              Last Post xiinteractive  
              Started by Tim-c, Today, 02:10 PM
              1 response
              7 views
              0 likes
              Last Post NinjaTrader_ChelseaB  
              Started by Taddypole, Today, 02:47 PM
              0 responses
              2 views
              0 likes
              Last Post Taddypole  
              Started by chbruno, 04-24-2024, 04:10 PM
              4 responses
              50 views
              0 likes
              Last Post chbruno
              by chbruno
               
              Started by TraderG23, 12-08-2023, 07:56 AM
              10 responses
              401 views
              1 like
              Last Post beobast
              by beobast
               
              Working...
              X