Forums

Welcome Guest Search | Active Topics | Members

Tooltips for Thumbnail List View Options
ChingYen
Posted: Sunday, May 04, 2008 8:37:32 AM
Rank: Advanced Member
Groups: Member

Joined: 3/3/2008
Posts: 47
Points: 141
Hi,

May I know how can I create Tooltips for each item in Thumbnail List View?

Or at least some tooltips that will show while I point to the Thunbnail (It can be the same tooltips for all item)
Alex Kon
Posted: Wednesday, May 07, 2008 9:40:06 PM
Rank: Advanced Member
Groups: Administration , Member

Joined: 1/31/2005
Posts: 386
Points: 403
Hello,

Yes, of course it is possible. Here is code snippet which shows display name of the thumbnail item in a tool tip. Variable _tl is ThumbnailListView control instance, _toolTip is a System.Windows.Forms.ToolTip instance.

Somewhere in form initialization:
Code:
. . .
_tl.MouseMove += new MouseEventHandler(_tl_MouseMove);
. . .


Mouse move handler and tool tip update method:
Code:
void _tl_MouseMove(object sender, MouseEventArgs e)
{
      UpdateToolTip();
}

private void UpdateToolTip()
{
      int index = _tl.HitTest(_tl.PointToClient(Control.MousePosition));
      if (index != -1)
      {
            string toolTipText = _tl.Items[index].GetText(
                  ThumbnailListItem.TextInfoIdDisplayName);
            if (_toolTip.GetToolTip(_tl) != toolTipText)
                  _toolTip.SetToolTip(_tl, toolTipText);
      }
      else
      {
            _toolTip.RemoveAll();
      }
}



Best wishes, Alex.
Users browsing this topic
Guest


Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Main Forum RSS : RSS

YAFVision Theme Created by Jaben Cargman (Tiny Gecko)
Yet Another Forum.net version 1.9.1.6 running under Cuyahoga.
Copyright © 2003-2006 Yet Another Forum.net. All rights reserved.