listview 判断鼠标点击的是哪一列

private void listView1_MouseDown(object sender, MouseEventArgs e)
           {
                   try
                   {
                       ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);
             
                       int intCol = item.SubItems.IndexOf(item.GetSubItemAt(e.X, e.Y));//列索引
                   }
                   catch
                   {

                   }
               }

猜你喜欢

转载自blog.csdn.net/Hat_man_/article/details/108885249
今日推荐