我C#实现一个向导,以这种方式:当我想移动到另一种形式,我需要关闭currnet(this.close),
如何隐藏,而不会丢失它的数据一个WinForms形式
private static void MyInitialization()
{
WizardData wData = new WizardData();
wData.FormToShow = WizardData.wizardForms.FirstStep;
Form step1 = new FirstStep(wData);
Form step2 = new SecondStep(wData);
Form step3 = new ThirdStep(wData);
while (wData.FormToShow != WizardData.wizardForms.Cancel)
{
switch (wData.FormToShow)
{
case WizardData.wizardForms.FirstStep:
{
step1.ShowDialog();
break;
}
case WizardData.wizardForms.SecondStep:
{
step2.ShowDialog();
break;
}
case WizardData.wizardForms.ThirdStep:
{
step3.ShowDialog();
break;
}
}
但我想使目前visibility=false
,而且当我转到其他表单时,不会丢失当前表单中的数据?
private void btnNext_Click(object sender, EventArgs e)
{
// to show the SecondStep form
wData.FormToShow = WizardData.wizardForms.SecondStep;
this.Close();
}
有什么想法吗?
[在C#中为Windows窗体创建向导]的可能副本(http://stackoverflow.com/questions/2340566/creating-wizards-for-windows-forms-in-c-sharp) – 2011-12-25 13:36:23