---
title: "WPF RichTextBox Image Link issue"  
description: "WPF RichTextBox Image Link issue"  
author: "Anonymous User"  
published: 2013-09-23  
updated: 2013-09-23  
canonical: https://www.mindstick.com/forum/1501/wpf-richtextbox-image-link-issue  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# WPF RichTextBox Image Link issue

I am loading a .rtf [file](https://www.mindstick.com/articles/59/encrypting-and-decrypting-files-using-c-sharp) into a [WPF](https://www.mindstick.com/forum/304/wpf) [Rich](https://yourviews.mindstick.com/story/2229/10-things-to-know-about-rich-india) [TextBox](https://www.mindstick.com/forum/12714/dynamic-textbox-in-gridview) and my [images](https://www.mindstick.com/interview/1067/what-is-the-php-predefined-variable-that-tells-the-what-type-of-images-that-php-support) that have [links](https://www.mindstick.com/blog/415/css3-links) are getting this underline [property](https://www.mindstick.com/blog/205/property-notification-in-c-sharp) added. I do not want the underline and cant seem to get rid of it.

```
              public
MainWindow()    {       
InitializeComponent();        Assembly assembly = Assembly.GetExecutingAssembly();        Stream s= assembly.GetManifestResourceStream("WPFRichTextIssue.Sigs.MSC.rtf");        using (s)        {             TextRange TR = new TextRange(RTB.Document.ContentStart, RTB.Document.ContentEnd);        TR.Load(s,DataFormats.Rtf);        }    }
```

I have tired to find the underlined images with

```
  if (TR.GetPropertyValue(Inline.TextDecorationsProperty) == TextDecorations.Underline)            {            }            else            {                // Do something            }
```

But the [Image](https://www.mindstick.com/articles/23551/an-investigate-distinctive-seafood-restaurant-for-your-image-stamp-character) is not Inline.Text so it does not find it... Any help would be great.

## Replies

### Reply by Pravesh Singh

Hi Brad,

Looking in your XAML, just after the RTB opening tag that looks something like this:

<RichTextBox x:Name="RTB_Reply" HorizontalAlignment="Left" Height="157" Margin="302,338,0,0" VerticalAlignment="Top" Width="488" IsReadOnly="True">

## Paste this:

```
<RichTextBox.Resources>    <Style TargetType="{x:Type Hyperlink}">        <Setter Property="TextDecorations" 
Value="{x:Null}"/>    </Style></RichTextBox.Resources>
```


---

Original Source: https://www.mindstick.com/forum/1501/wpf-richtextbox-image-link-issue

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
