Hi, @Pratham Jain. Welcome to Microsoft Q&A.
This change comes from the default Validation.ErrorTemplate
. You could set it to empty so that it does not make any changes when an error is reported.
Reference code
<Window.Resources>
<ControlTemplate x:Key="EmptyErrorTemplate" />
</Window.Resources>
<TextBox Grid.Row="1" Grid.Column="1" Name="txtFirstName" Margin="10,10,5,5" TextChanged="txtFirstName_TextChanged" Validation.ErrorTemplate="{StaticResource EmptyErrorTemplate}">
…
</TextBox>
You could also provide your own Template
to Validation.ErrorTemplate
to update the TextBox
when an error occurs. Reference Documentation.
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.