/// <summary> /// 클릭이벤트 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dateNavigator_Click(object sender, EventArgs e) { CalendarHitInfo info = dateNavigator.GetHitInfo(e as MouseEventArgs); if (info.InfoType.Equals(CalendarHitInfoType.DecMonth) || info.InfoType.Equals(CalendarHitInfoType.IncMonth)) { //월을 변경하면 RefreshCalendar(_storeCode, _itemCode); schedulerControl.ActiveViewType = SchedulerViewType.Month; //캘린더의 뷰타입을 월 형식으로 변환 } }
protected override void OnItemClick(CalendarHitInfo hitInfo) { DayNumberCellInfo cell = (DayNumberCellInfo)hitInfo.HitObject; if (View == DateEditCalendarViewType.YearInfo) { DateTime date = new DateTime(DateTime.Year, cell.Date.Month, 1); OnDateTimeCommit(date, false); } else { base.OnItemClick(hitInfo); } }
private void dateNavigator_Click(object sender, EventArgs e) { DateNavigator dateNavigator; if ((dateNavigator = sender as DateNavigator) == null) { return; } CalendarHitInfo info = dateNavigator.GetHitInfo(e as MouseEventArgs); if (info.HitTest == CalendarHitInfoType.DecMonth || info.HitTest == CalendarHitInfoType.IncMonth) { Debug.WriteLine("Month is changed"); } }
private DateTime GetDateNavigatorCellDateTimeFromPoint(Point p) { Point pt = Point.Empty; this.Invoke(new MethodInvoker(delegate() { pt = dateNavigator1.PointToClient(p); })); CalendarHitInfo hitInfo = dateNavigator1.GetHitInfo(new MouseEventArgs(MouseButtons.None, 0, pt.X, pt.Y, 0)); if (hitInfo.HitTest == CalendarHitInfoType.MonthNumber) { CalendarCellViewInfo cell = hitInfo.HitObject as CalendarCellViewInfo; return(cell.Date); } return(DateTime.MinValue); }
private void dateNavigator1_MouseMove(object sender, MouseEventArgs e) { Point cp = dateNavigator1.PointToClient(Form1.MousePosition); MouseEventArgs mea = new MouseEventArgs(e.Button, e.Clicks, cp.X, cp.Y, e.Delta); CalendarHitInfo chi = dateNavigator1.GetHitInfo(mea); if (chi.HitObject != null) { string date = chi.HitDate.ToString(); SuperToolTip sTooltip1 = GetToolTipInfo(chi); ToolTipControlInfo ttci = new ToolTipControlInfo(); ttci.ToolTipType = ToolTipType.SuperTip; ttci.SuperTip = sTooltip1; ttci.ToolTipPosition = Form1.MousePosition; ttci.Interval = 500; ttci.Object = date; toolTipController1.ShowHint(ttci); } }
protected override void OnItemClick(CalendarHitInfo hitInfo) { DayNumberCellInfo cell = hitInfo.HitObject as DayNumberCellInfo; if (View == DateEditCalendarViewType.YearInfo) { DateTime dt = new DateTime(DateTime.Year, cell.Date.Month, 1, 0, 0, 0); if (DateMode == DateEditEx.DateResultModeEnum.FirstDayOfMonth) { OnDateTimeCommit(dt, false); } else { DateTime tempDate = dt.AddMonths(1).AddDays(-1); tempDate = new DateTime(tempDate.Year, tempDate.Month, tempDate.Day, 23, 59, 59); OnDateTimeCommit(tempDate, false); } } else { base.OnItemClick(hitInfo); } }
private SuperToolTip GetToolTipInfo(CalendarHitInfo chi) { SuperToolTip sTooltip1 = new SuperToolTip(); AppointmentBaseCollection abc = schedulerStorage2.GetAppointments(chi.HitDate, chi.HitDate.AddDays(1)); ToolTipTitleItem titleItem1 = new ToolTipTitleItem(); //titleItem1.Text = "Date: " + date; // Create a tooltip item that represents the SuperTooltip's contents. ToolTipItem item1 = new ToolTipItem(); item1.Image = Image.FromFile("untitled.bmp"); //SchedulerTooltip.Properties.Resources.untitled; // Add the tooltip items to the SuperTooltip. sTooltip1.Items.Add(titleItem1); sTooltip1.Items.Add(item1); foreach (Appointment apt in abc) { titleItem1.Text += apt.Subject + " "; item1.Text += String.Format("({0}-{1})\n", apt.Start, apt.End); } return(sTooltip1); }
protected override void CalcHitInfo(CalendarHitInfo hitInfo) { base.CalcHitInfo(hitInfo); }