两个textbox,如何页面一加载,一个textbox显示该月的第一天,另一个textbox显示该月的最后一天

解决方案 »

  1.   

    Me.txt1.Text = Date.Now.Month.MinValue
    Me.txt2.Text = Date.Now.Month.MaxValue
      

  2.   

    本月的第一天
    DateTime(year,month,01).Day.ToString();
    本月的最后一天
    DateTime(year,month+1,01).AddDays(-1).Day.ToString();
      

  3.   

    楼上的不行的吧.
    tbBeginTime.Text=DateTime.Now.Month后面没有.MinValue
      

  4.   

    本月的第一天
    DateTime(DateTime.Now.year,DateTime.Now.month,01).Day.ToString();
    本月的最后一天
    DateTime(DateTime.Now.year,DateTime.Now.month+1,01).AddDays(-1).Day.ToString();
      

  5.   

    该天的日期
    本月的第一天
    DateTime(DateTime.Now.year,DateTime.Now.month,01)
    本月的最后一天
    DateTime(DateTime.Now.year,DateTime.Now.month+1,01).AddDays(-1)
      

  6.   

    我是这样做的:本月第一天:
    textbox1.Text = DateSerial(Year(a), Month(a), 1)
    本月最后一天:
    textbox2.Text = DateSerial(Year(a), Month(a) + 1, 1 - 1)