Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Hiding/unhiding sections of code depending on the boolean value of a variable

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

    Hiding/unhiding sections of code depending on the boolean value of a variable

    Is there a guide available that I can take a look at that explain how to hide or unhide sections of inputs depending on a true or false of a variable? Or maybe a simple piece of code I can look at?

    For example you want to use an EMA trendline as a boolean checkbox. If this checkbox is set to true then some display options appear for color of the trend line, length of the EMA line, and displaying the plot on the chart. If the boolean checkbox is false then hide these input options.

    I'm not sure what exactly this is called but I saw it on an indicator and thought it was pretty neat to clean up some user input sections if they aren't being used.

    #2
    Hello Dezorys,

    There is a sample in the help guide that demonstrates that concept, it is a little more complex of a C# topic. What you are describing is modifying the property descriptor collection so the property grid adds or removes properties based on a value. The sample linked below has a section of that sample dedicated to using a bool to toggle other user inputs which is the part you would need to look at.

    Comment

    Latest Posts

    Collapse

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