user40907
user40907

Reputation: 1552

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.

Upvotes: 6

Views: 4159

Answers (1)

Simon Campbell
Simon Campbell

Reputation: 752

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

Upvotes: 15

Related Questions