Solved

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

Posted on 2000-03-05
3
180 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Expand data scrubbing tool 13 32
Named range not carried over 10 63
Process filename extension 3 184
firstChar challenge 13 115
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 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