Esempio n. 1
0
        //=====================================================================

        /// <summary>
        /// This is used to initialize the drop-down styles and data source
        /// </summary>
        private void InitDropDown()
        {
            // Create and initialize the drop-down control
            if (owner.DropDownControl != null)
            {
                ConstructorInfo ctor = owner.DropDownControl.GetConstructor(Type.EmptyTypes);
                ddControl            = (DropDownControl)ctor.Invoke(null);
                ddControl.Location   = new Point(0, 0);
                ddControl.Anchor     = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
                ddControl.AutoScroll = true;
                ddControl.Font       = owner.DropDownFont;
                ddControl.ComboBox   = owner;

                if (ddControl.BackColor == SystemColors.Control)
                {
                    ddControl.BackColor = owner.DropDownBackColor;
                }

                ddControl.Height = this.Height;
                ddControl.Width  = this.Width;
                this.Controls.Add(ddControl);

                // Tell everyone it has been created
                owner.OnDropDownControlCreated(ddControl);

                // Give the drop-down control a chance to perform any necessary initialization
                ddControl.InitializeDropDown();

                // Tell everyone it has been initialized
                owner.OnDropDownControlInitialized(ddControl);
            }

            hasInitialized = true;
        }
Esempio n. 2
0
        /// <summary>
        /// This raises the <see cref="DropDownControlCreated"/> event
        /// </summary>
        /// <param name="dropDown">The drop-down control</param>
        protected internal virtual void OnDropDownControlCreated(DropDownControl dropDown)
        {
            var handler = DropDownControlCreated;

            if (handler != null)
            {
                handler(dropDown, EventArgs.Empty);
            }
        }
Esempio n. 3
0
        //=====================================================================

        /// <summary>
        /// This is used to initialize the drop-down styles and data source
        /// </summary>
        private void InitDropDown()
        {
            // Create and initialize the drop-down control
            if (owner.DropDownControl != null)
            {
                ConstructorInfo ctor = owner.DropDownControl.GetConstructor(Type.EmptyTypes);
                ddControl            = (DropDownControl)ctor.Invoke(null);
                ddControl.Location   = new Point(0, 0);
                ddControl.Anchor     = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
                ddControl.AutoScroll = true;
                ddControl.Font       = owner.DropDownFont;
                ddControl.ComboBox   = owner;

                if (ddControl.BackColor == SystemColors.Control)
                {
                    ddControl.BackColor = owner.DropDownBackColor;
                }

                // Add 16 pixels so that we can draw the sizing grip
                this.Height      = ddControl.Height + 16;
                this.Width       = ddControl.Width + 2;
                this.MinimumSize = ddControl.MinimumSize;
                this.Controls.Add(ddControl);

                // Tell everyone it has been created
                owner.OnDropDownControlCreated(ddControl);

                // Give the drop-down control a chance to perform any necessary initialization
                ddControl.InitializeDropDown();

                // Tell everyone it has been initialized
                owner.OnDropDownControlInitialized(ddControl);
            }

            // Size the drop-down to the owner's width if it is wider
            if (this.Width < owner.Width)
            {
                this.Width = owner.Width;
            }

            hasInitialized = true;
        }
        //=====================================================================
        /// <summary>
        /// This is used to initialize the drop-down styles and data source
        /// </summary>
        private void InitDropDown()
        {
            // Create and initialize the drop-down control
            if(owner.DropDownControl != null)
            {
                ConstructorInfo ctor = owner.DropDownControl.GetConstructor(Type.EmptyTypes);
                ddControl = (DropDownControl)ctor.Invoke(null);
                ddControl.Location = new Point(0, 0);
                ddControl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
                ddControl.AutoScroll = true;
                ddControl.Font = owner.DropDownFont;
                ddControl.ComboBox = owner;

                if(ddControl.BackColor == SystemColors.Control)
                    ddControl.BackColor = owner.DropDownBackColor;

                // Add 16 pixels so that we can draw the sizing grip
                this.Height = ddControl.Height + 16;
                this.Width = ddControl.Width + 2;
                this.MinimumSize = ddControl.MinimumSize;
                this.Controls.Add(ddControl);

                // Tell everyone it has been created
                owner.OnDropDownControlCreated(ddControl);

                // Give the drop-down control a chance to perform any necessary initialization
                ddControl.InitializeDropDown();

                // Tell everyone it has been initialized
                owner.OnDropDownControlInitialized(ddControl);
            }

            // Size the drop-down to the owner's width if it is wider
            if(this.Width < owner.Width)
                this.Width = owner.Width;

            hasInitialized = true;
        }
        //=====================================================================
        /// <summary>
        /// This is used to initialize the drop-down styles and data source
        /// </summary>
        private void InitDropDown()
        {
            // Create and initialize the drop-down control
            if(owner.DropDownControl != null)
            {
                ConstructorInfo ctor = owner.DropDownControl.GetConstructor(Type.EmptyTypes);
                ddControl = (DropDownControl)ctor.Invoke(null);
                ddControl.Location = new Point(0, 0);
                ddControl.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Bottom | AnchorStyles.Right;
                ddControl.AutoScroll = true;
                ddControl.Font = owner.DropDownFont;
                ddControl.ComboBox = owner;

                if(ddControl.BackColor == SystemColors.Control)
                    ddControl.BackColor = owner.DropDownBackColor;

                ddControl.Height = this.Height;
                ddControl.Width = this.Width;
                this.Controls.Add(ddControl);

                // Tell everyone it has been created
                owner.OnDropDownControlCreated(ddControl);

                // Give the drop-down control a chance to perform any necessary initialization
                ddControl.InitializeDropDown();

                // Tell everyone it has been initialized
                owner.OnDropDownControlInitialized(ddControl);
            }

            hasInitialized = true;
        }
        /// <summary>
        /// This raises the <see cref="DropDownControlInitialized"/> event
        /// </summary>
        /// <param name="dropDown">The drop-down control</param>
        protected internal virtual void OnDropDownControlInitialized(DropDownControl dropDown)
        {
            var handler = DropDownControlInitialized;

            if(handler != null)
                handler(dropDown, EventArgs.Empty);
        }