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

  • SEARCH
  • Home
  • 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 8628227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T08:29:01+00:00 2026-06-12T08:29:01+00:00

Possible Duplicate: Any way to make a WPF textblock selectable? Can I make a

  • 0

Possible Duplicate:
Any way to make a WPF textblock selectable?

Can I make a textblock selectable in WPF application so that a user can copy it.

  • 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-06-12T08:29:03+00:00Added an answer on June 12, 2026 at 8:29 am

    You could just make it into a TextBox that’s Read Only which just looks like a TextBlock, kind of like;

    <Style x:Key="ReadOnlyTextBox" TargetType="TextBox">
       <Setter Property="IsReadOnly" Value="True" />
       <Setter Property="Padding" Value="5"/>
       <Setter Property="Margin" Value="0"/>
       <Setter Property="Background" Value="Transparent"/>
       <Setter Property="BorderBrush" Value="Transparent"/>
       <Setter Property="BorderThickness" Value="0"/>
       <Setter Property="IsTabStop" Value="False"/>
       <Setter Property="HorizontalScrollBarVisibility" Value="Disabled"/>
       <Setter Property="VerticalScrollBarVisibility" Value="Disabled"/>
       <Setter Property="Template">
          <Setter.Value>
             <ControlTemplate TargetType="TextBox">
                <Grid x:Name="RootElement">
                   <ScrollViewer x:Name="ContentElement"
                                 Margin="{TemplateBinding Margin}"
                                 Background="{TemplateBinding Background}"
                                 BorderBrush="{TemplateBinding BorderBrush}"
                                 BorderThickness="{TemplateBinding BorderThickness}"
                                 IsTabStop="{TemplateBinding IsTabStop}"
                                 Padding="{TemplateBinding Padding}" 
                                 HorizontalScrollBarVisibility="{TemplateBinding HorizontalScrollBarVisibility}"
                                 VerticalScrollBarVisibility="{TemplateBinding VerticalScrollBarVisibility}"/>
                </Grid>
             </ControlTemplate>
          </Setter.Value>
       </Setter>
    </Style>
    

    The ScrollViewer ContentElement would be in a TextBox by default, you could substitute for a ContentPresenter instead if you like also.

    Then put it into effect;

    <TextBox Text="Blah Blah Blah you can copy me!" Style="{StaticResource ReadOnlyTextBox}"/>
    

    Hope this helps!

    ADDENDUM: As @doodleus pointed out in the comments. Template binding the Content Property within the template may be necessary. As “ContentElement” is a named part of the Silverlight TextBox control. One of the little nuance differences to watch for in the different xaml Variants. I must not have paid attention to the Tags when I originally created the example. So kudos to him for correcting me.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: Porting VB.NET Winforms Application to C# Is there any way to convert
Possible Duplicate: PHP 2-way encryption: I need to store passwords that can be retrieved
Possible Duplicate: Any way to “reboot” the JVM? Is there any option to restart
Possible Duplicate: Any way to add HttpHandler programatically in .NET? Is there a way
Possible Duplicate: Is there any way to determine text direction from CultureInfo in asp.net?
Possible Duplicate: Objective C for Windows iPhone development on Windows Is there any way
Possible Duplicate: Overriding the power button in Android Is there any possible way I
Possible Duplicate: Prevent any form of page refresh using jQuery/Javascript how can i prevent
Possible Duplicate: How to reverse an audio file? Is there any way/library in objective-c
Possible Duplicate: How to make org syntax links in any emacs buffer look like

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.