private void ShowPopupForm() { if (_popupForm == null) { _popupForm = new CalendarPopup(this); _popupForm.Disposed += new EventHandler(PopupFormDisposed); _popupForm.Accept += new EventHandler(PopupFormAccepted); } if ((_textBox.DataField != null) && _textBox.DataField.HasValue()) { _popupForm.DateTime = DateTime; } else { _popupForm.DateTime = System.DateTime.Today; } _popupForm.Show(); }
private void PopupFormDisposed(object sender, EventArgs args) { _popupForm.Disposed -= new EventHandler(PopupFormDisposed); _popupForm = null; }