Tooltip in CListCtrl

Hi all

I have been trying now for a couple of days to figure out a way to display a
tooltip over individual items in a CListCtrl. My control is in Report style,
and has two columns where the first contains keys, and the second values.
Problem is the keys do not have a lot of room, and I would like a tooltip to
give a better description of what the key actually refers to.

I found an article on Codeguru describing how this could be done, but I did
not work for me - my override of CWnd::OnToolHitTest was never called by the
framework as the article stated it would... For all I know this article is
outdated - published in 1998 - now I run Win XP which might be a different

Anyway: On the surface CListCtrl seems to have a good built in support for
tooltips. Functions like SetInfoTip, and SetToolTips seem to have a lot of
promise. But after studying the documentation I still could not figure out
how to make them work. I tried using SetInfoTip by sending it a
LVFSETINFOTIP structure. MSDN Library states that this structure should be
available when including commctrl.h and running Windows XP. I run XP and
included commctrl.h, but still the VC7.1 compiler complained that
LVFSETINFOTIP was an undeclared identifier, even though it apparently found
and read commctrl.h.

Now I am at a loss for what to do...
Does anyone have a tip to give my keys a tip? Preferably I would like to
find a way to use the built in support, but if this is unusable (which is
hard to believe?) then any other solutions are quite welcome too.

Thanks for any assistance!


Kit1 (1)
5/9/2004 9:24:45 PM
vc.mfc 33608 articles. 0 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 1


Similar Artilces:

Tooltip presentation of "Task name/Description" with roll-over to
Dear all, Is there any way to manage the appearance of Task name/Description on a tooltip with roll-over to Timesheet Grid Column Day Units of Timesheet View page (of Project Server 2007)? As the User Interface in this page is not so wide and the user needs to horizontally scroll, sometimes the Task Name is not visible and user needs to scroll on the left again to find it. Is it possible through javascript, WebPart or through the relative aspx page? I'll appreciate any help on that. Kind regards, Konstantinos Christodoulakis Senior Project Manager Hi Konstantinos,...

CListCtrl not refreshed
Hi, I use a simple CListCtrl within a Tab Control. When I highlight something on the CListCtrl and then switch to another window and then back to my application, the CListCtrl is not shown, when clicking on its area then the line you clicked on shows up again. Tabbing back and forth restores the situation as usual. It looks like the CListCtrl does not get refreshed. All other controls in the same tab are always displayed correctly, it seems to be something peculiar of the CListCtrl when having something selected. This problem is driving me crazy, could any of you help? plvplv66-at-yahoo-d...

Where's the bug in ClistCtrl ?
I have written a small test dialog based application with CListCtrl, and found very unusual behaviour when I delete all columns and items and then re-populate the list, it doesn't show up anything! Example : BOOL CMyDlg::OnInitDialog() { .... // standard lines m_list.SetExtendedStyle(m_list.GetExtendedStyle() | LVS_EX_FULLROWSELECT ); return TRUE; } void CMyDlg::OnButton1() { // Filling the list with two columns CRect rect; LV_ITEM lvitem; m_list.GetWindowRect(&rect); m_list.InsertColumn(0, "Column1", LVCFMT_LEFT, rect.Width() * 1/3, 0); m_list.I...

Tooltips for CComboBoxEx
I have implemented tooltips in my dialog using "ON_NOTIFY_EX(TTN_NEEDTEXT, 0, NotifyToolTips)" message map. However the CComboBoxEx on the dialog is the only control which does not show a tooltip. How do I get tooltips workign with a CComboBoxEx? Thanks See if this helps: ------------- Ajay Kalra ...

CListCtrl mouse selection
I am using a CListCtrl int report view with multiple columns. What I notice is that to select an item you have to click on and item in the first column. What I would like is a hilight bar right the way across when something is slected. This, presumably is owner draw territory and I will have to render the list entries myself to get the desired effect? "Spacen Jasset" <> wrote in message news:cbveft$kg6$ > I am using a CListCtrl int report view with multiple columns. What I notice > is that to select an item you have to c...

I'm trying out the TTF_PARSELINKS flag on my tooltip. I get a link that looks fine, but I'm having problems clicking it, because if I move the cursor onto the ToolTip it immediately disappears. Any clues? Bendik Hi, The link feature is implemented only in version 6.00 of the common controls, you simply need to include a manifest and add the flag TTF_PARSELINKS in the toolInfo::uFlags. Hope t...

Tooltip with user input
Hi everybody, I'm developping a new component that is similar to windows start menu except the fact that the menu appears when I put the mouse over the component. So its some kind of a tooltip but with user input. Almost everything works but I still got some problems. First, my window (menu component) is a child of desktop window in order to display it outside of its parent (a CStatic), second it is topmost window to display it over every window. The problems I got are: - my tooltips (the ones on my menu's buttons) doesn't display over my window but behind it - I want to hide ...

