Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hidding a brush from the indicator properties dialog.

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

    Hidding a brush from the indicator properties dialog.

    Hello!
    I have successfully rendered a text. The idea is to prevent the user of changing the color oft he text. In OnBarupdate(), I would have done the following: myColor = Brushes.Green;
    But OnRender() does not accept this declaration/initialization.
    In the section properties, I have the following code:

    HTML Code:
    [XmlIgnore]
    [Display(Name = "MyColor", GroupName = "Parameters")]
    public Brush MyColorBrush
    {
       get { return myColorBrush; }
       set { myColorBrush = value; }
    }
    
    [Browsable(false)]
    public string MyColorBrushSerialize
    {
        get { return Serialize.BrushToString(MyColorBrush); }
        set { MyColorBrush = Serialize.StringToBrush(value); }
    }​


    Is it possible of rendering a text and preventing the text color of being changed? If yes, could one please guides me here?

    Best regards

    #2
    Hello Stanfillirenfro,

    You can add Browsable(false) like you have on the other property to hide that from the UI as well. In that situation you could just use a private variable since it won't be configurable.

    Comment


      #3
      Many thanks NinjaTrader_Jesse for your reply.

      Awsome! Problem solved!

      Thanks again!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by Mindset, 04-21-2026, 06:46 AM
      0 responses
      46 views
      0 likes
      Last Post Mindset
      by Mindset
       
      Started by M4ndoo, 04-20-2026, 05:21 PM
      0 responses
      67 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by M4ndoo, 04-19-2026, 05:54 PM
      0 responses
      35 views
      0 likes
      Last Post M4ndoo
      by M4ndoo
       
      Started by cmoran13, 04-16-2026, 01:02 PM
      0 responses
      95 views
      0 likes
      Last Post cmoran13  
      Started by PaulMohn, 04-10-2026, 11:11 AM
      0 responses
      59 views
      0 likes
      Last Post PaulMohn  
      Working...
      X