判断richtextbox选中的是否为图片 if (richTextBox1.SelectedRtf.IndexOf(@"{pict") > -1) { Text = "Img"; } else { Text = "Form1"; }