我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