c# - Use NumericUpDown to select days in month -


windows form application numericupdown , datetimepicker. using datetimepicker allow user select time (21.20) want use numericupdown allow user select day.

how set numericupdown allow user select valid day based on number of days in current month?

use datetime.daysinmonth() function set maximum() property of numericupdown() in load() event of form:

    private void form1_load(object sender, eventargs e)     {         numericupdown1.maximum = datetime.daysinmonth(datetime.today.year, datetime.today.month);     } 

Comments

Popular posts from this blog

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

c++ - OpenMP unpredictable overhead -

javascript - Wordpress slider, not displayed 100% width -