Hello, well I have a problem in C# I don't want to have to make a new function for diffrent colours, so I thought the below would work:
To call it:
The function:Code:msg("0", "hi");
I get the error Error 'Cannot implicitly convert type 'string' to 'bool'Code:public void msg(string msgtype, string Message) { if (msgtype = "o")//0=Red|1=Green|2=Black { String res = Message; int selectionStart = richTextBox1.TextLength; richTextBox1.AppendText(res + Environment.NewLine); // OR rtbTestResult.Text += res + Environment.NewLine; richTextBox1.SelectionStart = selectionStart; richTextBox1.SelectionLength = res.Length; richTextBox1.SelectionColor = Color.Red; } }
Any ideas?