如果列表视图中没有项目,如何禁用“更新”菜单?
void listView1_MouseDown(object sender,MouseEventArgs e) { if (e.Button == MouseButtons.Right) { updateToolStripMenuItem.Enabled = (listView1.Items.Count > 0); } }