日期:2014-05-18 浏览次数:21097 次
private void clearChart(int batNum, byte batCell)
{
if (batCell> 5)
{
pageNo = (byte)(batNum / 10 + 1);
}
else
{
pageNo = (byte)(batNum / 19 + 1);
}
if (pageNo > 2)
{
for (int ii = 2; ii <= pageNo; ii++)
{
string name = "tabPageCellDetail" + ii.ToString();
tabPageCellDetail1.Controls.RemoveByKey(name);
}
}
else
{
foreach (Control charts in tabPageCellDetail1.Controls)
{
tabPageCellDetail1.Controls.Remove(charts);
}
}
}
private void clearChart(int batNum, byte batCell)
{
if (batCell> 5)
{
pageNo = (byte)(batNum / 10 + 1);
}
else
{
pageNo = (byte)(batNum / 19 + 1);
}
if (pageNo > 2)
{
foreach (Control findControl in this.Controls)
{
TabPage findTabPage = (findControl as TabPage);
if (findControl.Name.Length > 17)
{
//first page, remain page, remove control
if (findControl.Name == "tabPageCellDetail1")
{
foreach (Control charts in tabPageCellDetail1.Controls)
{
tabPageCellDetail1.Controls.Remove(charts);
}
}
else
{
string tempStr = string.Empty;
tempStr = findControl.Name.Substring(0, 17);
if (tempStr == "tabPageCellDetail")
{
//not first page, remove page and control
foreach (Control charts in findControl.Controls)
{
findControl.Controls.Remove(charts);
}
this.Controls.Remove(findControl);
}
}
}
}
}
else
{
foreach (Control charts in tabPageCellDetail1.Controls)
{
tabPageCellDetail1.Controls.Remove(charts);
}
}
}