Hello! This may be asking a lot from Excel, but is there a way to do th following, in Excel 2000: When you move the cursor over a cell with a date in it, for a toolti to appear above it showing the difference in days between that date an today? Thanks, Dan -- Message posted from Cells do not have tool tips. The nearest thing may be cell comments but cell comments are static text. You could use a macro to add the comment text you want to all date cells but it would have to be re-run every day. This example works on date cells in the current selection. Sub Date...

"Formatted Tooltip" or "Link in Tooltip"
Hi, i want to underline a line in a multiline tooltip. Is this possible? How does this work ? My collegue told me, that there is a possibility with a link, but string <A>this is a link </a> doesnt' work. Why? Thanx in advanced Detlef Here is a great tooltip control that does what you want (and more). AliR. "Detlef" <> wrote in message news:et9V21pkFHA.2916@TK2MSFTNGP14.phx.gbl... > Hi, > > i want to underline a line in a multiline tooltip. Is this possible? How > does t...

Problems with CListCtrl
I'm having trouble with a CListCtrl object. I'm trying to automatically set the selected items of the list from my code. I try the following statement: m_List.SetItem (pos, 0, LVIF_STATE, NULL, 0, LVIS_SELECTED, LVIS_SELECTED, 0); The SetItem function returns non-zero, which supposedly means it was successful. However, I don't see any selection showing up. I even called RedrawItem on this list item, but it didn't help either. Anyone know about this? -Eric >I'm having trouble with a CListCtrl object. I'm trying to automatically >set the selected ite...

CTreeCtrl and CListCtrl problem
I use create a single document struct using MFC(explore style).The left of the window is CLeftView class(which inherit CTreeView).The right is CBrowserView which inherit CListView.I want to display the content of a directory in the right(CListview) when user click the item of the ctreectrl. In the LeftViw I add method "void CLeftView::OnClickItem (NMHDR* pNMHDR, LRESULT* pResult)" because I want to know which item be clicked by user. ////////////////Leftview////////////////////// CTreeCtrl& mtree=GetTreeCtrl(); HTREEITEM item=mtree.GetSelectedItem(); data=mtree.GetItemDat...

CListCtrl Item Selection Questions
Hi I want to ask several things about CListCtrl here: 1. How to disable multiple item selection? 2. How to disable the column header click? Since I don't have any sorting facility in my application. Thank you very much. Select the ListCtrl object in resource editor and set the following properties Single Selection True No Sort Header True Cheers Check Abdoul --------------------- "Landon" <> wrote in message > Hi I want to ask severa...

Unable to use CListCtrl.FindItem after CListCtrl.SortItems
I have a CListCtrl which I want to sort, but after I sort I can no longer use FindItem because it always returns a failure. Any assistance with this is greatly appreciated. Thanks! >I have a CListCtrl which I want to sort, but after I sort I can no longer >use FindItem because it always returns a failure. Any assistance with this >is greatly appreciated. Show a concise code example of what you're doing then someone may be able to point out what's wrong. Dave -- MVP VC++ FAQ: LVFINDINFO findinfo; findinfo.flags=LVFI_STRING;

ToolTip on a CComboBox
I have a CComboBox and I tried to add a tooltip for it. I am using the same CToolTipCtrl for several other controls and it works just fine. It is not working for the CComboBox. The ComboBox has these styles CBS_AUTOHSCROLL|CBS_SORT|CBS_DROPDOWN|WS_VISIBLE|WS_VSCROLL|WS_CHILD|WS_TABS TOP. Do I have to do something different to tooltip a combobox like put the tooltip on the ComboBox edit control to make it work? Examples? Thanks. Hello With Regards R.Selvam ...

CListCtrl #14
I'm trying to create a derived version of CListCtrl for a CDialog app. The data in the control will be read-only, so I want to make the column headers fixed-width, and (ideally) prevent cell selection. My first instinct was to use the ClassWizard to add handlers for the notification messages, but for some reason these aren't ever called. OnNotify is called, but I'm not seeing the messages I'd expect (e.g. when I resize a header, HDN_BEGINTRACK never happens), and the control doesn't seem to listen when I tell it to ignore the message anyway. Any thoughts? Erik J ...

How do I turn off ToolTips ?
Hello: How do I turn off ToolTips ? Thank you Drew Drew, When you Googled this, which of the remedies have you tried ? BB "Frank Drew Leyda" <> wrote in message news:eJ4Xdi$4KHA.3880@TK2MSFTNGP04.phx.gbl... > Hello: > > How do I turn off ToolTips ? > > Thank you > > Drew > > How do I turn off ToolTips ? > > Thank you > > Drew ******************************************************* In Search box "Regedit" Find &quo...

