I'm writing an app in C# with the following arrangement of controls on a form.
First, there is a child form which contains a splitcontainer, which comes with two panels, Panel1 on the left and Panel2 on the right. Panel1 contains checkboxes and textboxes. Panel2 contains a tab control. Each tab, when created programatically, contains checkboxes and textboxes.
When I click Save at the top of the child form, all data from all controls in Panel1 save to a binary file correctly. Then the save routine will have to iterate through each tab in the tab control and save data from the checkboxes and textboxes in each tab. Here is what I have so far:
foreach (TabPage tab in tabControl1.TabPages)
{
string Question = tbQuestion.Text(tabControl1.SelectedIndex);
}
Unfortunately, tbQuestion.Text ends up with a wiggly line under it, the error message indicating that it "doesn't exist in the current context." The same will happen with all the other controls in each tab. What do I need to do to access the controls in each tab?