• 0

[C++] listview help - SOLVED


Question

Hello guys,

i'm new to c++ and need your help;

i'm using Visual C++ 2008

i need your help in the following

i have a ListView control in a form,

Listview control has 3 columns.

and i added 10 items.

so the problem is i need to find out the value of the 1st column of the selected item.

i need coding for that , please help me.

so when i select a item out the 10 and click a button it should display the value of the 1st column inside a textbox.

Thank you,

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

  • 0

Normally first column is the root of the ListItem so you can just do,

ListView.SelectedItem.Text

you should be able to use ListView.SelectedItem.SubItems[0] too. Just increment number for reading other columns.

Link to comment
Share on other sites

  • 0

Thank you,

since it's Visual C++ it like this

listViewStock->SelectedItems->ToString();

which returns the following instead of the value

System.Windows.Forms.ListView+SelectedListViewItemCollection

please help me.

Link to comment
Share on other sites

  • 0

thank you hdood,

hello again,

there is a another problem, i want to know whether a user has selected a item or not, and if he had selected it' run some code.

does anyone know how to do that in listview ???

some like (example ListView1->isSelected()) kind of function.

thank you,

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.