I have two forms FormA and FormB. Each has combobox prefiled with data from database. I can pass data from each of these box to another formC but I have to comment out a section of the code each time. Is there a way to pass such data(when I click submit button) depending on which form I am working with?
Here is what my code looks like...
FormA(Source)
public static string authcode = "";
private void btnok_Click(object sender, EventArgs e)
{
authcode = cmbselectexam.SelectedItem.ToString();
Questions qs = new Questions();
qs.Show();
this.Hide();
}
FormB(Another source)
public static string setauthcode = "";
setauthcode =txtauthorizationcode.Text;
Questions qs = new Questions();
this.Hide();
qs.Show();
FormC(recepient)
private void Questions_Load(object sender, EventArgs e)
{
//txtauthorizationcode.Text = TestDetails.setauthcode;
txtauthorizationcode.Text = EditQuestions.authcode;
}
Joel BwanaPosted Sep 18, 2020, 6:08 AM
Hamid KhanPosted Sep 1, 2020, 6:45 AM
Joel BwanaPosted Aug 24, 2020, 2:54 PM
Laxmidhar SahooPosted Aug 14, 2020, 4:34 AM
Jenith ThakkarPosted Aug 13, 2020, 11:18 PM
Rajanikant HawaldarPosted Aug 13, 2020, 10:50 PM
Joel BwanaPosted Aug 13, 2020, 5:28 PM
Joel BwanaPosted Aug 13, 2020, 5:26 PM
Rajanikant HawaldarPosted Aug 13, 2020, 12:40 AM
Jenith ThakkarPosted Aug 13, 2020, 12:30 AM
Farhan AhmedPosted Aug 13, 2020, 12:00 AM
Laxmidhar SahooPosted Aug 12, 2020, 11:21 PM