Solved

How to dynamically create tooltips? without the resource editor help.

Posted on 2000-03-05
3
157 Views
Last Modified: 2013-11-20
Hi,
I have a dynamically created toolbar with a few buttons on it,
and I want to assign a tooltip to each of these buttons in run-time! How do I do it???
 
B.T.W The id's of these buttons are also created in run-time so I cannot use the resource editor help...
 
Thanks in advance
 
Yoav Stahl.
 
 
0
Comment
Question by:ystahl
  • 2
3 Comments
 
LVL 15

Accepted Solution

by:
Tommy Hui earned 600 total points
Comment Utility
Search for TTN_NEEDTEXT in the online help. Basically, you need to set up the tooltip by calling EnableToolTips(TRUE) and then respond to this message. If you search for TTN_NEEDTEXT in the online help, you will come across an article on how to do this.
0
 
LVL 8

Expert Comment

by:VinExpert
Comment Utility
Hi,

Dynamically means, even buttons also u have created dynamically?. Can't go for using the resource editor?. Just U can insert a toolbar give it Ur own ID, and add the buttons and then do

bar = new CToolBar;
      if (!bar->Create(this) ||
            !bar->LoadToolBar(IDR_MY_TOOLBAR))
      {
            TRACE0("Failed to create toolbar\n");
            return ;      // fail to create
      }
      
      bar->SetBarStyle(bar->GetBarStyle() |
            CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

      bar->ShowWindow(SW_SHOW);

here bar is the pointer of CToolBar. Then U can set the tooltips also at the design time!!!.

Try it out.

VinExpert
0
 
LVL 8

Expert Comment

by:VinExpert
Comment Utility
Hi,

This site may help U out.

http://codeguru.developer.com/toolbar/tb_custmsg_tips.shtml

VinExpert
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
bobThere java chalenge 45 82
how do i create updater to My Activex application? 3 74
sumHeights2  challenge 7 75
firstChar challenge 13 83
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video discusses moving either the default database or any database to a new volume.

743 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

16 Experts available now in Live!

Get 1:1 Help Now