亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 學院 > 開發設計 > 正文

C#設計的一個向導程序(Wizard)框架

2019-11-18 17:06:28
字體:
來源:轉載
供稿:網友

在現實的軟件中,經常可以看到一些向導(Wizard)的存在,如何給自己的應用程序實現一個向導呢?
下面給出一個使用面向對象的思想設計出來的應用程序向導框架,雖然很簡單,但希望能給人幫助。

 其中有三個比較關鍵的類,一個是向導窗體要收集的信息封裝成的類Information,一個是所有向導窗體都要繼承的窗體基類frmBase,還有一個就是最關鍵的類,向導控制類WizardController。

有了基類frmBase,設計一個子類窗體非常簡單,只需從frmBase類中派生一個新窗體,設計完用戶界面之后重寫其UpdateInfo()方法即可。

所有代碼(VS2003版)如下,通俗易懂,不再做說明:

Information類:

using System;

namespace Wizard
{
 /// <summary>
 /// Information 的摘要說明。
 /// </summary>
 public class Information
 {
  public Information()
  {
   //
   // TODO: 在此處添加構造函數邏輯
   //
  }

  //姓名
  public string Name = "";
  //性別
  public bool IsMale = true;
  //學歷
  public string EduBackground = "";
  //編程語言
  public string PRogrameLanguage = "";
 }
}

frmBase類:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Wizard
{
 /// <summary>
 /// frmBase 的摘要說明。
 /// </summary>
 public class frmBase : System.Windows.Forms.Form
 {
  private System.Windows.Forms.Panel panel1;
  private System.Windows.Forms.Button btnGoPrev;
  private System.Windows.Forms.Button btnGoNext;
  private System.Windows.Forms.Button btnOver;
  private System.Windows.Forms.Button btnCancel;
  private System.Windows.Forms.Button btnHelp;
  /// <summary>
  /// 必需的設計器變量。
  /// </summary>
  private System.ComponentModel.Container components = null;

  public frmBase()
  {
   //
   // Windows 窗體設計器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
   //
  }

  /// <summary>
  /// 清理所有正在使用的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if(components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗體設計器生成的代碼
  /// <summary>
  /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.panel1 = new System.Windows.Forms.Panel();
   this.btnGoPrev = new System.Windows.Forms.Button();
   this.btnGoNext = new System.Windows.Forms.Button();
   this.btnOver = new System.Windows.Forms.Button();
   this.btnCancel = new System.Windows.Forms.Button();
   this.btnHelp = new System.Windows.Forms.Button();
   this.panel1.SuspendLayout();
   this.SuspendLayout();
   //
   // panel1
   //
   this.panel1.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
    | System.Windows.Forms.AnchorStyles.Right)));
   this.panel1.Controls.Add(this.btnHelp);
   this.panel1.Controls.Add(this.btnCancel);
   this.panel1.Controls.Add(this.btnOver);
   this.panel1.Controls.Add(this.btnGoNext);
   this.panel1.Controls.Add(this.btnGoPrev);
   this.panel1.Location = new System.Drawing.Point(0, 202);
   this.panel1.Name = "panel1";
   this.panel1.Size = new System.Drawing.Size(450, 40);
   this.panel1.TabIndex = 0;
   //
   // btnGoPrev
   //
   this.btnGoPrev.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   this.btnGoPrev.Location = new System.Drawing.Point(25, 8);
   this.btnGoPrev.Name = "btnGoPrev";
   this.btnGoPrev.Size = new System.Drawing.Size(56, 23);
   this.btnGoPrev.TabIndex = 1;
   this.btnGoPrev.Text = "上一步";
   this.btnGoPrev.Click += new System.EventHandler(this.btnGoPrev_Click);
   //
   // btnGoNext
   //
   this.btnGoNext.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   this.btnGoNext.Location = new System.Drawing.Point(105, 8);
   this.btnGoNext.Name = "btnGoNext";
   this.btnGoNext.Size = new System.Drawing.Size(56, 23);
   this.btnGoNext.TabIndex = 2;
   this.btnGoNext.Text = "下一步";
   this.btnGoNext.Click += new System.EventHandler(this.btnGoNext_Click);
   //
   // btnOver
   //
   this.btnOver.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   this.btnOver.Location = new System.Drawing.Point(193, 8);
   this.btnOver.Name = "btnOver";
   this.btnOver.Size = new System.Drawing.Size(56, 23);
   this.btnOver.TabIndex = 3;
   this.btnOver.Text = "完成";
   this.btnOver.Click += new System.EventHandler(this.btnOver_Click);
   //
   // btnCancel
   //
   this.btnCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   this.btnCancel.Location = new System.Drawing.Point(281, 8);
   this.btnCancel.Name = "btnCancel";
   this.btnCancel.Size = new System.Drawing.Size(56, 23);
   this.btnCancel.TabIndex = 4;
   this.btnCancel.Text = "取消";
   this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click);
   //
   // btnHelp
   //
   this.btnHelp.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
   this.btnHelp.Location = new System.Drawing.Point(369, 8);
   this.btnHelp.Name = "btnHelp";
   this.btnHelp.Size = new System.Drawing.Size(56, 23);
   this.btnHelp.TabIndex = 5;
   this.btnHelp.Text = "幫助";
   //
   // frmBase
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(450, 239);
   this.Controls.Add(this.panel1);
   this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
   this.Name = "frmBase";
   this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
   this.panel1.ResumeLayout(false);
   this.ResumeLayout(false);

  }
  #endregion

  public WizardController controller = null;

  public void DisableButton()
  {
   if(this.controller == null)
    return;
   if(this.controller.IsFirstForm)
   {
    this.btnGoPrev.Enabled = false;
   }
   else
   {
    this.btnGoPrev.Enabled = true;
   }
   if(this.controller.IsLastForm)
   {
    this.btnGoNext.Enabled = false;
   }
   else
   {
    this.btnGoNext.Enabled = true;
   }
  }
  protected virtual void UpdateInfo()
  {
 
  }
  protected virtual void GoNext()
  {
   UpdateInfo();
   controller.GoNext();
  }
  protected virtual void GoPrev()
  {
   UpdateInfo();
   controller.GoPrev();
  }
  protected virtual void Finish()
  {
   UpdateInfo();
   controller.FinishWizard();
   this.Visible = false;
  }
  protected virtual void Cancel()
  {
   this.controller.info = null;
   this.Close();
  }

  private void btnGoPrev_Click(object sender, System.EventArgs e)
  {
   GoPrev();
  }

  private void btnGoNext_Click(object sender, System.EventArgs e)
  {
   GoNext();
  }

  private void btnOver_Click(object sender, System.EventArgs e)
  {
   Finish();
  }

  private void btnCancel_Click(object sender, System.EventArgs e)
  {
   Cancel();
  }
 }
}

