Results 1 to 3 of 3

Thread: [2005] insert image alongside text as item in listbox

  1. #1

    Thread Starter
    Addicted Member
    Join Date
    Jan 2007
    Posts
    128

    [2005] insert image alongside text as item in listbox

    is it possible to put a little image to the right of text of items in a listbox?? like the directory listbox in vb6 had folder images

  2. #2
    Addicted Member Daystar's Avatar
    Join Date
    Dec 2006
    Location
    Pahrump, NV
    Posts
    132

    Re: [2005] insert image alongside text as item in listbox

    I don't know about a listbox. But you can with a ListView or a TreeView. Using the Imagelist Class.

  3. #3
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [2005] insert image alongside text as item in listbox

    The standard ListBox doesn't support that feature. You can use a ListView as suggested, or you can owner-draw the ListBox and add the image for each item yourself. I've seen examples of third-party ComboBoxes that do just that. There are probably ListBox examples around too, but if not the code would be almost identical to the ComboBox anyway. If you're interested I look at The Code Project first.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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