加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
UserControlProcess.cs 4.42 KB
一键复制 编辑 原始数据 按行查看 历史
jlshiwei 提交于 2018-11-28 14:28 . shiwei 2018.11.28
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace TabHeaderDemo
{
public partial class UserControlProcess : UserControl
{
public void Init()
{
listViewPro1.Clear();
ColumnHeader f = new ColumnHeader();
f.Width = 20;
listViewPro1.Columns.Add(f);
CComLibrary.GlobeVal.filesave.InitExplainList();
for (int i = 0; i < CComLibrary.GlobeVal.filesave.mexplainlist.Count; i++)
{
f = new ColumnHeader();
f.Width = 100;
listViewPro1.Columns.Add(f);
}
ListViewItem v = new ListViewItem();
listViewPro1.Items.Add(v);
v = new ListViewItem();
listViewPro1.Items.Add(v);
v = new ListViewItem();
listViewPro1.Items.Add(v);
for (int i = 0; i < CComLibrary.GlobeVal.filesave.mseglist.Count; i++)
{
if (CComLibrary.GlobeVal.filesave.mcontrolprocess == 1)
{
v.SubItems.Add("步骤" + (i + 1).ToString());
}
}
v = new ListViewItem();
listViewPro1.Items.Add(v);
for (int i = 0; i < CComLibrary.GlobeVal.filesave.mseglist.Count; i++)
{
v.SubItems.Add("");
}
for (int i = 0; i < CComLibrary.GlobeVal.filesave.mseglist.Count; i++)
{
if (CComLibrary.GlobeVal.filesave.mcontrolprocess == 1)
{
if (CComLibrary.GlobeVal.filesave.mseglist[i].returncount > 0)
{
v.SubItems[i + 1].Text = CComLibrary.GlobeVal.filesave.mseglist[i].currentcount.ToString() + "|"+ CComLibrary.GlobeVal.filesave.mseglist[i].returncount.ToString();
}
}
}
int w = 0;
for (int i=0;i<listViewPro1.Columns.Count;i++)
{
w = w + listViewPro1.Columns[i].Width;
}
listViewPro1.Width = w+30;
return;
}
public UserControlProcess()
{
InitializeComponent();
}
private void label1_Click(object sender, EventArgs e)
{
}
private void timer1_Tick(object sender, EventArgs e)
{
if (CComLibrary.GlobeVal.filesave==null)
{
return;
}
if ((GlobeVal.myarm.mcurseg >= 0) && (GlobeVal.myarm.mcurseg < CComLibrary.GlobeVal.filesave.mseglist.Count ))
{
if (listViewPro1.curstep != GlobeVal.myarm.mcurseg + 1)
{
listViewPro1.curstep = GlobeVal.myarm.mcurseg + 1;
int i = GlobeVal.myarm.mcurseg;
/*
for (int j = 0; j < CComLibrary.GlobeVal.filesave.mseglist.Count; j++)
{
if (CComLibrary.GlobeVal.filesave.mseglist[j].returncount > 0)
{
CComLibrary.GlobeVal.filesave.mseglist[j].currentcount = GlobeVal.myarm.current_returncount;
listViewPro1.Items[3].SubItems[j + 1].Text = CComLibrary.GlobeVal.filesave.mseglist[j].currentcount.ToString() + "|" + CComLibrary.GlobeVal.filesave.mseglist[j].returncount.ToString();
}
}
*/
if (CComLibrary.GlobeVal.filesave.mseglist[i].returncount > 0)
{
// CComLibrary.GlobeVal.filesave.mseglist[i].currentcount = GlobeVal.myarm.current_returncount;
//出过错
listViewPro1.Items[3].SubItems[i + 1].Text = (CComLibrary.GlobeVal.filesave.mseglist[i].mseq.finishedloopcount+1).ToString() + "|" + CComLibrary.GlobeVal.filesave.mseglist[i].returncount.ToString();
}
listViewPro1.RedrawItems(2, 3, true );
//listViewPro1.Refresh();
}
}
}
private void UserControlProcess_Paint(object sender, PaintEventArgs e)
{
listViewPro1.Refresh();
}
}
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化