This is the function which I'm using:
private void Convert2Morse(object obj)
{
TextConverted = am.Convert(NormalText);
foreach (char symbol in TextConverted)
{
int milliseconds = 0;
switch (symbol)
{
case '·': milliseconds = 500; break;
case '—': milliseconds = 1000; break;
case ' ': continue;
default: throw new Exception("Something is wrong");
}
System.Media.SystemSounds.Beep.Play();
System.Threading.Thread.Sleep(milliseconds);
}
}
The TextConverted property is showed in a textBox, but is refreshed until finished the subroutine.
Is there a way where can show refresh UI?