Roulette program. I've got a RichTextBox (
History) what shows the last numbers,
aligned by their colors. The newest number takes place at the end of the list.
The Click event:
private void numbers_Click(object sender, System.EventArgs e)
Button numbers = (Button)sender;
History.SelectionColor = Color.LightGreen;
History.SelectionAlignment = HorizontalAlignment.Center;
History.SelectionColor = Color.Red;
History.SelectionAlignment = HorizontalAlignment.Left;
History.SelectionColor = Color.LightGray;
History.SelectionAlignment = HorizontalAlignment.Right;
History.AppendText(numbers.Text + "\n");
Works properly. Now I would like to reverse the order. But can't figure out the solution.
What I tried:
History.Text = History.Text.Insert(0, numbers.Text + "\n");
This aligns every number to the same side depend on what was the first and only shows one of the required colors after I selected all of the texts and clicked one button.
History.Text = History.Text.Insert(0, History.SelectedText = numbers.Text + "\n");
Again, aligns every number to the same side, but now every numbers' colors changing with the new number's color.