I've read some other questions but I couldn't figure out how to solve my problem.
I have two forms in my application. frmMain
and frmAdd
. I want to open frmAdd
from main form with a parameter to use in frmAdd
.The below code i have tried
frmMain
frmAdd frm= new frmAdd("A");
frm.ShowDialog();
frmAdd
if (parameter=="A")
//Do this
else if(parameter=="B")
//Do that
How can I make it work?
public partial class frmAdd : Form
{
public frmAdd() //Should I add somthing here?
{
InitializeComponent();
}
}