[原创]datetimepicker中value值的一点体会

在使用datetimepicker时,当本空间的month值小于10时,在messagebox.show()时,两位的月份(如02)就变为一位了(如2)。解决方法是添加一个函数:

public string aaa(string month)

{

    int month_int=convert.toint32(month);

    if(month_int<10)

    {

        string _month=”0”+month;

        return _month;

    }

    else

    {

        return month;

    }

}

posted @ 2010-01-24 10:24  RainUU  阅读(545)  评论(0编辑  收藏  举报