CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7
  1. #1
    Join Date
    Sep 2007
    Posts
    405

    Can I add text into a listView of icon ?

    I want to add text into icon of the listView , how do I write the code ? You see the image file attached, for this example I add the word "special" color green. http://www.mediafire.com/view/ieaac6...GianhRieng.jpg

  2. #2
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Can I add text into a listView of icon ?

    I guess you should modify the item icon (add or replace the corresponding icon in the imagelist) with the text and then set this modified icon for the listview item.
    Victor Nijegorodov

  3. #3
    Join Date
    Sep 2007
    Posts
    405

    Re: Can I add text into a listView of icon ?

    I want to insert text in the center of the icon as shown in the image but do not change the icon

  4. #4
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Can I add text into a listView of icon ?

    Quote Originally Posted by dongtrien View Post
    I want to insert text in the center of the icon as shown in the image but do not change the icon
    Then create a new icon from the existing one adding the text. Then add this icon to the control imagelist and set this new icon to the item (i.e. replace the item icon).
    Victor Nijegorodov

  5. #5
    Arjay's Avatar
    Arjay is offline Moderator / EX MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    13,490

    Re: Can I add text into a listView of icon ?

    Quote Originally Posted by dongtrien View Post
    I want to add text into icon of the listView , how do I write the code ? You see the image file attached, for this example I add the word "special" color green. http://www.mediafire.com/view/ieaac6...GianhRieng.jpg
    Can't see the image without a mediafire account. Just attach the image directly to your post.

  6. #6
    Join Date
    Sep 2007
    Posts
    405

    Re: Can I add text into a listView of icon ?

    The friend VictorN have demo ?Name:  GianhRieng.jpg
Views: 90
Size:  60.5 KB

  7. #7
    VictorN's Avatar
    VictorN is offline Super Moderator Power Poster
    Join Date
    Jan 2003
    Location
    Hanover Germany
    Posts
    20,396

    Re: Can I add text into a listView of icon ?

    Quote Originally Posted by dongtrien View Post
    The friend VictorN have demo ?
    No, but I already described how i would do it in C++. And I guess that in VB one can do it the same way.
    Victor Nijegorodov

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured