Home > Net >  Consult the ListView control problem
Consult the ListView control problem

Time:11-13



Excuse me I now select the first line of the National Day activities, such as gift bag sigh agghh

So I how to get my choice of this line at the back of the date?

And how do I chose the first line of XXXX let the blue selected interaction also cover the back of the date of the above!

Bother you to guide thank you!

CodePudding user response:

You this is winform listview control

CodePudding user response:

Yes oh! C # to write the

CodePudding user response:

1. Set properties FullRowSelect=true; Can select a row
2. Get the selected content
Private void listView1_MouseClick (object sender, MouseEventArgs e)
{
ListViewItem lv=listView1. GetItemAt (e.X, e.Y);
String STR=lv. GetSubItemAt (e.X, e.Y.) Text;
Foreach (ListViewItem item in this. The listView1. Items)
{
If (item. Text==STR)
{
MessageBox. Show (item. SubItems [1]. The Text).
return;
}

}


}

CodePudding user response:

FullRowSelect=true
  •  Tags:  
  • C#
  • Related