Ejemplo n.º 1
0
        private void RenderDropDown(Graphics g, RibbonThemaSettingsBase settings, Rectangle itemBounds, Rectangle iconBounds)
        {
            switch (this.ItemSize)
            {
            case RibbonItemSize.Big:
            {
                if (this.EnabledDropDown)
                {
                    int       dx = itemBounds.Left + (int)(itemBounds.Width - ButtonDropDownWidth) / 2;
                    int       dy = itemBounds.Bottom - ButtonDropDownHeight - ButtonTextPadding;
                    Rectangle dr = new Rectangle(dx, dy, ButtonDropDownWidth, ButtonDropDownHeight);
                    settings.DrawDownDropDownTriangle(g, settings.ButtonDropDownLight, settings.ButtonDropDownDark, dr);
                }
            }
            break;

            case RibbonItemSize.Small:
            case RibbonItemSize.Compact:
            case RibbonItemSize.ToolStrip:
            {
                if (this.EnabledDropDown)
                {
                    int       dx = itemBounds.Right - ButtonDropDownWidth - ButtonTextPadding;
                    int       dy = itemBounds.Top + (int)(itemBounds.Height - ButtonDropDownHeight) / 2;
                    Rectangle dr = new Rectangle(dx, dy, ButtonDropDownWidth, ButtonDropDownHeight);
                    settings.DrawDownDropDownTriangle(g, settings.ButtonDropDownLight, settings.ButtonDropDownDark, dr);
                }
            }
            break;
            }
        }
Ejemplo n.º 2
0
 private void RenderDropDown(Graphics g, RibbonThemaSettingsBase settings, Rectangle itemBounds)
 {
     if (this.DropDown != null)
     {
         int       dx = itemBounds.Right - ButtonDropDownWidth - ButtonDropDownPadding;
         int       dy = itemBounds.Top + (int)(itemBounds.Height - ButtonDropDownHeight) / 2;
         Rectangle dr = new Rectangle(dx, dy, ButtonDropDownWidth, ButtonDropDownHeight);
         settings.DrawDownDropDownTriangle(g, settings.ButtonDropDownLight, settings.ButtonDropDownDark, dr);
     }
 }