Click here to Skip to main content
15,881,938 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a problem in updating the Label which i am using to show the Percentage completion in progress bar.I am using background worker to achieve this. When i run the application i am able to see the progress bar updating correctly whereas the label which i have used to show the percentage completion is not visible

Following are the codes
C#
public int m_CurrentTestcase;
 

public void IncrementProgress()
{
m_CurrentTestcase++;
UpdateDetails();
}
 

private void UpdateDetails()
{
prgbarStatus.Value = m_CurrentTestcase;
this.Text = m_CurrentTestcase.ToString() + "of" + m_MaxTestcases.ToString() + "Testcases Completed";
 
}
Posted
Updated 20-Oct-14 0:03am
v2

1 solution

Quote:
this.Text = m_CurrentTestcase.ToString() + "of" + m_MaxTestcases.ToString() + "Testcases Completed";

I suppose you have to use the label name, instead of this in the above line.
Also make sure to read "How to: Make Thread-Safe Calls to Windows Forms Controls"[^].
 
Share this answer
 

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