向導控制器WizardController類:

using System;
using System.Collections;


namespace Wizard
{
 /// <summary>
 /// WizardController 的摘要說明。
 /// </summary>
 public class WizardController
 {
  public WizardController()
  {
   //
   // TODO: 在此處添加構造函數邏輯
   //
   WizardForms.Add(new frmStep1());
   WizardForms.Add(new frmStep2());
   foreach(frmBase frm in WizardForms)
   {
    frm.controller = this;
    frm.DisableButton();
   }
  }
  private ArrayList WizardForms = new ArrayList();
  public Information info = new Information();
  private int curIndex = 0;

  public bool IsFirstForm
  {
   get{ return curIndex == 0;}  
  }
  public bool IsLastForm
  {
   get{return curIndex == this.WizardForms.Count - 1;}
  }
  public void GoNext()
  {
   if(curIndex+1 < WizardForms.Count)
   {
    ((frmBase)WizardForms[curIndex]).Visible = false;
    curIndex++;
   }
   else
   {
    return;
   }
   ((frmBase)WizardForms[curIndex]).Show();
   ((frmBase)WizardForms[curIndex]).DisableButton();
  }
  public void GoPrev()
  {
   if(curIndex-1 >= 0)
   {
    ((frmBase)WizardForms[curIndex]).Visible = false;
    curIndex--;
   }
   else
   {
    return;
   }
   ((frmBase)WizardForms[curIndex]).Show();
   ((frmBase)WizardForms[curIndex]).DisableButton();
  }
  public void BeginWizard()
  {
   ((frmBase)WizardForms[0]).Show();
   ((frmBase)WizardForms[curIndex]).DisableButton();
  }
  public void FinishWizard()
  {
   curIndex = 0;
   Dispose();
  }

