int i = textBox1.SelectionStart; var end = textBox1.Text.IndexOf(Environment.NewLine,i); var begin = textBox1.Text.XXX(Environment.NewLine,i); /* the line above needs a method to find the firs occurance of newline before the i postion */ bool isEmpty = textBox1.Text.Substring(begin,end-begin).Trim() == "";