I want to use a tab control to switch between sets of data displayed in a DataGridView (currently I’m using radio buttons). At runtime I can just move controls from one tab to the next, but the SelectedIndexChanged event doesn’t fire in the designer.
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
tabControl1.TabPages[tabControl1.SelectedIndex].Controls.Add(label1);
}
Is there a way I can have the DGV appear on all my tabs in the designer, or is this a limitation I’ll have to live with?
Will the tab control switch any controls other than the DGV? Could you just lay the tab control down, adjust the vertical height so that it is only tall enough for the tabs themselves, and then put the DGV underneath it (so that it is not in the tab control)?