Click here to Skip to main content
15,891,375 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a tabcontrol which contains tabpages. Each tab page take a while to load data for which i show a progress bar. [b] My issue here is while the progressbar is loaded user can click other tab and after completion of progress the control goes back to new tab selected. So i want to disable tabs till the progress bar is completed. I am using C# .net as code of my language.
Posted
Comments
strogg 26-May-12 4:14am    
Just requires a little guesswork. Try
YourTabControl.Enabled=false;

1 solution

while is your loop for incrementing progressbar value enable false the tabcontrol and when loop end than first show message box that process completed than enable true the tabcontrol.

it will work.

here is simple example:-

C#
private void button1_Click(object sender, EventArgs e)
        {

            int Maxitem = 0;
            tabControl1.Enabled = false;

            Maxitem = 50000;
            progressBar1.Maximum = Maxitem;
            progressBar1.Value = 0;

            for (int i = 0; i < Maxitem; i++)
                progressBar1.Value += 1;
            MessageBox.Show("completed");
            progressBar1.Value = 0;
            tabControl1.Enabled = true;

        }
 
Share this answer
 
Comments
Prosan 28-May-12 3:01am    
what's happen is your problem solved or not?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900