新文章 网摘 文章 随笔 日记

C#列表框项目双击事件

void listBox1_MouseDoubleClick(object sender, MouseEventArgs e)
    {
         int index = this.listBox1.IndexFromPoint(e.Location);
         if (index != System.Windows.Forms.ListBox.NoMatches)
            {
              MessageBox.Show(index.ToString());
            }
     }

 

posted @ 2020-12-10 13:34  岭南春  阅读(266)  评论(0)    收藏  举报