private void pCAToolStripMenuItem_Click(object sender, EventArgs e) { string name = Microsoft.VisualBasic.Interaction.InputBox("Enter name.", "File Name", ""); //td1=new Thread(() => bol=pca.ExecutePCA1(name)); //td1.Start(); if (!pca.ExecutePCA1(name)) { MessageBox.Show("The Record for the provided name does not exist!"); } else { MessageBox.Show("PCA Done!"); timer1.Interval = 50; progress.Visible = true; timer1.Start(); } //use time bar here }