By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,067 Members | 949 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,067 IT Pros & Developers. It's quick & easy.

listview subitem

P: n/a
Hello.
I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?
Thanks for answers.

Nov 17 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
>I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?


If you're working in managed C++ with WinForms it'll be essentially
the same.

If you're using native SDK you use the LVM_SETITEMTEXT message,
similarly for MFC you use the CListCtrl::SetItemText method.

Dave
Nov 17 '05 #2

P: n/a
But it's not the same, How can I add Subitem?
Thanks
"David Lowndes" <da****@example.invalid> wrote in message
news:5r********************************@4ax.com...
I have one question
I make Listview with 4 columns.
And I want add text to to column 2,3,4.
With listview1->Items->add ("Text") I can add text only to first column.
In Visual basic.NEt I can write listview1.Items(x).Subitem(number
column).Add ("Text"). Is something like this in VC.NET?


If you're working in managed C++ with WinForms it'll be essentially
the same.

If you're using native SDK you use the LVM_SETITEMTEXT message,
similarly for MFC you use the CListCtrl::SetItemText method.

Dave

Nov 17 '05 #3

P: n/a
>But it's not the same, How can I add Subitem?

What's not the same?

You need to explain your situation and problem more.

Dave
Nov 17 '05 #4

P: n/a
OK. I can add subItem to listview, in listview I Have 3 columns.
In first column will be Name, in second colun will be Surname, And in three
column will be Address.
How can I add : Peter~ Blank~ Main street 22
Thanks
"David Lowndes" <da****@example.invalid> wrote in message
news:g5********************************@4ax.com...
But it's not the same, How can I add Subitem?


What's not the same?

You need to explain your situation and problem more.

Dave

Nov 17 '05 #5

P: n/a
I repair my previous Post.
How can add Item with 2 subitems to listview, in listview I Have 3 columns.
In first column will be Name, in second column will be Surname, And in third
column will be Address.
How can I add : Peter (Name)~ Blank(Surname)~ Main street 22(Adress) to
Thanks

In visual basic.net I can Write
Listview1.Items(1).Subitems.add("Peter")
Listview1.Items(1).Subitems.add("Blank")
Listview1.Items(1).Subitems.add("Adress")

And When I want get Text of Item in second row and second Column
I can write Listview.Items(1).Subitems(1).Text.

How Can I write this 2 things in Visual C++.NEt in Managed Application.
BEcaause I couldn't write Listview1->Items(1)->
Thanks.
Nov 17 '05 #6

P: n/a
>In visual basic.net I can Write
Listview1.Items(1).Subitems.add("Peter")
Listview1.Items(1).Subitems.add("Blank")
Listview1.Items(1).Subitems.add("Adress")

And When I want get Text of Item in second row and second Column
I can write Listview.Items(1).Subitems(1).Text.

How Can I write this 2 things in Visual C++.NEt in Managed Application.
BEcaause I couldn't write Listview1->Items(1)->


It'll be something like:

Listview1->Items[1]->Subitems->add("Adress")

Dave
--
MVP VC++ FAQ: http://www.mvps.org/vcfaq
Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.