|
-
Jun 4th, 2003, 04:05 PM
#1
Thread Starter
Junior Member
Listbox & ListView Items.Add()
Am I missing something here...? Or has anyone notice how you can add an Object to a Listbox via Items.Add() and its not possible with the ListView. I'm really suprised an object can not be part of the ListView Items collection. Any suggestions?
Thanks in advance,
Joan
-
Jun 4th, 2003, 06:38 PM
#2
Sleep mode
I can't see any problems . I tried both methods , they worked just fine .
-
Jun 5th, 2003, 02:55 PM
#3
Thread Starter
Junior Member
I tried both methods , they worked just fine
Yes both methods work in each of their respected classes, but the signitures are totally different. How do you add an object to to a ListView Items collection.. ???? It's signiture doesnt support it.
Here are teh ListView's overloaded methods for Add for it's Items collection.
[C#] public virtual ListViewItem Add(ListViewItem);
[C#] public virtual ListViewItem Add(string);
[C#] public virtual ListViewItem Add(string, int);
Now here is the signiture ListBox Items only Add method.
[C#] public int Add(object item);
The ListBox takes a generic Object as a parameter which is VERY NICE, and flexible...
Joan
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
|