110,534
社区成员
发帖
与我相关
我的任务
分享
public class Form1 : Form{
private int returnValue_;
public int ReturnValue{
get{return returnValue_;}
private set{returnValue_ = value;}
}
public void button_Click(Object sender, EventArgs e){
this.DialogResult = DialogResult.OK;
this.ReturnValue = 100;
}
}
using(Form1 fm = new Form1()){
if(DialogResult.OK == fm.ShowDialog()){
int retVal = fm.ReturnValue;
}
}