This forum contains outdated content and is available for reading only. Please contact technical support if you have any questions.

ThumbnailListView caption

I am using a thumbnaillistview to display a series of images.

I would like to add a custom caption below each image instead of the filename.

To be more specific, I want to add a counter below each image with the index number for each image as it loads, Ex: 1 of 5, 2 of 5 ... 5 of 5.

How do I do this?
Hello,

You need to do the following steps:

  1. Add a clall inherited from ThumbnailListItem.
  2. Override method GetText and return a string you want to display there.


Public Class CustomThumbnailListItem
    Inherits ThumbnailListItem

    Public Sub New(ByVal pidl As Pidl)
        MyBase.New(pidl)
    End Sub

    Public Overrides Function GetText(ByVal textId As Integer) As String
        Return "Text String"
    End Function
...

After that you need to create instances of CustomThumbnailListItem class instead of ThumbnailListItem.
Hello,

But sometimes, not all words in the Text show.

How can we do following:

1. always show every word in the text at both situations where the text is wrapped or not wrapped:

eg: show "this is the text for caption" instead of "this is the text ...";

2. Always show tooltips when the mouse is at the text.

Thanks.
Hello,

1. This is a behavior by design as the text is displayed in a limited rectangle. If it could display long strings, it would ruin the items layout.
2. You could try to display a custom tooltip by overriding the OnMouseHover/OnMouseLeave methods.
Where can we find some sample codes for displaying a custom tooltips in the overriding OnMouseHover/OnMouseLeave methods.
Thanks.