Tooltip for MSFlexGrid Cells
I have a MSFlexGrid control in my application inserted as an activex control. It is non editable. I want to set tooltips for each cell in first row and first column. How could i achieve this? How about a CToolTipCtrl? The following example uses this class in a dialog, but you could use the same principle with a ListCtrl M "Ana4raj" <> wrote in message >I have a MSFlexGrid control in my applica...

Balloon Tooltips
I'm trying to use the balloon style tooltip to display a validation message when a user clicks OK and data is out of wack. Here's what I have: in dialog.h CToolTipCtrl m_validationToolTipCtrl; in .cpp CDialog::OnInitDialog() { // Create tooltip control TOOLINFO ti; DWORD dwStyle = TTS_BALLOON; m_validationToolTipCtrl.Create(this, dwStyle); m_validationToolTipCtrl.FillInToolInfo(ti, this, 0); ti.uFlags |= (TTF_TRACK | TTF_CENTERTIP | TTF_ABSOLUTE); ti.lpszText = (LPTSTR)_T("<message>"); m_validationToolTipCtrl.SetTitle (2, _T("Validation Error"));...

Selected item on a CListCtrl
Hello Kind of trivial, but I can't figure it out: How can I obtain the position, or make reference to a selected SUBITEM on a CListCtrl object. GetFirstSelectedItem works for the item as a whole line. But If I have subitems, how can I single it out? By the way, my compiler is not recognizing Get SelectedColumn as a member of CListCtrl. Thanks a lot in advance You must control the mouse click position.. #define SUBITEM_POS 2 // Subitem column void AListView::OnLButtonDown(UINT nFlags, CPoint point) { CListCtrl &list = GetListCtrl(); UINT uFlags = 0; int nHitItem = list....

Adding CTreeCtrl in CListCTrl
Hi All, I need to develop an application in which "Each of the element of a list is a tree object". For example my application should look like following :- Item A Selection ID0 yes - a1 -a2 -junk ID2 no - a14r43f -aefrefer -junk effref ID7 yes - acef1 -a2regrtg -junk rgrgrt please suggest. I need it urgently. Thanks, Abhijit <> wrote in message news:53376353-2c28-43e1-9e71-e2...

How to display tooltip for disabled buttons in VC++
Hi all, Kindly clarify my doubt I am developing the dialog based application in VC++. I have created 10 buttons having captions like Bold, Italic, Underline, Right alignment, etc. Some buttons can be enabled and some disabled. My question is: The tooltip is active ONLY for the enabled buttons. I need to implement tooltip for the disabled buttons also It will be great if anyone could help me Thanks in Advance, Chinna -- Hard Work Never Fails ...

thumbnail in CListCtrl cell
Hi there, I've found ways to put icon in a CListCtrl (report view) cell. But when I tried to change the icon to a bitmap, which is bigger, the reults is just empty cell. Is there any way to enlarge the cell so that my bitmap could fit in? How about this source, I made it and still have some problem in thread, I think it can help you. ...

How to sort CListCtrl without changing the per-item data?
Hi, I'm using visual c++ 6. I want to sort the CListCtrl. But I don't want to use SetItemData because I want to use the per-item data in another place. Can I sort the CListCtrl without changing the per-item data? Thanks in advanced. You could use a virtual list control and then just sort your external data (any way you want actually). Tom "bucher" <> wrote in message news:eQ3r7AUkHHA.4676@TK2MSFTNGP02.phx.gbl... > Hi, > > I'm using visual c++ 6. I want to sort the CListCtrl. But I don't want to > use SetItemData because I ...

Dynamic tooltips
Hi, I wanted to know how to switch tooltip texts dynamically. For. eg. I have a list control one cell of which holds the data [M 0]==[M 1]. What I need to do is to display the tooltip "M 0" when cursor is over M 0, and "M 1" when cursor is over M 1. Currently, only one tooltip can be shown. Can somebody help me out with an example in which tooltips are shown after parsing data ??? Have a callback function which changes the text based on some context. Sample SUPERTIPS in MFC shows various ways a tooltip can be used, including a callback. -- Ajay Kalra [MVP - VC++] a...

Unicode Tooltips
I have a non-Unicode app, but I would like to make my toolbar use Unicode tooltips to get some special characters. I know I probably should have started in Unicode, but this is a legacy application and I don't want to go through it to change all the instances of char* strings to wide strings. Normally, we are supposed to handle the TTN_NEEDTEXT notification message from the Toolbar. But this message is actually one of two messages: TTN_NEEDTEXTA and TTN_NEEDTEXTW, depending on the setting of the Unicode symbol. My app is only getting the TTN_NEEDTEXTA message. How can I create my Tool...