コード例 #1
0
        /// <summary>
        /// Visual Init.
        /// </summary>
        private void InitializeComponentSelf()
        {
            components           = new Container();
            _shortcutContextMenu = new ContextMenu();
            _miDeleteShortcut    = new MenuItem();
            _tooltip             = new ToolTip(components);
            SuspendLayout();
            //
            // _chevronBar
            //
            _chevronBar = new ChevronBar();
            _chevronBar.SetSite(this);
            _chevronBar.AllowDrop              = true;
            _chevronBar.Name                   = "_chevronBar";
            _chevronBar.TabIndex               = 1;
            _chevronBar.ChevronMenuItemClick  += OnChevronMenuItemClick;
            _chevronBar.DragDrop              += OnDragDropAny;
            _chevronBar.DragEnter             += OnDragEnterAny;
            _chevronBar.BackColor              = SystemColors.Control;
            _chevronBar.GetChevronMenuText     = OnGetChevronMenuText;
            _chevronBar.SeparateHiddenControls = true;
            _chevronBar.AllowOversizing        = true;
            //
            // _shortcutContextMenu
            //
            _shortcutContextMenu.MenuItems.AddRange(new MenuItem[] { _miDeleteShortcut });
            //
            // miDeleteShortcut
            //
            _miDeleteShortcut.Index  = 0;
            _miDeleteShortcut.Text   = "Delete Shortcut";
            _miDeleteShortcut.Click += miDeleteShortcut_Click;

            // Grip
            _grip = new Grip(this);
            _grip.SetSite(this);

            //
            // ShortcutBar
            //
            Controls.Add(_chevronBar);
            AllowDrop  = true;
            Name       = "ShortcutBar";
            Font       = new Font("Tahoma", 8.25F, FontStyle.Bold, GraphicsUnit.Point, ((Byte)(204)));
            Text       = "Shortcuts";
            Size       = new Size(308, 30);
            DragEnter += OnDragEnterAny;
            DragDrop  += OnDragDropAny;
            ResumeLayout(false);

            SetStyle(ControlStyles.AllPaintingInWmPaint
                     | ControlStyles.CacheText
                     | ControlStyles.ContainerControl
                     | ControlStyles.ResizeRedraw
                     | ControlStyles.Selectable
                     | ControlStyles.UserPaint
                     | ControlStyles.Opaque
                     , true);
        }