Solved

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

Posted on 2000-03-05
3
203 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Independent Software Vendors: 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

Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
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.
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

724 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