radio button - Use DialogResult in windows Form application c# -


i want use dialogresult go next form , visible or invisible control in next form radio button checked. in first form use code:

this.dialogresult = dialogresult.ok;  loader.enabled = false;  this.close();  return;

and in next form use this:

private void form1_load(object sender, eventargs e)  {    first_form first = new first_form();    if (first.showdialog() == dialogresult.ok)    {       messagebox.show("device found!");       serialport1 = first.comport;       first.comport.close();       serialport1.close();       serialport1.open();       timer1.enabled = true;       timer2.enabled = true;       pictureboxconect.visible = true;       label_conect.visible = true;    }    else    {       messagebox.show("not device found!");       pictureboxdisconect.visible = true;       label_disconect.visible = true;    }  }

i want use radio button in myfirst form

try this,

if (radiobutton.checked == true)    this.dialogresult = dialogresult.yes; else    this.dialogresult = dialogresult.cancel; 

Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -