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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T03:49:38+00:00 2026-06-18T03:49:38+00:00

I have use 10 TextBox in my application and in that same application i

  • 0

I have use 10 TextBox in my application and in that same application i have defined the style in App.xaml It applies for all the text boxes in my application . how to disable the style applying for a single TextBox.

Can any one help me out in this.

I used the below code to set the style

<Style TargetType="{x:Type TextBox}">
    <Setter Property="Template">
        <Setter.Value>
            <ControlTemplate TargetType="{x:Type TextBox}">
                <Border Background="White" 
                    x:Name="Bd" BorderBrush="#FF50729f" CornerRadius="3"
                    BorderThickness="1"
                >
                    <ScrollViewer x:Name="PART_ContentHost"/>
                </Border>
                <ControlTemplate.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Background" TargetName="Bd" Value="#FFe0dfe3"/>
                        <Setter Property="BorderBrush" TargetName="Bd" Value="#FF9da3ab"/>
                    </Trigger>
                </ControlTemplate.Triggers>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Setter Property="Validation.ErrorTemplate">
        <Setter.Value>
            <ControlTemplate>
                <Border BorderBrush="#FFd22c2c" BorderThickness="1" 
                                Background="#FFfce8e8" CornerRadius="3" >
                    <AdornedElementPlaceholder></AdornedElementPlaceholder>
                </Border>
            </ControlTemplate>
        </Setter.Value>
    </Setter>
    <Style.Triggers>
        <Trigger Property="IsEnabled" Value="False">
            <Setter Property="Background"  Value="#FFe0dfe3"/>
            <Setter Property="BorderBrush" Value="#FF9da3ab"/>
        </Trigger>
        <Trigger Property="Validation.HasError" Value="true">
            <Setter Property="ToolTip"
            Value="{Binding RelativeSource={RelativeSource Self},
            Path=(Validation.Errors)[0].ErrorContent}"/>
        </Trigger>
    </Style.Triggers>
</Style>
  • 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-18T03:49:39+00:00Added an answer on June 18, 2026 at 3:49 am

    if you just want the default style then

    <TextBox Style="{x:Null}"/>
    

    otherwise Cédric Bignon‘s answer with target type defined (like below) will do the job.
    No property will be inherited by your application TextBoxStyle

        <TextBox>
            <TextBox.Style>
                <Style TargetType="{x:Type TextBox}">
                   <!-- your setters-->
                </Style>
            </TextBox.Style>
        </TextBox>
    

    if you want to slightly change the default application style
    then use the following tecqnique where in your style you can
    redefine properties you want to be different from the default
    or define additional ones

         <TextBox>
            <TextBox.Style>
                <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
                 <!-- your setters-->
                </Style>
            </TextBox.Style>
        </TextBox>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this custom textbox that I am working on and I can use
I have a WPF application that allows users to create questions of all different
I have this textbox I use to capture keyboard shortcuts for a preferences config.
I have a TextBox which i use to store a url to applied a
I'm trying to use a RegularExpressionValidator to validate a TextBox input length. I have
Looking for guidelines to create application file. For example I have an application that
I have an application that prints eTickets. Originally I used the cool 2-D bar
In my application I have a Submit button that does this: private void Submit_button_Click(object
I am developing interactive chart library...and application, which use it. In application, I have
I have changed my app to use MVC and it has gotten pretty slow.

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.