void InitNavigateBarButton() { // Control this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.UpdateStyles(); //this.ResizeRedraw = true; this.MinimumSize = new Size(NavigateBar.OVER_FLOW_BUTTON_WIDTH, minimumButtonHeight); this.Cursor = Cursors.Hand; // Menu menu = new ButtonContextMenu(this); this.ContextMenuStrip = menu; // ToolTip toolTip = new ToolTip(); toolTip.ShowAlways = true; // OverFlowPanelButton (Panel içerisine sığmadığında overflowpanel içerisinde bu eleman gösteriliyor) // If cannot display navigatebutton then show this button on overflowpanel overFlowPanelButton = new NavigateBarOverFlowPanelButton(this); overFlowPanelButton.NavigateBarButton = this; overFlowPanelButton.IsSelected = isSelected; // ContextMenuItem (OverFlowPanel sığmadığında menüde bu eleman gösteriliyor) // If cannot display on overflowpanel then show on contextmenu contextMenuItem = new NavigateBarOverFlowPanelMenuItem(this, false); contextMenuItem.Click += delegate(object sender, EventArgs e) { this.PerformClick(); }; }
void InitNavigateBarButton() { // Control this.SetStyle(ControlStyles.UserPaint, true); this.SetStyle(ControlStyles.AllPaintingInWmPaint, true); this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true); this.SetStyle(ControlStyles.ResizeRedraw, true); this.UpdateStyles(); //this.ResizeRedraw = true; this.MinimumSize = new Size(NavigateBar.OVER_FLOW_BUTTON_WIDTH, minimumButtonHeight); this.Cursor = Cursors.Hand; // Menu menu = new ButtonContextMenu(this); this.ContextMenuStrip = menu; // ToolTip toolTip = new ToolTip(); toolTip.ShowAlways = true; // OverFlowPanelButton (Panel içerisine sığmadığında overflowpanel içerisinde bu eleman gösteriliyor) // If cannot display navigatebutton then show this button on overflowpanel overFlowPanelButton = new NavigateBarOverFlowPanelButton(this); overFlowPanelButton.NavigateBarButton = this; overFlowPanelButton.IsSelected = isSelected; // ContextMenuItem (OverFlowPanel sığmadığında menüde bu eleman gösteriliyor) // If cannot display on overflowpanel then show on contextmenu contextMenuItem = new NavigateBarOverFlowPanelMenuItem(this, false); contextMenuItem.Click += delegate(object sender, EventArgs e) { this.PerformClick(); }; }