/// <summary> /// Initializes a new instance of the MonthCalendarAdv class. /// </summary> public TimeSelector() { this.SetStyle(ControlStyles.Selectable, false); _TimeSelector = new TimeSelectorItem(); _TimeSelector.GlobalItem = false; _TimeSelector.ContainerControl = this; _TimeSelector.Stretch = false; _TimeSelector.Displayed = true; _TimeSelector.Style = eDotNetBarStyle.StyleManagerControlled; this.ColorScheme.Style = eDotNetBarStyle.StyleManagerControlled; _TimeSelector.SetOwner(this); _TimeSelector.SelectedTimeChanged += new EventHandler(TimeSelector_SelectedTimeChanged); _TimeSelector.OkClick += new EventHandler(TimeSelector_OkClick); this.SetBaseItemContainer(_TimeSelector); }
protected override PopupItem CreatePopupItem() { ButtonItem button = new ButtonItem("sysPopupProvider"); button.PopupClose += new EventHandler(DropDownPopupClose); ItemContainer container = new ItemContainer(); container.LayoutOrientation = eOrientation.Horizontal; container.BackgroundStyle.Padding = 4; MonthCalendarItem mc = new MonthCalendarItem(); mc.CalendarDimensions = new Size(1, 1); //mc.DayClickAutoClosePopup = false; //mc.BackgroundStyle.BackColor = SystemColors.Window; mc.DateChanged += new EventHandler(PopupSelectedDateChanged); container.SubItems.Add(mc); button.SubItems.Add(container); LabelItem sep = new LabelItem(); sep.Width = 8; sep.AutoCollapseOnClick = false; sep.Visible = false; container.SubItems.Add(sep); TimeSelectorItem timeSelector = new TimeSelectorItem(); timeSelector.SelectorType = eTimeSelectorType.MonthCalendarStyle; timeSelector.SelectedTimeChanged += new EventHandler(TimeSelectorChanged); timeSelector.TimeFormat = _TimeSelectorTimeFormat; timeSelector.Visible = false; container.SubItems.Add(timeSelector); _PopupItem = button; _MonthCalendar = mc; _TimeSelector = timeSelector; _Spacer = sep; UpdateTimeSelectorItemSize(); return button; }