示例#1
0
        /// <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);
            }
        }
示例#2
0
        /// <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);
            }
        }
示例#3
0
        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;
        }
示例#4
0
        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);
                }
            }
        }