Hi @Anderson Rodrigues Cavalcante .
Welcome to Microsoft Q&A!
or something like this, disregarding the button:
For this effect, you only need to add TextTrimming="CharacterEllipsis"
to the PlaceholderTextContentPresenter
in the Textbox style.
1.Open the xaml designer, find your Textbox, right click it.
2.Select Edit Template -> Edit a Copy.
3.Name it and click OK.
4.Find <TextBlock x:Name="PlaceholderTextContentPresenter"...
, add TextTrimming="CharacterEllipsis"
5.Use this new style in your TextBox.
...
<TextBlock x:Name="PlaceholderTextContentPresenter"
Grid.ColumnSpan="2" Foreground="{Binding PlaceholderForeground, RelativeSource={RelativeSource Mode=TemplatedParent}, TargetNullValue={ThemeResource TextControlPlaceholderForeground}}"
IsHitTestVisible="False" Margin="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}"
Grid.Row="1" TextAlignment="{TemplateBinding TextAlignment}" TextWrapping="{TemplateBinding TextWrapping}"
Text="{TemplateBinding PlaceholderText}"
TextTrimming="CharacterEllipsis"/>
...
<TextBox Style="{StaticResource TextBoxPlaceholderStyle}" PlaceholderText="A text box that demonstrates TextWrapping, TextAlignment, MaxLength, and AcceptsReturn"
Width="300"/>
Could you please provide the code of how you add a button to the textbox? Maybe I can help you achieve the expected effect.
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.