我添加了开始时不可见的标签,但是当我单击构建按钮时,我将标签设置为“正在加载...”,并且当完成该过程时,我将“完成”我编译的代码唯一的东西是标签“label2”。 为什么它不想得到我放的文字?完成状态窗体C#
public partial class MDGSelectiveForm : Form
{
EA.Repository modelRepository;
private NeatDiagram.CoreDiagram.MDGForm diagramBuilder;
public MDGSelectiveForm(EA.Repository repository)
{
InitializeComponent();
**this.label2 = new Label();
this.label2.Visible = false;**
this.modelRepository = repository;
}
private void button1_Click(object sender, EventArgs e)
{
**label2.Text = "Loading...";
label2.Visible = true;
label2.Refresh();**
//Creo un'istanza di MDGBuilder
diagramBuilder = new CoreDiagram.MDGForm();
String typeOfDiagram1 = "";
String typeOfDiagram2 = "";
String typeOfDiagram3 = "";
if (checkBox1.Checked)
{
typeOfDiagram1 = checkBox1.Text;
diagramBuilder.createDiagram(typeOfDiagram1, modelRepository);
}
if (checkBox2.Checked)
{
typeOfDiagram2 = checkBox2.Text;
diagramBuilder.createDiagram(typeOfDiagram2, modelRepository);
}
if (checkBox3.Checked)
{
typeOfDiagram3 = checkBox3.Text;
diagramBuilder.createDiagram(typeOfDiagram3, modelRepository);
}
**label2.Text = "Complete";**
**label2.Refresh();**
}
我们不会为您编写代码。 – JohnD 2012-07-11 17:17:03
你想知道如何在表单中放置文本,或者如何找出流程完成的时间或其他内容? – 2012-07-11 17:17:42
@MrLister如何在表单中放置文本,如果你能帮助我,谢谢。 – Defi 2012-07-11 17:20:42