|
-
Jan 26th, 2000, 04:49 PM
#1
Thread Starter
Hyperactive Member
I don't know how to add items to a listview, I probably don't know anything about it and I can't find anything inte the help other than what commands there are (but not how to use them with ListView). Please, If you know any place where I can find some information about how using a listview, tell me...
The "vital" things I need to know is how to clear the list and how to add to it.. (and it's columns)....
Thanks :
-
Jan 26th, 2000, 06:15 PM
#2
Frenzied Member
Right, here goes!
You can add columns either through the property pages or in code
Code:
Private Sub Form_Load()
' Add ColumnHeaders. The width of the columns is
' the width of the control divided by the number of
' ColumnHeader objects.
ListView1.ColumnHeaders. _
Add , , "col1", ListView1.Width / 3
ListView1.ColumnHeaders. _
Add , , "col2", ListView1.Width / 3, _
lvwColumnCenter
ListView1.ColumnHeaders. _
Add , , "col3", ListView1.Width / 3
' Set View property to Report.
ListView1.View = lvwReport
End Sub
to add data to rows you have to add a list item.
data in subsequent columns are sub items of the list item:
Code:
Private Sub Command1_Click()
Dim itmx As ListItem
Set itmx = ListView1.ListItems.Add(, , "somthing in col1")
' SubItem 1 to it.
itmx.SubItems(1) = "something in col2"
' SubItem 2 to it.
itmx.SubItems(2) = "somethinmg in col3"
End Sub
hope this helps
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
[This message has been edited by Mark Sreeves (edited 01-27-2000).]
-
Jan 26th, 2000, 06:25 PM
#3
Frenzied Member
oh I forgot, to clear the list:
Code:
Private Sub Command2_Click()
ListView1.ListItems.Clear
End Sub
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Jan 26th, 2000, 06:30 PM
#4
Thread Starter
Hyperactive Member
Thank you Mark!
Just another q... how do you make that "code" style where you put code?
-
Jan 26th, 2000, 06:47 PM
#5
Lively Member
I can't wite the code because it thinks I will put some code in the message but the info is avaible if you lock at the left field and read the "*UBB Code is ON". There is all commands that you can use..
------------------
Best Regards rancor
[email protected] http://www.sajberhem.nu
[This message has been edited by rancor (edited 01-27-2000).]
[This message has been edited by rancor (edited 01-27-2000).]
-
Jan 26th, 2000, 08:41 PM
#6
Frenzied Member
take a look at http://www.vb-world.net/ubb/ubbcode.html
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
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
|