时段上的选择。

解决方案 »

  1.   


            private void button6_MouseDown(object sender, MouseEventArgs e)
            {
                if (e.Button == MouseButtons.Left)
                {
                    this.button6.ContextMenuStrip =Menu ;
                    this.Menu.Show(Control.MousePosition);
                }
                else
                    this.button6.ContextMenuStrip = null;        }
      

  2.   

    菜单控件,你找找DVEXPRESS这套UI控件,至于显示内容,需要你自己去实现
      

  3.   

            /// <summary>
            /// 获取当月最后一天
            /// </summary>
            /// <param name="DtStart"></param>
            /// <returns></returns>
            private static DateTime GetLastDateForMonth(DateTime DtStart)
            {
                int Dtyear, DtMonth;
                Dtyear = DtStart.Year;
                DtMonth = DtStart.Month;
                int MonthCount = DateTime.DaysInMonth(Dtyear, DtMonth);//計算該月有多少天
                return Convert.ToDateTime(Dtyear.ToString() + "-" + DtMonth.ToString() + "-" + MonthCount);
            }当前月第一天不就是1号么...
      

  4.   

    可以使用快捷菜单(ContextMenuStrip控件)来实现。
      

  5.   

    DateTime 结构
    GregorianCalendar 类
      

  6.   

    第一天就是1日,最后一天就是下个月的第一天减去一天            DateTime dtMatch = new DateTime(2010, 3, 1);
                TimeSpan span = new TimeSpan(1,0,0,0);
                DateTime dtFebLastDay = dtMatch.Subtract(span);
      

  7.   

    有现成的api, DateTime.DaysInMonth返回某年某月的总天数,就是最后一天
                int days = DateTime.DaysInMonth(2010, 2);