Click here to Skip to main content
14,971,099 members
Articles / Desktop Programming / Windows Forms
Article
Posted 1 May 2012

Stats

43.3K views
1.8K downloads
3 bookmarked

ToolStrip with Custom ToolTip

Rate me:
Please Sign up or sign in to vote.
5.00/5 (7 votes)
1 May 2012CPOL1 min read
Custom WinForm ToolStrip that fixes some of the ToolTip related problems and adds few related features

Introduction

Stock .NET ToolStrip control has several annoying bugs considering its tooltip:

  • Tooltip is not hidden on click - click is behavior that indicates that user has understood what item is about, so user expects tooltip to be hidden, and the second problem is that click might result in change of tooltip text, so shown tooltip might become irrelevant.
  • Tooltip doesn't care if dropdown is shown - it looks very ugly if item's dropdown is shown over its tooltip, or tooltip over its dropdown.

Also, several tooltip related features are added.

Using the Code

Using ToolStripToolTip is as simple as:

C#
ToolStipToolTip toolStrip1 = new ToolStripToolTip();

Also, you may want to use some of the following properties or objects:

  • Tooltip - I have decided to make Tooltip exposed, as you might sometimes want to hide it on some custom event.
  • ToolTipInterval - integer for interval in ms in which tooltip stays visible. By default, it is 4000.
  • ToolTipText - string for text for tooltip that will be shown for ToolStrip (when mouse is over it, but not over any particular item).
  • ToolTipShowUp - if True, tooltip is shown above the pointer, which is useful if ToolStrip is docked to bottom of Form. By default it is false.

History

  • 2012/05/01 - First version

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Ivan Ičin
CEO Labsii
Serbia Serbia
Speech Central app on Windows, macOS, iOS, Apple TV, Android

Comments and Discussions

 
GeneralMy vote of 5 Pin
Member 124589564-May-16 9:33
MemberMember 124589564-May-16 9:33 
SuggestionAutomatic ShowUp Pin
Sylvain Jérôme4-Jul-13 3:35
MemberSylvain Jérôme4-Jul-13 3:35 
GeneralRe: Automatic ShowUp Pin
Ivan Ičin4-Jul-13 5:01
MemberIvan Ičin4-Jul-13 5:01 
GeneralRe: Automatic ShowUp Pin
Ivan Ičin4-Jul-13 5:17
MemberIvan Ičin4-Jul-13 5:17 
GeneralRe: Automatic ShowUp Pin
dherrmann15-Nov-13 1:14
Memberdherrmann15-Nov-13 1:14 
GeneralRe: Automatic ShowUp Pin
Ivan Ičin10-Dec-13 1:11
MemberIvan Ičin10-Dec-13 1:11 
QuestionWhy no download button? Pin
RenniePet9-Feb-13 10:44
MemberRenniePet9-Feb-13 10:44 
AnswerRe: Why no download button? Pin
Ivan Ičin9-Feb-13 11:07
MemberIvan Ičin9-Feb-13 11:07 
GeneralThank you Pin
RenniePet9-Feb-13 16:23
MemberRenniePet9-Feb-13 16:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.