private async void button1_Click_1(object sender, EventArgs e)
{
foreach (var word in GetWords())
{
richTextBox1.Text += (word + ' ');
await Task.Delay(hız);
Size textSize = TextRenderer.MeasureText(richTextBox1.Text, richTextBox1.Font,
richTextBox1.Size, flags);
if (textSize.Height >= (richTextBox1.Height - 40))
{
richTextBox1.Clear();
}
}
}
This is the code that I use. It works, but I want to stop it any time and then continue from where I leave. The problem is I don't know how to stop.