private void ComboBoxDataTimeStop_DropDown(object sender, EventArgs eventArgs) { this.axDatePickerDataTimeStop.Left = this.ComboBoxDataTimeStop.Left; this.axDatePickerDataTimeStop.Top = this.ComboBoxDataTimeStop.Top + ComboBoxSelectDateTime.Height + 1; this.axDatePickerDataTimeStop.EnsureVisible(DateTime.Now - TimeSpan.FromDays(90.0)); if (this.axDatePickerDataTimeStop.ShowModal(2, 2) == true) { int nCount = this.axDatePickerDataTimeStop.Selection.BlocksCount; if (nCount > 0) { if (this.axDatePickerDataTimeStop.Selection[nCount - 1].DateEnd > DateTime.Now) { m_DateStop = DateTime.Now; } else { m_DateStop = this.axDatePickerDataTimeStop.Selection[nCount - 1].DateEnd; } this.ComboBoxDataTimeStop.Text = m_DateStop.ToLongDateString(); } } KLineU50ConfigB.PostMessage(this.ComboBoxDataTimeStop.Handle.ToInt32(), CB_SHOWDROPDOWN, 0, 0); }
private void ComboBoxSelectDateTime_DropDown(object sender, EventArgs eventArgs) { this.axDatePickerSelectDataTime.Left = this.ComboBoxSelectDateTime.Left; this.axDatePickerSelectDataTime.Top = this.ComboBoxSelectDateTime.Top + ComboBoxSelectDateTime.Height + 1; this.axDatePickerSelectDataTime.EnsureVisible(DateTime.Now - TimeSpan.FromDays(90.0)); if (this.axDatePickerSelectDataTime.ShowModal(2, 2) == true) { int nCount = this.axDatePickerSelectDataTime.Selection.BlocksCount; if (nCount > 0) { if (this.axDatePickerSelectDataTime.Selection[nCount - 1].DateEnd > DateTime.Now) { m_DateEnd = DateTime.Now; } else { m_DateEnd = this.axDatePickerSelectDataTime.Selection[nCount - 1].DateEnd; } if (this.axDatePickerSelectDataTime.Selection[0].DateBegin > (m_DateEnd - TimeSpan.FromDays(3.0))) { m_DateBegin = m_DateEnd - TimeSpan.FromDays(2.0); } else { m_DateBegin = this.axDatePickerSelectDataTime.Selection[0].DateBegin; } m_DateSelection = m_DateEnd; this.ComboBoxSelectDateTime.Text = m_DateSelection.ToLongDateString(); this.NumericUpDownKLine.Value = (m_DateEnd - m_DateBegin).Days + 1; } } KLineU50ConfigB.PostMessage(this.ComboBoxSelectDateTime.Handle.ToInt32(), CB_SHOWDROPDOWN, 0, 0); }