private void cmdOk_Click( object sender, EventArgs e ) { if( Apply() ) { this.DialogResult = System.Windows.Forms.DialogResult.OK; this.Close(); } }