Solved

ToolStrip OverflowButton appearance is too small

Posted on 2014-12-03
2
343 Views
Last Modified: 2014-12-08
I have become the developer for an existing application with a System.Windows.Form.SplitContainer. On the left side of the container is a TreeView control that, based on selection, determines what is seen in the right side of the container.  The right side is setup with a Tool Strip pinned to the upper left corner and area for displaying various configurations of the selected left side node.  The ToolStrip contains 1 -> n buttons (based on how many configurations there are). The CanOverflow property is True.  The OverflowButton is correctly not displayed when not needed and is displayed correctly when the user either resizes the window of the application or when there are too many buttons to be displayed across the toolstrip.  However, the OverflowButton and arrow are too small for the user to notice that there are more items (see image).  
I set the following properties of the OverflowButton in hopes that the button would be wider and have the image on the button but it seems nothing I do works.  How can I change the appearance of the OverflowButton item.
 

this.toolStrip1.OverflowButton.AutoSize = false;
this.toolStrip1.OverflowButton.Size = new Size(50, 25);
this.toolStrip1.OverflowButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
this.toolStrip1.OverflowButton.Image = global::MyApp.Properties.Resources.NavButtonRight;ToolStrip Overflow ButtonI have become the developer for an existing application with a System.Windows.Form.SplitContainer. On the left side of the container is a TreeView control that, based on selection, determines what is seen in the right side of the container.  The right side is setup with a Tool Strip pinned to the upper left corner and area for displaying various configurations of the selected left side node.  The ToolStrip contains 1 -> n buttons (based on how many configurations there are). The CanOverflow property is True.  The OverflowButton is correctly not displayed when not needed and is displayed correctly when the user either resizes the window of the application or when there are too many buttons to be displayed across the toolstrip.  However, the OverflowButton and arrow are too small for the user to notice that there are more items (see image).  
I set the following properties of the OverflowButton in hopes that the button would be wider and have the image on the button but it seems nothing I do works.  How can I change the appearance of the OverflowButton item.
 

this.toolStrip1.OverflowButton.AutoSize = false;
this.toolStrip1.OverflowButton.Size = new Size(50, 25);
this.toolStrip1.OverflowButton.DisplayStyle = ToolStripItemDisplayStyle.Image;
this.toolStrip1.OverflowButton.Image = global::MyApp.Properties.Resources.NavButtonRight;
0
Comment
Question by:lindat98
2 Comments
 
LVL 96

Accepted Solution

by:
Bob Learned earned 500 total points
Comment Utility
Take a look at this Code Project article.  The sample code shows a custom ToolStripRenderer, and has bitmaps for the overflow button.

ToolStrip Custom Renderers
http://www.codeproject.com/Articles/12785/ToolStrip-Custom-Renderers
0
 

Author Closing Comment

by:lindat98
Comment Utility
Thank you.  The article and code very informative.  I had steered away from a custom renderer but I feel more confident seeing the examples.
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

The purpose of this article is to demonstrate how we can use conditional statements using Python.
When we want to run, execute or repeat a statement multiple times, a loop is necessary. This article covers the two types of loops in Python: the while loop and the for loop.
The goal of this video is to provide viewers with basic examples to understand and use conditional statements in the C programming language.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now