I have a usercontrol and two classes I want to print result of my class1 into usercontrol.I am sending result from class using this line
((merge.MyControl)(MyControlInstance)).CLIDisplay = e.WorkItem.CustomerId;
my control property to show result is
public string CLIDisplay
{
get { return lblResultCLI.Text; }
set
{
lblResultCLI.Text = value;
}
}
but I am getting following Exception when i called a class to my c# form
An exception of type 'System.InvalidOperationException' occurred in System.Windows.Forms.dll but was not handled in user code
Additional information: Cross-thread operation not valid: Control 'tbxEvents' accessed from a thread other than the thread it was created on.