Пример #1
0
        /// <summary>
        /// 날짜 박스 패널을 추가합니다.
        /// </summary>
        /// <param name="Date"></param>
        private void AddDate(DatePanel Date)
        {
            Date.DateClickEventHandler += DateClickListener;
            Date.Location = new Point(DrawingX, DrawingY);
            Date.Size     = new Size(ControlWidth, ControlHeight);

            this.Controls.Add(Date);

            if (Date.dt.DayOfWeek == DayOfWeek.Saturday)
            {
                DrawingY += ControlHeight;
                DrawingX  = 0;
            }
            else
            {
                DrawingX += ControlWidth;
            }
        }
Пример #2
0
        protected override void OnPaint(PaintEventArgs e)
        {
            // 여기서 그림
            Debug.WriteLine("onPaint Called!");

            Controls.Clear();

            UpperMargin = Height / 5;
            fontSize    = Height / 50;

            DrawingX = 0;
            DrawingY = UpperMargin;

            if (Dates == null)
            {
                Dates = new DatePanel[new DateTime(curDate.Year, curDate.Month, 1).AddMonths(1).AddDays(-1).Day];
            }

            int LineHeight = calculateHeight();

            ControlWidth  = (Width) / 7;
            ControlHeight = (Height - UpperMargin) / LineHeight;

            priorToFirstDays = CalculaterPriorFirstDay();       // 1일 이전의 날짜를 구함
            DrawingX         = priorToFirstDays * ControlWidth;

            DrawYearMonthWeekString(e);       // 년도와 월 요일을 나타내는 String을 그립니다.

            // 날짜 칸 생성
            for (int i = 0; i < Dates.Length; i++)
            {
                if (Dates[i] == null)
                {
                    Dates[i] = new DatePanel(new DateTime(curDate.Year, curDate.Month, i + 1));
                }
                AddDate(Dates[i]);
            }
            base.OnPaint(e);
        }
Пример #3
0
        /// <summary>
        /// 날짜 박스 패널을 추가합니다.
        /// </summary>
        /// <param name="Date"></param>
        private void AddDate(DatePanel Date)
        {
            Date.DateClickEventHandler += DateClickListener;
            Date.Location = new Point(DrawingX, DrawingY);
            Date.Size = new Size(ControlWidth, ControlHeight);

            this.Controls.Add(Date);

            if (Date.dt.DayOfWeek == DayOfWeek.Saturday)
            {
                DrawingY += ControlHeight;
                DrawingX = 0;
            }
            else
            {
                DrawingX += ControlWidth;
            }
        }
Пример #4
0
        protected override void OnPaint(PaintEventArgs e)
        {
            // 여기서 그림
            Debug.WriteLine("onPaint Called!");

            Controls.Clear();

            UpperMargin = Height / 5;
            fontSize = Height / 50;

            DrawingX = 0;
            DrawingY = UpperMargin;

            if (Dates == null)
            {
                Dates = new DatePanel[new DateTime(curDate.Year, curDate.Month, 1).AddMonths(1).AddDays(-1).Day];
            }

            int LineHeight = calculateHeight();

            ControlWidth = (Width ) / 7;
            ControlHeight = (Height - UpperMargin) / LineHeight;

            priorToFirstDays = CalculaterPriorFirstDay();       // 1일 이전의 날짜를 구함
            DrawingX = priorToFirstDays * ControlWidth;

            DrawYearMonthWeekString(e);       // 년도와 월 요일을 나타내는 String을 그립니다.

            // 날짜 칸 생성
            for (int i = 0;i < Dates.Length; i++)
            {
                if (Dates[i] == null)
                {
                    Dates[i] = new DatePanel(new DateTime(curDate.Year, curDate.Month, i + 1));
                }
                AddDate(Dates[i]);

            }
            base.OnPaint(e);
        }