  private void Dispose()
  {
   foreach(frmBase frm in WizardForms)
   {
    frm.Close();
   }
  }
 }
}

第一個子窗體:

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace Wizard
{
 public class frmStep1 : Wizard.frmBase
 {
  private System.Windows.Forms.TextBox txtName;
  private System.Windows.Forms.RadioButton rdoMale;
  private System.Windows.Forms.RadioButton radioButton1;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.ComponentModel.IContainer components = null;

  public frmStep1()
  {
   // 該調用是 Windows 窗體設計器所必需的。
   InitializeComponent();

   // TODO: 在 InitializeComponent 調用后添加任何初始化
  }

  /// <summary>
  /// 清理所有正在使用的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region 設計器生成的代碼
  /// <summary>
  /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.txtName = new System.Windows.Forms.TextBox();
   this.rdoMale = new System.Windows.Forms.RadioButton();
   this.radioButton1 = new System.Windows.Forms.RadioButton();
   this.label1 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.SuspendLayout();
   //
   // txtName
   //
   this.txtName.Location = new System.Drawing.Point(173, 61);
   this.txtName.Name = "txtName";
   this.txtName.Size = new System.Drawing.Size(152, 21);
   this.txtName.TabIndex = 1;
   this.txtName.Text = "";
   //
   // rdoMale
   //
   this.rdoMale.Checked = true;
   this.rdoMale.Location = new System.Drawing.Point(205, 115);
   this.rdoMale.Name = "rdoMale";
   this.rdoMale.Size = new System.Drawing.Size(40, 24);
   this.rdoMale.TabIndex = 2;
   this.rdoMale.TabStop = true;
   this.rdoMale.Text = "男";
   //
   // radioButton1
   //
   this.radioButton1.Location = new System.Drawing.Point(253, 115);
   this.radioButton1.Name = "radioButton1";
   this.radioButton1.Size = new System.Drawing.Size(32, 24);
   this.radioButton1.TabIndex = 3;
   this.radioButton1.Text = "女";
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(125, 64);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(48, 23);
   this.label1.TabIndex = 4;
   this.label1.Text = "姓名";
   //
   // label2
   //
   this.label2.Location = new System.Drawing.Point(0, 0);
   this.label2.Name = "label2";
   this.label2.TabIndex = 5;
   //
   // frmStep1
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(450, 239);
   this.Controls.Add(this.label1);
   this.Controls.Add(this.radioButton1);
   this.Controls.Add(this.rdoMale);
   this.Controls.Add(this.txtName);
   this.Controls.Add(this.label2);
   this.Name = "frmStep1";
   this.Controls.SetChildIndex(this.label2, 0);
   this.Controls.SetChildIndex(this.txtName, 0);
   this.Controls.SetChildIndex(this.rdoMale, 0);
   this.Controls.SetChildIndex(this.radioButton1, 0);
   this.Controls.SetChildIndex(this.label1, 0);
   this.ResumeLayout(false);

  }
  #endregion

  protected override void UpdateInfo()
  {
   this.controller.info.Name = txtName.Text.Trim();
   this.controller.info.IsMale = rdoMale.Checked;
  }

 }
}

第二個子窗體:

using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

namespace Wizard
{
 public class frmStep2 : Wizard.frmBase
 {
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.ComboBox cbbEduBackground;
  private System.Windows.Forms.CheckBox checkBox1;
  private System.Windows.Forms.CheckBox checkBox2;
  private System.Windows.Forms.CheckBox checkBox3;
  private System.Windows.Forms.CheckBox checkBox4;
  private System.ComponentModel.IContainer components = null;

  public frmStep2()
  {
   // 該調用是 Windows 窗體設計器所必需的。
   InitializeComponent();

   // TODO: 在 InitializeComponent 調用后添加任何初始化
  }

