コード例 #1
0
     public MyForm()
     {
         InitializeComponent();
         if (alreadyOpened != null) {
             alreadyOpened.Close();
         alreadyOpened = this;
     }
 }
コード例 #2
0
    static public FormResult Exec(string parm1, string parm2)
    {
        var result = new FormResult();
        var me     = new MyForm();

        me.parm1  = parm1;
        me.parm2  = parm2;
        result.dr = me.ShowDialog();
        if (result.dr == DialogResult.OK)
        {
            result.LastName  = me.LastName;
            result.FirstName = me.FirstName;
        }
        me.Close();   // should use try/finally or using clause
        return(result);
    }
コード例 #3
0
 private void boton_Click(object sender, EventArgs e)
 {
     this.Valor = (int)Entrada.Value;
     MyForm.Close();
 }