python 在不同层级目录import 模块的方法
2014-04-16 20:06
666 查看
private void detailToolStripMenuItem_Click(object sender, EventArgs e) { try { if (this.listViewData.SelectedIndices.Count == 0)//无选中信息 return; int n = listViewData.SelectedItems[0].Index;//获取当前listView选取的行 TestDataDetail detail = new TestDataDetail(n); ConfigContent select = new ConfigContent(); select = MainForm.configList ; byte cmd = Convert.ToByte(select.cmd, 16); if (select.cycle_num == 1 || cmd == 0x32 || n >= configList.Count) { MessageBox.Show("该测试项无详情!", "TestPlatform", MessageBoxButtons.OK, MessageBoxIcon.Information); } else { detail.Show(); } } catch (Exception ex) { MessageBox.Show(ex.Message); } }
if (this.listViewData.SelectedIndices.Count == 0) 这句话用来判断是否有选中信息,没有则返回。
右键菜单是添加了一个contextMenuStrip控件,添加右键菜单信息。
private void ListViewShowInit() { listViewData.Items.Clear(); listViewData.View = View.Details; listViewData.ContextMenuStrip = contextMenuStripDetail;//右键 for (int i = 0; i < configList.Count; i++) { ListViewItem lv = new ListViewItem(configList[i].desc); lv.SubItems.Add(configList[i].max); lv.SubItems.Add(configList[i].min); lv.SubItems.Add(configList[i].cycle_num.ToString()); this.listViewData.Items.Add(lv); } }
初始化时 listViewData.ContextMenuStrip = contextMenuStripDetail
本文出自 “悠着点,慢着点” 博客,请务必保留此出处http://sdqdxiaoli.blog.51cto.com/6211128/1059342
相关文章推荐
- python 在不同层级目录import 模块的方法
- python在不同层级目录import模块的方法
- python在不同层级目录import模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python在不同层级目录import模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法-andersonyan-ChinaUnix博客
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python在不同层级目录import模块的方法 作者:运维之路 字体:[增加 减小] 类型:转载 时间:2016-01-31 我要评论 这篇文章主要介绍了python 在不同层级目录import
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录 import 模块的方法
- python 在不同层级目录import 模块的方法
- python 在不同层级目录import 模块的方法