/// <summary> /// Constructor to initialize the for with the control to display. /// </summary> /// <param name="Ctrl">The control to display.</param> public DropDownForm(IDropDownAware Ctrl) : this() { if (Ctrl != null) { _control = Ctrl; InitializeControl(_control as Control); } }
private void DropDownHelper_DropDownClosed(object sender, DropDownClosedEventArgs e) { IDropDownAware dropDown = (e.DropDown as IDropDownAware); if ((dropDown != null) && (dropDown.Value != null)) { dropDown.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing); dropDown.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged); } combo.DroppedDown = false; }
private void DropDownHelper_DropDownCancel(object sender, DropDownCancelEventArgs e) { if (this.Bounds.Contains(Parent.PointToClient(e.CursorLocation))) { e.Cancel = true; } else { IDropDownAware dropDown = (e.DropDown as IDropDownAware); if (dropDown != null) { dropDown.FinishEditing -= new DropDownValueChangedEventHandler(DropDown_FinishEditing); dropDown.ValueChanged -= new DropDownValueChangedEventHandler(DropDown_ValueChanged); } } }