Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

range check

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

    range check

    hello, I have the following code in my properties section:

    [GridCategory("01. Test ")]
    [Gui.Design.DisplayNameAttribute("01. Test Value")]
    public int AutoRefreshHour
    {
    get { return testVal; }
    set { testVal= Math.Max(1, value); }
    }


    Is there a way I can check that the entered value is between 1 and 10 in this statement?

    thanks

    #2
    Hello FCatan,

    Thanks for your post.

    You can limit the input to be between 1 and 10 via:

    set { testVal= Math.Min (10, Math.Max(1, value)); }

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Geovanny Suaza, 02-11-2026, 06:32 PM
    0 responses
    585 views
    0 likes
    Last Post Geovanny Suaza  
    Started by Geovanny Suaza, 02-11-2026, 05:51 PM
    0 responses
    340 views
    1 like
    Last Post Geovanny Suaza  
    Started by Mindset, 02-09-2026, 11:44 AM
    0 responses
    103 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by Geovanny Suaza, 02-02-2026, 12:30 PM
    0 responses
    554 views
    1 like
    Last Post Geovanny Suaza  
    Started by RFrosty, 01-28-2026, 06:49 PM
    0 responses
    552 views
    1 like
    Last Post RFrosty
    by RFrosty
     
    Working...
    X