I have a method to generate software activation key from User Information:
private async void GenerateAsync() { await Task.Run(() =>
I use this method in Winforms:
progressBar1.Invoke((Action)(() => progressBar1.Value=50))