D
DG
i do:
for(int i=0; i<10; i++)
{
txtLog.Text = i.ToString() + "\r\n" + txtLog.Text;
startSelection = txtLog.SelectionStart;
lenghtSelection = txtLog.SelectionLength;
txtLog.Select(0, i.ToString().Length);
if(i%2 == 0)
{
txtLog.SelectionColor = Color.Black;
MessageBox.Show("");
}
else
{
txtLog.SelectionColor = Color.Red;
MessageBox.Show("");
}
txtLog.Select(startSelection, lenghtSelection);
}
i expect every other row to be different color but
first row get colored well, but afer new row is colored in new color, all
rows under are colored to old color
e.g:
(5th step)
black
red
red
red
red
(6th step)
red
black
black
black
black
black
when does coloring actually occur? after SelectionColor?
for(int i=0; i<10; i++)
{
txtLog.Text = i.ToString() + "\r\n" + txtLog.Text;
startSelection = txtLog.SelectionStart;
lenghtSelection = txtLog.SelectionLength;
txtLog.Select(0, i.ToString().Length);
if(i%2 == 0)
{
txtLog.SelectionColor = Color.Black;
MessageBox.Show("");
}
else
{
txtLog.SelectionColor = Color.Red;
MessageBox.Show("");
}
txtLog.Select(startSelection, lenghtSelection);
}
i expect every other row to be different color but
first row get colored well, but afer new row is colored in new color, all
rows under are colored to old color
e.g:
(5th step)
black
red
red
red
red
(6th step)
red
black
black
black
black
black
when does coloring actually occur? after SelectionColor?