C#窗体常用方法

1.Show和ShowDialog方法:

Show:显示无模式窗体

ShowDialog:显示模式对话窗体

窗体名:Show();   ShowDialog();

eg:Show

private  void  button_FormShow_Click(object  sender,EventArgs e)

{

Form2  formShow=nerw  Form2();

formShow.Text="非模式显示";

formShow.Show();

}

eg:ShowDialog

private  void  button_FormShoDialog_Click(object  sender,EventArgs e)

{

Form2  formShowDialog=nerw  Form2();

formShowDialog.Text="模式对话框显示";

formShowDialog.ShowDialog();

}


2.HIde、Close、Click、Doubleclick

你可能感兴趣的:(C#窗体常用方法)