Solved

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

Posted on 2000-03-05
3
194 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
ID: 2586619
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
ID: 2586622
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
ID: 2586626
Hi,

This site may help U out.

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

VinExpert
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
move a line in eclipse 3 109
Smart Camera scanning and reading information 3 121
lucky13 challenge 11 158
Capture logon name 13 104
This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Ownerdraw of the grid button.  A singleton class implentation and usage. Continuing from the fifth article about sudoku.   Open the project in visual studio. Go to the class view – CGridButton should be visible as a class.  R…
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.
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

749 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