TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Joel Bwana
NA
24
1.8k
Passing data from 2 forms to same textbox c#
Aug 12 2020 2:35 PM
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;
}
Reply
Answers (
12
)
WinForm Elementhost with WPF doesn´t show 3d Graphic
String not working in main part