Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7417667
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T07:44:32+00:00 2026-05-29T07:44:32+00:00

This is my first day to design UI using WPF. I have looked up

  • 0

This is my first day to design UI using WPF. I have looked up MSDN official document of Flow Document and found that I can place an UI control inside a RichTextBox. I did put a button in but found it’s not interactable – I cannot click on it as it’s grey. And I also tried other controls and they all displayed fine but just don’t support interaction. Even a hyperlink doesn’t work.

I have searched over internet, the closest question ever asked is about how to make an inside hyperlink click-able: The similar question: C# WPF Text with links

I did the same thing but it didn’t work! All component displayed well but just are not able to be clicked.

Here is my XAML code:

        <RichTextBox Grid.Row="1" Margin="14.007,31.067,22.011,46.305" Name="rtxtRslt" BorderBrush="White" >
        <FlowDocument>
            <Section FontSize="15">
                <Paragraph>
                    <Bold>Click on this:</Bold>
                    <Italic><Hyperlink  NavigateUri="http://stackoverflow.com">http://www.jxitc.info</Hyperlink></Italic>

                </Paragraph>

                <BlockUIContainer>
                    <Button Click="Button_Click">Also Click On This</Button>
                </BlockUIContainer>
            </Section>
        </FlowDocument>
    </RichTextBox>

Can anyone give me some suggestion:
1. is it possible to make it click-able
2. if yes, if I forgot to set any/what attribution of the RichTextBox control?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T07:44:33+00:00Added an answer on May 29, 2026 at 7:44 am

    First off your direct question: how to make the content of the RichTextBox “active”. Set the IsDocumentEnabled property to True on the RichTextBox like shown here:

       <RichTextBox Grid.Row="1" Margin="14.007,31.067,22.011,46.305" Name="rtxtRslt" BorderBrush="White" 
                        IsDocumentEnabled="True">
            <FlowDocument>
                <Section FontSize="15">
                    <Paragraph>
                        <Bold>Click on this:</Bold>
                        <Italic>
                            <Hyperlink  NavigateUri="http://stackoverflow.com">http://www.jxitc.info</Hyperlink>
                        </Italic>
    
                    </Paragraph>
    
                    <BlockUIContainer>
                        <Button Click="Button_Click" >Also Click On This</Button>
                    </BlockUIContainer>
                </Section>
            </FlowDocument>
        </RichTextBox>
    

    Now to the unspoken question: do you have to be in a RichTextBox at all? The fact that there is a special property on the RichTextBox to make embedded UI elements active kinda indicates that is not the normal usage for this control. It is meant to host editable FlowDocument content. So the user of the RichTextBox would typically be creating the document that hosts the button that a consumer of the document could click, if that helps make the distinction clear I don’t know.
    However, all that being said, your FlowDocument hosted instead in a simple FlowDocumentPageViewer is active by default.

     <FlowDocumentPageViewer>
            <FlowDocument>
                <Section FontSize="15">
                    <Paragraph>
                        <Bold>Click on this:</Bold>
                        <Italic>
                            <Hyperlink NavigateUri="http://stackoverflow.com">http://www.jxitc.info</Hyperlink>
                        </Italic>
    
                    </Paragraph>
    
                    <BlockUIContainer>
                        <Button Click="Button_Click" >Also Click On This</Button>
                    </BlockUIContainer>
                </Section>
            </FlowDocument>
    
        </FlowDocumentPageViewer>
    

    Now to the other unspoken question (unspeakable?) do you have to be in FlowDocument content at all? FlowDocument content is similar to, but not derived from UIElement. As such, many of the out-of-the-box features of UIElements are not available. If you need document functionality in the UI FlowDocuments can provide a great start but bring with them a pretty big learning curve in their own right.

    The title of your question, if taken literally, makes me think you might just want a WPF UI that allows you to embed Buttons and Hyperlinks and have them work (gasp). That is certainly the default behavior. If you do not need the document look and feel that FlowDocument provides nor the real time document editing that RichTextBox provides you might consider a more “traditional” WPF layout.

     <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch"
                    Margin="20">
            <TextBlock>
                        <Bold>Click on this:</Bold>
                        <Italic>
                            <Hyperlink NavigateUri="http://stackoverflow.com">http://www.jxitc.info</Hyperlink>
                        </Italic>
            </TextBlock>
            <Button Click="Button_Click" 
                    Margin="0,20,0,0">Also Click On This</Button>
        </StackPanel>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Get first day of week in PHP? i have this script that
I'm using this line to get the beginning time of the first day of
Using Dozer to map two objects, I have: /** /* This first class uses
My first day using this IDE... is there a way to configure the IDE
This is my first day coding and using jquery, I figured the best way
This is my first day using c#. I think it is very easy :(.
I am currently getting first day Of this week and last week values with
problem euler #5 i found the solution but i don't know why this first
#include <iostream> using namespace std; // This first class contains a vector and a
This is my first question and first day in Linq so bit difficult day

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.