  /// <summary>
  /// 清理所有正在使用的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if (components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region 設計器生成的代碼
  /// <summary>
  /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.label1 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.cbbEduBackground = new System.Windows.Forms.ComboBox();
   this.checkBox1 = new System.Windows.Forms.CheckBox();
   this.checkBox2 = new System.Windows.Forms.CheckBox();
   this.checkBox3 = new System.Windows.Forms.CheckBox();
   this.checkBox4 = new System.Windows.Forms.CheckBox();
   this.SuspendLayout();
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(98, 72);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(40, 23);
   this.label1.TabIndex = 3;
   this.label1.Text = "學歷";
   //
   // label2
   //
   this.label2.Location = new System.Drawing.Point(98, 128);
   this.label2.Name = "label2";
   this.label2.Size = new System.Drawing.Size(64, 23);
   this.label2.TabIndex = 4;
   this.label2.Text = "編程語言";
   //
   // cbbEduBackground
   //
   this.cbbEduBackground.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
   this.cbbEduBackground.Items.AddRange(new object[] {
                  "本科",
                  "碩士",
                  "博士"});
   this.cbbEduBackground.Location = new System.Drawing.Point(170, 68);
   this.cbbEduBackground.Name = "cbbEduBackground";
   this.cbbEduBackground.Size = new System.Drawing.Size(152, 20);
   this.cbbEduBackground.TabIndex = 5;
   //
   // checkBox1
   //
   this.checkBox1.Location = new System.Drawing.Point(166, 123);
   this.checkBox1.Name = "checkBox1";
   this.checkBox1.Size = new System.Drawing.Size(48, 24);
   this.checkBox1.TabIndex = 6;
   this.checkBox1.Text = "C++";
   //
   // checkBox2
   //
   this.checkBox2.Location = new System.Drawing.Point(211, 123);
   this.checkBox2.Name = "checkBox2";
   this.checkBox2.Size = new System.Drawing.Size(48, 24);
   this.checkBox2.TabIndex = 7;
   this.checkBox2.Text = "java";
   //
   // checkBox3
   //
   this.checkBox3.Location = new System.Drawing.Point(267, 123);
   this.checkBox3.Name = "checkBox3";
   this.checkBox3.Size = new System.Drawing.Size(40, 24);
   this.checkBox3.TabIndex = 8;
   this.checkBox3.Text = "VB";
   //
   // checkBox4
   //
   this.checkBox4.Location = new System.Drawing.Point(312, 123);
   this.checkBox4.Name = "checkBox4";
   this.checkBox4.Size = new System.Drawing.Size(40, 24);
   this.checkBox4.TabIndex = 9;
   this.checkBox4.Text = "C#";
   //
   // frmStep2
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(450, 239);
   this.Controls.Add(this.checkBox4);
   this.Controls.Add(this.checkBox3);
   this.Controls.Add(this.checkBox2);
   this.Controls.Add(this.checkBox1);
   this.Controls.Add(this.cbbEduBackground);
   this.Controls.Add(this.label2);
   this.Controls.Add(this.label1);
   this.Name = "frmStep2";
   this.Controls.SetChildIndex(this.label1, 0);
   this.Controls.SetChildIndex(this.label2, 0);
   this.Controls.SetChildIndex(this.cbbEduBackground, 0);
   this.Controls.SetChildIndex(this.checkBox1, 0);
   this.Controls.SetChildIndex(this.checkBox2, 0);
   this.Controls.SetChildIndex(this.checkBox3, 0);
   this.Controls.SetChildIndex(this.checkBox4, 0);
   this.ResumeLayout(false);

  }
  #endregion

  protected override void UpdateInfo()
  {
   this.controller.info.EduBackground = cbbEduBackground.GetItemText(cbbEduBackground.SelectedItem);
   string lang = "";
   foreach(Control ctl in this.Controls)
   {
    if(ctl is CheckBox && ((CheckBox)ctl).Checked)
    {
     lang += ctl.Text + ";";
    }
   }
   this.controller.info.ProgrameLanguage = lang;
  }

 }
}

