Listview items in place tool tip

  • Thread starter Thread starter Angelina
  • Start date Start date
A

Angelina

Can any one please help me out. I need to add a in place tool tip on a list
view items. Do any one knows how to achieve this?

- Angelina
 
Hello Angelina,

You can use the following code:

ListView1.Items(0).ToolTipText = "Some ToolTip Text"
ListView1.ShowItemToolTips = True

BR,

GAZ
 
Hi GAZ,

I am using .net 1.1 and the soultion you provided seems not to work in that.
Might be its a feature of 2.0.

- Angi
 
My bad. The feature is new to Net 2.0. I wouldn't know how to achieve the
same with 1.1.

Sorry,

GAZ
 
In 1.1 you will need to inherit it and set the LVS_EX_INFOTIP extended
style. You didn't say what language you're using but here is VB code for it:

Public Class ListViewEx
Inherits ListView

Private Const LVS_EX_INFOTIP As Integer = &H400
Private Const LVM_FIRST As Integer = &H1000
Private Const LVM_SETEXTENDEDLISTVIEWSTYLE As Integer = LVM_FIRST + 54
Private Declare Auto Function SendMessage Lib "User32.dll" (ByVal hwnd
As IntPtr, ByVal msg As Integer, ByVal wParam As Integer, ByVal lParam As
Integer) As Integer

Protected Overrides Sub OnCreateControl()
MyBase.OnCreateControl()
SendMessage(Me.Handle, LVM_SETEXTENDEDLISTVIEWSTYLE, LVS_EX_INFOTIP,
LVS_EX_INFOTIP)
End Sub
End Class

/claes
 
Back
Top