Lia Meeds

Lia Meeds

  • NA
  • 110
  • 4.4k

How to underline keyword in richtextbox

Apr 27 2020 8:09 AM

private void ButtonCheck_Click(object sender, EventArgs e)

{

string s = richTextBox1.Text;

int i = 0;

if (s.Contains("FREE") == true || s.Contains("Free") == true)

{

i = i + 1;

}

if (s.Contains("GET") == true || s.Contains("Get") == true)

{

i = i + 1; 

}

if (s.Contains("http://") == true)

{

i = i + 1; 

if (i > 0)

{

MessageBox.Show("Its a SPAM \n Spam Words Detected is " + i + ".", "SMS SPAM DETECTION TOOL | KEYWORD", MessageBoxButtons.OK);

}

else

{

MessageBox.Show("Its not a SPAM", "SMS SPAM DETECTION TOOL | KEYWOORD", MessageBoxButtons.OK, MessageBoxIcon.Information);

}

}

 
Question:

How to underline every keyword in richtextbox when s.Contain == True..  

Answers (1)