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 SalmaTrader, 07-07-2026, 10:26 PM
      0 responses
      31 views
      0 likes
      Last Post SalmaTrader  
      Started by CarlTrading, 07-05-2026, 01:16 PM
      0 responses
      20 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 06-17-2026, 10:32 AM
      0 responses
      9 views
      0 likes
      Last Post CaptainJack  
      Started by kinfxhk, 06-17-2026, 04:15 AM
      0 responses
      17 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Started by kinfxhk, 06-17-2026, 04:06 AM
      0 responses
      20 views
      0 likes
      Last Post kinfxhk
      by kinfxhk
       
      Working...
      X