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 Hwop38, 05-04-2026, 07:02 PM
    0 responses
    176 views
    0 likes
    Last Post Hwop38
    by Hwop38
     
    Started by CaptainJack, 04-24-2026, 11:07 PM
    0 responses
    331 views
    0 likes
    Last Post CaptainJack  
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    254 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    356 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    184 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Working...
    X