实现效果:



知识运用:
通过泛型方法的重载实现调用窗体与提示窗体分开编写
实现代码:
public void FormOperate<T>(){
Form2 frm_2 = new Form2(); //创建Form2窗体对象
frm_2.ShowDialog(); //以对话框形式显示Form2窗体
}
public void FormOperate<T>(string strError) {
MessageBoxIcon mbi = MessageBoxIcon.Error; //创建提示框中图标对象
MessageBox.Show(strError,"提示",MessageBoxButtons.OK,mbi); //显示错误提示框
}
浙公网安备 33010602011771号