private void richTextBox1_SelectionChanged(object sender, EventArgs e) { if (richTextBox1.SelectedText != null && !string.IsNullOrEmpty(richTextBox1.SelectedText)) button2.Enabled = true; else button2.Enabled = false; }