Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing hyperlinks as plain text in a Richtextbox control

Am using RichTextBox in a C#/Winforms application.

Am showing some text in this control which has got some UNC file paths embedded into it: for example: filePath= "\\serverName\DirName\File"

Richtextbox shows this file path as a clickable hyperlink in the UI. filePath= "\\serverName\DirName\File.doc"

I want to show it as plain text instead.How do i achieve this?

Thanks.

like image 512
user40907 Avatar asked Nov 14 '10 09:11

user40907


1 Answers

There's a property you can change named DetectUrls. It is set to true by default, set it to false to get rid of the clicking behaviour e.g.

richTextBoxName.DetectUrls = false;

Or you can simply set it to false using the properties editor in Visual Studio.

http://msdn.microsoft.com/en-us/library/system.windows.forms.richtextbox.detecturls.aspx

like image 139
Simon Campbell Avatar answered Sep 21 '22 19:09

Simon Campbell