I am new to programing and just want some direction on the best way to accomplish this.
I have created a form with 5 tabs on it. One tab I added a linked label that says 'Payroll Report' when the user clicks on this label I want the form to change as ask for a Begining Date and End Date and include a Submit button that will call my stored proc. I know I could add a new form and then show it ...but I am trying not to have too many forms ...
so how do I change the existing tab when the user clicks on my label.
Thanks in advance for all your help
Loading
Scott LyslePosted Feb 2, 2008, 9:48 AM
If you just want to change tabs without using the tab control, you can change the selected index property to the tab you want to show:
tabControl1.SelectedIndex = 1;
If you want to stay on a tab and change the controls, you could do something like this:
1. Add a flow layout panel
2. Put two panels in the flow layout
3. make one panel visible and the other not visible
4. on the event that changes the group of visible panels, set one panel visible = false and the other panel visible = true.
for example:
private void label1_Click(object sender, EventArgs e) { panel2.Visible = true; panel1.Visible = false; }