|
-
Aug 1st, 2003, 08:31 PM
#1
Thread Starter
Frenzied Member
Listview - why cant i add text to subitems? (always get an error) *Unresolved*
LVW.Items(2).SubItems(2).Text = "ready"
LVW.Items(1).SubItems(1).Text = "ready"
LVW.Items.Item(1).SubItems(2).Text = "ready"
nothing works!
i have a listview, about 30 rows, and 5 colums.. why isnt this working?
i keep getting arguement out of range?
Last edited by VaxoP; Aug 1st, 2003 at 09:01 PM.
-
Aug 1st, 2003, 09:01 PM
#2
Thread Starter
Frenzied Member
The only way i was able to add them was with
LVW.Items(1).SubItems.Add("***")
but how can i add something to the 3rd column?
please please tell me theres a way to do it without having to set everything as a listviewsubitem or something
Please tell me this isnt the only way to do it..
Code:
lCurrent = lvw.Items.Add("text")
lCurrent.SubItems.Add("text")
i have all the items added on startup to the first column, the program fills in the other columns when it runs.. the above method would be useless to me.
isnt there a one line way to add a subitem?
Last edited by VaxoP; Aug 1st, 2003 at 09:19 PM.
-
Aug 2nd, 2003, 02:29 AM
#3
you can add subitems like this :
VB Code:
With ListView1
.Items.Add("a main item")
.Items(0).SubItems.Add("first subitem") '/// first subitem.
.Items(0).SubItems.Add("second?") '///second subitem.
End With
you could also add them all in 1 go , using AddRange , eg:
VB Code:
Dim lItems() As String = {"first subitem", "second?"}
With ListView1
.Items.Add("a main item")
.Items(0).SubItems.AddRange(lItems) '/// add all of em in 1 go..
End With
~
if a post is resolved, please mark it as [Resolved]
protected string get_Signature(){return Censored;}
[vbcode][php] please use code tags when posting any code [/php][/vbcode]
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
|