|
-
Jun 28th, 2000, 05:30 AM
#1
Thread Starter
Hyperactive Member
Does anyone know how to create multiple columns in a listbox? Like the ones that you would find in Outlook Express and stuff.
-
Jun 28th, 2000, 05:33 AM
#2
Fanatic Member
List1.Additem "Hello" & vbTab & "World"
Chemically Formulated As:
Dr. Nitro
-
Jun 28th, 2000, 06:02 AM
#3
transcendental analytic
You could use the listview control instead
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Jun 28th, 2000, 06:13 AM
#4
Lively Member
Outlook Express has more of a ListView than a Listbox.
The functions of a listview are quite different from a listbox though, and much more powerful, so if you're not used to it, it can be quite daunting...
Here are some basic equivalents if you're interested
Add a listview control to your form, go to Custom, set the View to 3 - lvwReport, click the Column Headers tab, Click Insert Column, and give it a name, then Insert another Column and give that a name.
Code:
List1.AddItem "Hello",0
'Becomes
Listview1.ListItems.Add 1,,"Hello"
'Listviews start at 1 rather than 0
List1.RemoveItem 0
'Becomes
Listview1.ListItems.Remove(1)
List1.List(List1.ListIndex)
'Becomes
Listview1.SelectedItem.Text
List1.ListIndex
'Becomes
Listview1.SelectedItem.Index
List1.ListCount
'Becomes
Listview1.ListItems.Count
'To make multiple columns like Outlook
Listview1.ListItems.Add 1,,"Some Text"
Listview1.ListItems(1).ListSubItems.Add 1,,"Some more text"
If you want to add Icons to the list, you will need to put an ImageList control on your form, put some icons in it, then set the Listview control's ImageLists to the one you just put there (Also in custom/Image Lists), then if you want the first icon in the list to be attached to your list items, you add it like this
Code:
Listview1.Listitems.Add 1,,"Hello",1,1
The last two 1's are for the icon properties.
Good luck.
Andrew Empson
vb6(ent) SP4
-
Jun 28th, 2000, 07:41 AM
#5
Thread Starter
Hyperactive Member
Thanks a lot guys. I've been wondering how they do that for a while.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|