Commit f9dd2fa2 authored by tr's avatar tr

1、主界面优化

parent f70d3c49
......@@ -31,6 +31,7 @@ namespace Tools
this.listView1.MultiSelect = false;
this.listView1.ShowItemToolTips = true;
this.listView1.View = View.SmallIcon;
this.listView1.Click += ListView1_Click;
this.listView1.ItemSelectionChanged += ListView1_ItemSelectionChanged;
//装载目录
var mList = this.Extend.GetModuleList();
......@@ -45,6 +46,15 @@ namespace Tools
});
}
}
private void ListView1_Click(object sender, EventArgs e)
{
if (this.listView1.Items.Count == 0)
return;
//打开窗口
var item = this.listView1.SelectedItems[0];
var w = item.Tag as Form;
w?.ShowDialog();
}
private void ListView1_ItemSelectionChanged(object sender, ListViewItemSelectionChangedEventArgs e)
{
var item = e.Item;
......@@ -52,12 +62,6 @@ namespace Tools
return;
//选中效果
item.ImageIndex = item.Selected ? 0 : 1;
//选中时打开窗口
if (item.Selected)
{
var w = item.Tag as Form;
w?.ShowDialog();
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment