views:

54

answers:

1

Aside from rewriting the entire RichTextBox control, is there a way to apply the built-in shader effects (e.g. DropShadowEffect) to a specific piece of text or even a Paragraph or Run?

A: 

You can use the InlineUIContainer which can hold UIElements and apply Effects to those UIElements. It's not pretty, but it works.

<RichTextBox>
<Paragraph>
    Displaying text with inline image
    <InlineUIContainer>
        <TextBlock Text="Hello World"><TextBlock.Effect><DropShadowEffect/></TextBlock.Effect></TextBlock>
    </InlineUIContainer>            
</Paragraph>

discorax