我用richtextbox打开一个文本文件,如果文本文件里有网址,在richtextbox中会显示成链接,如果不想要这样要怎么办?

解决方案 »

  1.   

    在其中写入带有http的链接时,会自动显示下划线的,然后在下面事件中写代码        private void richTextBox1_LinkClicked(object sender, LinkClickedEventArgs e)
            {
                System.Diagnostics.Process.Start("浏览器exe路径", e.LinkText); 
            }
      

  2.   

    鼠标的坐标获取字符位置
    void chatRichTextBox1_MouseMove(object sender, MouseEventArgs e)
            {
                //获取位置。
                int index = chatRichTextBox1.GetCharIndexFromPosition(e.Location);
            }
    http://topic.csdn.net/u/20100119/15/e91ce578-025b-4731-9feb-8c87410f8da9.html
      

  3.   

    用代码设置。写一句
    richTextBox1.DetectUrls = false;