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 DannyP96, 05-18-2026, 02:38 PM
    1 response
    89 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by CarlTrading, 05-11-2026, 05:56 AM
    0 responses
    143 views
    0 likes
    Last Post CarlTrading  
    Started by CarlTrading, 05-10-2026, 08:12 PM
    0 responses
    83 views
    0 likes
    Last Post CarlTrading  
    Started by Hwop38, 05-04-2026, 07:02 PM
    0 responses
    257 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    334 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Working...
    X