I placed a RichTextBox control on a new form and launched the project. So the RichTextBox.Text = \"\";
Each time I press Up or Down keys I heard the annoying BEEP so
This code below should stop the beeping sound, and works with wrapped and unwrapped text:
private void richTextBox1_KeyDown(object sender, KeyEventArgs e)
{
if (
richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart) == 0 && e.KeyData == Keys.Up ||
richTextBox1.GetLineFromCharIndex(richTextBox1.SelectionStart) == richTextBox1.GetLineFromCharIndex(richTextBox1.TextLength) && e.KeyData == Keys.Down ||
richTextBox1.SelectionStart == richTextBox1.TextLength && e.KeyData == Keys.Right ||
richTextBox1.SelectionStart == 0 && e.KeyData == Keys.Left
) e.Handled = true;
}