Source/Ribbon/QatToolbar.cs

(开头部分) 3KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using System;
using System.Text;
using System.ComponentModel;
using System.Windows.Forms;

namespace DevComponents.DotNetBar.Ribbon
{
    /// <summary>
    /// Represents the stand-alone Quick Access Toolbar control
    /// </summary>
    internal class QatToolbar : ItemControl
    {
        #region Private Variables
        private CaptionItemContainer m_ItemContainer = null;
        private ElementStyle m_DefaultBackgroundStyle = new ElementStyle();
        #endregion

        #region Constructor
        public QatToolbar()
        {
            m_ItemContainer = new CaptionItemContainer();
            m_ItemContainer.GlobalItem = false;
            m_ItemContainer.ContainerControl = this;
            m_ItemContainer.WrapItems = false;
            m_ItemContainer.EventHeight = false;
            m_ItemContainer.UseMoreItemsButton = false;
            m_ItemContainer.Stretch = true;
            m_ItemContainer.Displayed = true;
            m_ItemContainer.SystemContainer = true;
            m_ItemContainer.PaddingTop = 0;
            m_ItemContainer.PaddingBottom = 0;
            m_ItemContainer.ItemSpacing = 0;
            m_ItemContainer.SetOwner(this);
            m_ItemContainer.PaddingBottom = 0;
            m_ItemContainer.PaddingTop = 0;
            m_ItemContainer.ItemSpacing = 1;
            m_ItemContainer.TrackSubItemsImageSize = false;
            //m_ItemContainer.ToolbarItemsAlign = eContainerVerticalAlignment.Middle;
            this.SetBaseItemContainer(m_ItemContainer);
            m_ItemContainer.Style = eDotNetBarStyle.Office2007;
        }
        #endregion

        #region Internal Implementation
        protected override ElementStyle GetBackgroundStyle()
        {
            if(this.BackgroundStyle.Custom)
                return base.GetBackgroundStyle();

            return m_DefaultBackgroundStyle;
        }

        protected override void RecalcSize()
        {
            InitDefaultStyles();
            base.RecalcSize();
        }

        protected override void OnPaint(PaintEventArgs e)
        {
后面还有 59 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。