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 7848655
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:17:02+00:00 2026-06-02T18:17:02+00:00

I would like to apply a TextTrimming option on a TextBox (Not a TextBlock

  • 0

I would like to apply a TextTrimming option on a TextBox (Not a TextBlock).

The compiler tells me that the TextTrimming options is not a valid property of the Textbox.

I could do a fancy control that is a Textblock and once it’s clicked will become a Textbox and conversely go back to being a Textblock once the focus is lost.

Before going this way I would like to know if a built-in function already exists (or is there a smarter way) to allow you to do that?

EDIT: What I want to have in the end is a TextBox which is trim (the full content will be display in a tooltip) but when the user select the TextBox (enter in “edit mode”) the full content will be display (without trim) therefore the user will be able to modify the full text. when the TextBox lost the focus (go back to “view mode”) the content will be trim again.

Thanks

  • 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-02T18:17:05+00:00Added an answer on June 2, 2026 at 6:17 pm

    Try a style like this (I’ve added background colours to make the change obvious):

        <Style TargetType="TextBox">
          <Setter Property="Background" Value="Yellow" />
          <Style.Triggers>
            <DataTrigger Binding="{Binding IsKeyboardFocused, RelativeSource={RelativeSource Self}}" Value="false">
              <Setter Property="Template">
                <Setter.Value>
                  <ControlTemplate TargetType="TextBox">
                    <TextBlock Text="{TemplateBinding Text}"  TextTrimming="CharacterEllipsis" Background="Red" />
                  </ControlTemplate>
                </Setter.Value>
              </Setter>
            </DataTrigger>
          </Style.Triggers>
        </Style>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I would like to apply a css file after choosing an option from a
I would like to apply CSS styles to links that appear in column headers
I have a dataframe and I would like to apply a function that takes
I have a HtmlHelper extension method that I would like to apply some logic
I would like to apply a SlideTransition effect to a TextBlock similar to the
I have a filter that would like to apply to all controllers except for
I have a custom style that I would like to apply to my views.
I have an array of elements that I would like to apply a mapping
I have rotation values (roll, pitch, yaw). I would like to apply that rotation
I have a loading image that I would like to apply as a splash

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.