#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0

    List Box Columns headings


    Can anyone tell me how to set the column headings in VB. I cant find any help on this.

    Thanks
    Andy
  2. #2
  3. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Cheltenham, England.
    Posts
    101
    Rep Power
    15
    AFAIK, you can't have column headers as part of a ListBox - you need to put separate Text boxes above the control. Also, don't be fooled by the "Column" property - it simply puts the next item in the list at the top of the next column, when the bottom of the list box is reached - effectively, the listed items are scrolled horizontally.

    Don't take the above as gospel - I may be wrong, in which case someone will hopefully correct me.

    You may want to look at the ListView control instead (in MSCommCtlLib) - it's much more functional, although a bit of a pig to get to grips with - well worth the effort, though.
  4. #3
  5. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    793
    AFAIK you are correct NicMic.
    I would also agree that the ListView is a better choice, especially if you want column headers in the code. Although I didn't really find it that hard to work with.
  6. #4
  7. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Cheltenham, England.
    Posts
    101
    Rep Power
    15
    I think the example I was learning from ("VB & VBA" O'Reilly?) used all the bells and whistles!
  8. #5
  9. /(bb|[^b]{2})/

    Join Date
    Nov 2001
    Location
    Somewhere in the great unknown
    Posts
    5,163
    Rep Power
    793
    Well, I had a couple of classes in College for it, but most of it I have learned on my own.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0
    Thanks for your help.

    However, could you tell me why the listbox object has a columnheads property and what this is for?

    Andy
  12. #7
  13. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Cheltenham, England.
    Posts
    101
    Rep Power
    15
    I think you'll find that's an MS Access (VBA?) control - enticing, I know, but (I suspect) not usable within VB6.
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2003
    Posts
    9
    Rep Power
    0
    Yea it is for VBA, im using it in excel.
    Do you know if and how you can set these headings?

    Thanks
    Andy
  16. #9
  17. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2003
    Location
    Cheltenham, England.
    Posts
    101
    Rep Power
    15
    Sorry - unknown territory for me. I found the reference to it in MS Access Help (not Excel).

IMN logo majestic logo threadwatch logo seochat tools logo