日期:2014-05-17  浏览次数:21183 次

(Winform,C#)在listView中,怎么判断鼠标点击是item还是listView的空白区?
RT

------解决方案--------------------
C# code

        private void listView1_Click(object sender, EventArgs e)
        {
            if (this.listView1.SelectedItems.Count >0 )
                MessageBox.Show("选种items");
        }

------解决方案--------------------
那我接个分吧.....
------解决方案--------------------
C# code
 private void listView1_MouseDown(object sender, MouseEventArgs e)
        {
            ListViewItem item = this.listView1.GetItemAt(e.X, e.Y);

            if (item == null)
            { }
            else
            { }
        }