十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
uservo user=(uservo)voinfo;
成都创新互联制作网站网页找三站合一网站制作公司,专注于网页设计,成都网站建设、网站设计,网站设计,企业网站搭建,网站开发,建网站业务,680元做网站,已为上千服务,成都创新互联网站建设将一如既往的为我们的客户提供最优质的网站建设、网络营销推广服务!
String username=user.getUsername();
String password=user.getPassword();
System.out.println("your username is "+username);
System.out.println("your password is "+password);
List list = new ArrayList();
晕,你把有用的控件选中,然后ctrl+x剪切,再全选窗体内控件,删除!删完了再粘贴!
哈
因为你在删除的过程中,控件数量改变,导致循环次数不准确,所以才会不完全删除控件
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using System.Xml;
namespace WindowsApplication14
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
}
private void Form1_Load(object sender, EventArgs e)
{
setLabel(5);
}
private void setLabel(int num)
{
for (int i = 0; i num; i++)
{
Label testLbl = new Label();
testLbl.Text = i.ToString();
this.Controls.Add(testLbl);
testLbl.Top = i * 50;
testLbl.Left = 10;
}
}
private void button1_Click(object sender, EventArgs e)
{
clearLabel(this);
}
private void clearLabel(Control container)
{
for (int i = container.Controls.Count; i 0;i-- )
{
Label lbl = container.Controls[i-1] as Label;
container.Controls.Remove(lbl);
}
}
private void button2_Click(object sender, EventArgs e)
{
setLabel(5);
}
}
}