예제 #1
0
 protected override void OnPaint(PaintEventArgs e)
 {
     if ((this.multiLineComboBox != null) && (this.multiLineComboBox.DrawMode != DrawMode.Normal))
     {
         this.multiLineComboBox._RaiseDrawItem(new DrawItemEventArgs(e.Graphics, this.Font, e.ClipRectangle, this.multiLineComboBox.SelectedIndex, DrawItemState.ComboBoxEdit, this.ForeColor, this.BackColor));
     }
     else
     {
         if (this.WordWrap)
         {
             base.OnPaint(e);
         }
         else
         {
             base.OnPaintBackground(e);
             Color foreColor = this.ForeColor;
             if (!base.Enabled)
             {
                 foreColor = SystemColors.GrayText;
             }
             ExAppearanceManager.GetAppearanceManager().DrawText(this.Text, this.Font, this.multiLineComboBox.TextAlign, this.multiLineComboBox.TextVerticalAlign, false, e.Graphics, new Rectangle(0, 0, base.Width, base.Height), foreColor);
         }
         if (this.Hilight && this.ShowFocusCues)
         {
             ControlPaint.DrawFocusRectangle(e.Graphics, base.ClientRectangle, Color.Black, this.BackColor);
         }
     }
 }
예제 #2
0
 public static ExAppearanceManager GetAppearanceManager()
 {
     if (apprMgr == null)
     {
         apprMgr = new ExAppearanceManager();
     }
     return(apprMgr);
 }
예제 #3
0
        public void ShowDropDown()
        {
            this.multiLineComboBox._RaiseDropDown(new EventArgs());
            Application.AddMessageFilter(this.filter);
            Point p = new Point(0, this.multiLineComboBox.Height);

            p = this.multiLineComboBox.PointToScreen(p);
            if (((p.Y + base.Height) > Screen.GetBounds(this).Height) && (p.Y > ((Screen.GetBounds(this).Height + this.multiLineComboBox.Height) / 2)))
            {
                this.dropDownDir = DropDownDirection.upward;
                p.Offset(0, -this.multiLineComboBox.Height);
            }
            else
            {
                this.dropDownDir = DropDownDirection.downward;
            }
            if ((base.Width < Screen.GetBounds(this).Width) && ((p.X + base.Width) > Screen.PrimaryScreen.WorkingArea.Width))
            {
                p.X = Screen.GetBounds(this).Width - base.Width;
            }
            if ((p.X < 0) && (base.Width <= Screen.GetBounds(this).Width))
            {
                p.X = 0;
            }
            this.dropDownListBox.Height = this.CalcDropDownHeight() + 2;
            this.dropDownOrigin         = p;
            if (ExAppearanceManager.GetAppearanceManager().DoSlideOpenComboBox() && (this.multiLineComboBox.SlidingDropDown == MultiLineComboBoxEffect.Standard))
            {
                dropDownAnimFrameNum = 10;
            }
            else
            {
                dropDownAnimFrameNum = 1;
            }
            this.dropDownAnimTimer.Interval = dropDownAnimOpenTime / dropDownAnimFrameNum;
            this.DropDownAnimation();
            base.Visible = true;
            this.dropDownListBox.Height = this.CalcDropDownHeight() + 2;
            this.dropDownAnimCount      = 0;
            this.DropDownAnimation();
        }