Results 1 to 4 of 4

Thread: List Box

  1. #1

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80
    Hi,

    I have a list box on a VB5 form which I would like to display the following:

    An Icon for each item,
    Two fields from an Access 97 database beside each Icon.

    Does anyone know how to do this?

    Also I want the user to be able to change the text in the list box without updating the database (until they click OK or apply).

    If you look at the Hardware Profiles property page in NT4 then you'll get a pretty good idea of what I'm trying to achieve.

    Any suggestions would be much appreciated.

    Best regards,

    Rob Brown.

  2. #2
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    You would need the ListView control to do this; the basic listbox cannot handle icons or multiple fields (although a listbox item can be made to look like it has more than one field). Also, neither control will let you directly edit an item, but when a particular item is selected, you can display the data in a textbox; when the user is done editing the textbox(es), you can update that item in the ListView control (you can't modify an item in the Listbox; you'd have to clear it and reload it, another reason why the ListView would be a better choice).

    I don't have time to get into the code right now, but I can check back later. I hope this gives you some ideas (have a look in the VB help on the Listview if you haven't used it before).
    "It's cold gin time again ..."

    Check out my website here.

  3. #3

    Thread Starter
    Lively Member
    Join Date
    May 2000
    Location
    Antrim
    Posts
    80
    Thanks for your help Bruce,

    I was editing the list box via an input box anyway and then setting the text property of the list box in code but thanks for clearing up my icon problem.

    Will I be able to do this with the listview even though it's bound to a database?

    Best regards,

    Rob Brown.

  4. #4
    PowerPoster BruceG's Avatar
    Join Date
    May 2000
    Location
    New Jersey (USA)
    Posts
    2,657
    I do not believe the ListView can be data-bound. (I must admit I'm biased against bound controls; I always use code.)
    "It's cold gin time again ..."

    Check out my website here.

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