Results 1 to 4 of 4

Thread: Listbox Refrence

  1. #1

    Thread Starter
    New Member
    Join Date
    Jul 2008
    Posts
    11

    Listbox Refrence

    Does anyone know how to reference a particular column in a list box control and then add stuff to it.
    I was looking forward to something like this

    Me.lstMylist.Columns("ColumnName").Add

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

    Re: Listbox Refrence

    ListBoxes don't have columns. They contain a simple list of items. If you want columns then use a ListView or a DataGridView.
    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

  3. #3
    I'm about to be a PowerPoster! kleinma's Avatar
    Join Date
    Nov 2001
    Location
    NJ - USA (Near NYC)
    Posts
    23,373

    Re: Listbox Refrence

    ListBoxes CAN have columns... just not the same way as a ListView or DataGridView does. They have a MultiColumn property which can be set to true.

    However it still only contains 1 single listing of data, it just listes them in multiple columns instead of a single column. Similar to the way a listview behaves in list mode instead of details mode.

    So if you are actually using a listbox setup for multicolumn, then it still is just 1 single set of data. You probably want to be using one of the 2 controls John mentioned above.

  4. #4
    eXtreme Programmer .paul.'s Avatar
    Join Date
    May 2007
    Location
    Chelmsford UK
    Posts
    26,424

    Re: Listbox Refrence

    it is possible to get a multicolumn effect by using tabs in your listbox

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