Click to See Complete Forum and Search --> : Listview's Tooltip question


zenn0
December 30th, 1999, 09:44 PM
Happy Millenium Year!!!!

I have a problem with listview tooltip. I have created a listview control on a form. Now, I want to use the tooltiptext property of the listview control so that when my mouse move over a particular item in the listview, the tooltiptext will display the item name. I have to use this method because the column of the listview is narrow and the items' names can be quite long.
Pls help by giving me some VB Codes
Thanks!

zenn0

Ravi Kiran
December 31st, 1999, 07:25 AM
I dont have code at hand, so i cant help you on that... but the mehtod should go something like this: List view suppors Hit-Test method. So on mouse move, you can get the item on which it is presently there. Then get that list items text and subitem's text, cat them all into a string and set the LV.tooltip to that string.

However if the tool-tip is too big then also it wont look nice. You can check on the Code guru site for Multi-line tool tip. There is an articel

It may be good idea to set up a timer so that you can test only for items on which mouse stays for some time... something like half the tool-tip time ( which is usually 300 ms)

RK