測試Demo:

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Wizard
{
 /// <summary>
 /// frmTest 的摘要說明。
 /// </summary>
 public class frmTest : System.Windows.Forms.Form
 {
  /// <summary>
  /// 必需的設計器變量。
  /// </summary>
  private System.ComponentModel.Container components = null;
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.Label label3;
  private System.Windows.Forms.Label label4;
  private WizardController wizard;

  public frmTest()
  {
   //
   // Windows 窗體設計器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
   //
  }

  /// <summary>
  /// 清理所有正在使用的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if(components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗體設計器生成的代碼
  /// <summary>
  /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.button1 = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.label1 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.label3 = new System.Windows.Forms.Label();
   this.label4 = new System.Windows.Forms.Label();
   this.SuspendLayout();
   //
   // button1
   //
   this.button1.Location = new System.Drawing.Point(48, 216);
   this.button1.Name = "button1";
   this.button1.Size = new System.Drawing.Size(104, 23);
   this.button1.TabIndex = 0;
   this.button1.Text = "顯示向導";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   //
   // button2
   //
   this.button2.Location = new System.Drawing.Point(192, 216);
   this.button2.Name = "button2";
   this.button2.Size = new System.Drawing.Size(104, 23);
   this.button2.TabIndex = 1;
   this.button2.Text = "顯示信息";
   this.button2.Click += new System.EventHandler(this.button2_Click);
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(72, 32);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(232, 23);
   this.label1.TabIndex = 2;
   //
   // label2
   //
   this.label2.Location = new System.Drawing.Point(72, 80);
   this.label2.Name = "label2";
   this.label2.Size = new System.Drawing.Size(224, 23);
   this.label2.TabIndex = 3;
   //
   // label3
   //
   this.label3.Location = new System.Drawing.Point(72, 120);
   this.label3.Name = "label3";
   this.label3.Size = new System.Drawing.Size(232, 23);
   this.label3.TabIndex = 4;
   //
   // label4
   //
   this.label4.Location = new System.Drawing.Point(72, 160);
   this.label4.Name = "label4";
   this.label4.Size = new System.Drawing.Size(232, 23);
   this.label4.TabIndex = 5;
   //
   // frmTest
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(344, 261);
   this.Controls.Add(this.label4);
   this.Controls.Add(this.label3);
   this.Controls.Add(this.label2);
   this.Controls.Add(this.label1);
   this.Controls.Add(this.button2);
   this.Controls.Add(this.button1);
   this.Name = "frmTest";
   this.Text = "向導測試";
   this.ResumeLayout(false);

  }
  #endregion
  /// <summary>
  /// 應用程序的主入口點。
  /// </summary>
  [STAThread]
  static void Main()
  {
   application.Run(new frmTest());
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
   this.wizard = new WizardController();
   this.wizard.BeginWizard();
  }using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace Wizard
{
 /// <summary>
 /// frmTest 的摘要說明。
 /// </summary>
 public class frmTest : System.Windows.Forms.Form
 {
  /// <summary>
  /// 必需的設計器變量。
  /// </summary>
  private System.ComponentModel.Container components = null;
  private System.Windows.Forms.Button button1;
  private System.Windows.Forms.Button button2;
  private System.Windows.Forms.Label label1;
  private System.Windows.Forms.Label label2;
  private System.Windows.Forms.Label label3;
  private System.Windows.Forms.Label label4;
  private WizardController wizard;

  public frmTest()
  {
   //
   // Windows 窗體設計器支持所必需的
   //
   InitializeComponent();

   //
   // TODO: 在 InitializeComponent 調用后添加任何構造函數代碼
   //
  }

  /// <summary>
  /// 清理所有正在使用的資源。
  /// </summary>
  protected override void Dispose( bool disposing )
  {
   if( disposing )
   {
    if(components != null)
    {
     components.Dispose();
    }
   }
   base.Dispose( disposing );
  }

  #region Windows 窗體設計器生成的代碼
  /// <summary>
  /// 設計器支持所需的方法 - 不要使用代碼編輯器修改
  /// 此方法的內容。
  /// </summary>
  private void InitializeComponent()
  {
   this.button1 = new System.Windows.Forms.Button();
   this.button2 = new System.Windows.Forms.Button();
   this.label1 = new System.Windows.Forms.Label();
   this.label2 = new System.Windows.Forms.Label();
   this.label3 = new System.Windows.Forms.Label();
   this.label4 = new System.Windows.Forms.Label();
   this.SuspendLayout();
   //
   // button1
   //
   this.button1.Location = new System.Drawing.Point(48, 216);
   this.button1.Name = "button1";
   this.button1.Size = new System.Drawing.Size(104, 23);
   this.button1.TabIndex = 0;
   this.button1.Text = "顯示向導";
   this.button1.Click += new System.EventHandler(this.button1_Click);
   //
   // button2
   //
   this.button2.Location = new System.Drawing.Point(192, 216);
   this.button2.Name = "button2";
   this.button2.Size = new System.Drawing.Size(104, 23);
   this.button2.TabIndex = 1;
   this.button2.Text = "顯示信息";
   this.button2.Click += new System.EventHandler(this.button2_Click);
   //
   // label1
   //
   this.label1.Location = new System.Drawing.Point(72, 32);
   this.label1.Name = "label1";
   this.label1.Size = new System.Drawing.Size(232, 23);
   this.label1.TabIndex = 2;
   //
   // label2
   //
   this.label2.Location = new System.Drawing.Point(72, 80);
   this.label2.Name = "label2";
   this.label2.Size = new System.Drawing.Size(224, 23);
   this.label2.TabIndex = 3;
   //
   // label3
   //
   this.label3.Location = new System.Drawing.Point(72, 120);
   this.label3.Name = "label3";
   this.label3.Size = new System.Drawing.Size(232, 23);
   this.label3.TabIndex = 4;
   //
   // label4
   //
   this.label4.Location = new System.Drawing.Point(72, 160);
   this.label4.Name = "label4";
   this.label4.Size = new System.Drawing.Size(232, 23);
   this.label4.TabIndex = 5;
   //
   // frmTest
   //
   this.AutoScaleBaseSize = new System.Drawing.Size(6, 14);
   this.ClientSize = new System.Drawing.Size(344, 261);
   this.Controls.Add(this.label4);
   this.Controls.Add(this.label3);
   this.Controls.Add(this.label2);
   this.Controls.Add(this.label1);
   this.Controls.Add(this.button2);
   this.Controls.Add(this.button1);
   this.Name = "frmTest";
   this.Text = "向導測試";
   this.ResumeLayout(false);

  }
  #endregion
  /// <summary>
  /// 應用程序的主入口點。
  /// </summary>
  [STAThread]
  static void Main()
  {
   Application.Run(new frmTest());
  }

  private void button1_Click(object sender, System.EventArgs e)
  {
   this.wizard = new WizardController();
   this.wizard.BeginWizard();
  }

  private void button2_Click(object sender, System.EventArgs e)
  {
   if(this.wizard != null && this.wizard.info != null)
   {
    this.label1.Text = this.wizard.info.Name;
    if(this.wizard.info.IsMale)
     this.label2.Text = "男";
    else
     this.label2.Text = "女";
    this.label3.Text = this.wizard.info.EduBackground;
    this.label4.Text = this.wizard.info.ProgrameLanguage;
   }
   else
   {
    MessageBox.Show("NULL");
   }
  }
 }
}


  private void button2_Click(object sender, System.EventArgs e)
  {
   if(this.wizard != null && this.wizard.info != null)
   {
    this.label1.Text = this.wizard.info.Name;
    if(this.wizard.info.IsMale)
     this.label2.Text = "男";
    else
     this.label2.Text = "女";
    this.label3.Text = this.wizard.info.EduBackground;
    this.label4.Text = this.wizard.info.ProgrameLanguage;
   }
   else
   {
    MessageBox.Show("NULL");
   }
  }
 }
}


