private void btnGetPath_Click(object sender, EventArgs e)
{
    Thread thread1 = new Thread(() => Allfunction());
    thread1.Start();
    txtCmd.AppendText("\n thread of getFiles() start");
}
private void Allfunction(object sender, EventArgs e)
{    
    txtCmd.Invoke(new Action( () =>
    { 
        txtCmd.AppendText("\n hello world");
    }));
}
When I was going for threading text and label are User Interface Thread so I invoke this to change into multi thread please give me help for making a function for all text and label therefore I will help me to take a function only not write full code for invoke.
 
     
    