我正在RichTextBox中寫入文字。在RichTextBox中打印彩色文字
如何在紅色中打印lineItems和j + 1變量。
例如(以粗體=紅色):元Growthougth在列,一直沒有writen右。
private void button2_Click(object sender, EventArgs e)
{
// Numbers-IDs
if (colB[j] == "int_number")
{
if (!arithmos(lineItems[j]))
richTextBox1.Text += "Element " + lineItems[j] + "\t in " + (j + 1) + "th coloumn,has not been writen right" + Environment.NewLine;
}
// Alphanumeric
else if (colB[j] == "alpharithmitiko")
{
if (!numword(lineItems[j]))
richTextBox1.Text += "Element " + lineItems[j] + " in " + (j + 1) + "th coloumn,has not been writen right " + Environment.NewLine;
}
//Words
else if (colB[j] == "words")
{
if (!word(lineItems[j]))
richTextBox1.Text += "Το στοιχείο " + lineItems[j] + " in " + (j + 1) + "th coloumn,has not been writen right" + Environment.NewLine;
}
//Date
else if (colB[j] == "date")
{
if (!date(lineItems[j]))
richTextBox1.Text += "Το στοιχείο " + lineItems[j] + " in " + (j+1) + "th coloumn,has not been writen right" + Environment.NewLine;
}
}
什麼是你的問題? – Reniuz
@Reniuz看看我的編輯 –
正在改變文字forecolor不工作? – Reniuz