鏈接地址: http://maxianghui.VEVb.com/archive/2006/07/13/449896.html


發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
亚洲缚视频在线观看| 欧洲日韩成人av| 性色av一区二区三区在线观看| 亚洲男人的天堂网站| 久久精品99无色码中文字幕| 久久青草福利网站| 久久久久久久亚洲精品| 国语自产偷拍精品视频偷| 日韩精品一区二区视频| 亚洲午夜未删减在线观看| 国产亚洲欧美aaaa| 精品福利视频导航| 欧美性jizz18性欧美| 精品久久久久久中文字幕大豆网| 欧美激情区在线播放| 亚洲自拍高清视频网站| 国产精品看片资源| 欧美黄色免费网站| 一区二区三区高清国产| 日韩一区二区在线视频| 91精品国产综合久久男男| 日韩成人黄色av| 国产精品免费一区二区三区都可以| 国产美女扒开尿口久久久| 国产精品电影一区| 91九色国产社区在线观看| 主播福利视频一区| 中日韩美女免费视频网站在线观看| 中文字幕亚洲图片| 日韩精品亚洲元码| 国产精品一区二区三区在线播放| 97热在线精品视频在线观看| 日韩中文在线中文网三级| 亚洲欧美激情视频| 亚洲最新av网址| 中文字幕欧美亚洲| 色视频www在线播放国产成人| 亚洲欧美激情另类校园| 精品国产区一区二区三区在线观看| 欧美丝袜美女中出在线| 欧美日韩国产在线看| 国产精品女人久久久久久| 国产激情999| 久久福利视频导航| 久久视频在线免费观看| 日韩激情视频在线| 国产精品日韩一区| 欧美电影在线播放| 欧美日韩国产成人高清视频| 亚洲性生活视频在线观看| 久久久久国产一区二区三区| 在线精品播放av| 亚洲色图50p| 国产日韩欧美在线观看| 九九热这里只有精品免费看| 久久久国产在线视频| 欧美激情小视频| 国产丝袜视频一区| 亚洲一区二区三区四区视频| 成人精品视频99在线观看免费| 久久99视频精品| 亚洲免费视频一区二区| 热re91久久精品国99热蜜臀| 日韩成人中文字幕| 69久久夜色精品国产69| 久久久久久国产精品美女| 国产精品久久久久久久久| 欧美一级大胆视频| 国产精品扒开腿做爽爽爽的视频| 日韩成人在线视频观看| 久久视频这里只有精品| 欧美激情乱人伦一区| 久久亚洲精品网站| 国产精品电影一区| 国产日韩中文字幕在线| 欧美国产精品日韩| 欧美日韩中文字幕| 日本久久91av| 在线观看欧美www| 91精品免费视频| 久久久久国产精品免费网站| 久久精品国产欧美激情| 国产精品盗摄久久久| 91高清视频免费观看| 国产精品女人网站| 久久久久久综合网天天| 亚洲国产精品高清久久久| 色偷偷av一区二区三区乱| 欧美成人精品一区| 日韩欧美在线观看| 日韩欧美a级成人黄色| 在线观看日韩专区| 97在线观看免费高清| 国产男女猛烈无遮挡91| 欧美裸体视频网站| 九九视频直播综合网| 成人精品久久av网站| 国产精品96久久久久久| 欧美大尺度在线观看| 日韩精品高清在线观看| 欧美激情亚洲国产| 国产欧美一区二区三区久久| 欧美成人剧情片在线观看| 亚洲精品国产综合区久久久久久久| 97国产精品视频| 亚洲视频在线播放| 日韩av一区二区在线观看| 国产精品1234| 亚洲欧美国产一本综合首页| 正在播放欧美一区| 亚洲人成网站在线播| 欧美在线免费观看| 国产视频精品xxxx| 欧美日韩在线视频一区二区| 久久久久免费精品国产| 国产精品亚洲欧美导航| 97精品伊人久久久大香线蕉| 欧美夫妻性生活视频| 亚洲一区二区三区久久| 国产伊人精品在线| 在线观看免费高清视频97| 日本精品一区二区三区在线| 欧美激情影音先锋| 国产精品视频区1| 日韩精品极品在线观看播放免费视频| 成人激情电影一区二区| 国产精品吴梦梦| 精品国产精品三级精品av网址| 夜夜躁日日躁狠狠久久88av| 亚洲天堂开心观看| 欧美激情免费看| 91社区国产高清| 国产精品偷伦视频免费观看国产| 亚洲精品日韩欧美| 久久精品国产久精国产思思| 久久精品视频网站| 97精品视频在线播放| 国产成人一区二区三区| 懂色aⅴ精品一区二区三区蜜月| 亚洲一区国产精品| 国产xxx69麻豆国语对白| 国产美女久久精品| 最近2019年日本中文免费字幕| 久久精品国产亚洲| 77777亚洲午夜久久多人| 国产中文欧美精品| 亚洲欧美日韩中文视频| 性金发美女69hd大尺寸| 91国内精品久久| 中文字幕亚洲欧美| 亚洲国产精品小视频| 性欧美长视频免费观看不卡| 亚洲福利视频免费观看| 中文字幕精品在线| 亚洲精品久久久久久下一站| 国产精品亚洲一区二区三区| 久久男人av资源网站| 国产偷国产偷亚洲清高网站| 久久久久久久久久婷婷| 亚洲一区二区三区在线免费观看| www.欧美精品一二三区| 亚洲成人动漫在线播放| 亚洲欧美另类自拍| 91精品久久久久久久久青青|