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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T01:53:21+00:00 2026-05-17T01:53:21+00:00

I want to make a WPF TextBox have a DarkBlue border and thickness equal

  • 0

I want to make a WPF TextBox have a DarkBlue border and thickness equal to 1. I want to make the WPF have this border ( DarkBlue, thickness set to 1 ) even when the TextBox is selected.

I tried doing this task by the following code. However, it doesn’t work at all. Any ideas or hints ? Any help would be greatly appreciated.

  <Style x:Key="ReadOnlyLargeTextBox" TargetType="{x:Type TextBox}" >
        <Setter Property="Height" Value="80"/>
        <Setter Property="MaxHeight" Value="80"/>

        <Setter Property="VerticalScrollBarVisibility" Value="Visible"/>
        <Style.Triggers>
            <Trigger Property="TextBox.IsMouseOver"    Value="True">
                <Setter Property="BorderBrush" Value="DarkBlue"/>
                <Setter Property="BorderThickness" Value="1"/>
            </Trigger>
            <Trigger Property="TextBox.IsMouseOver"    Value="False">
                <Setter Property="BorderBrush" Value="DarkBlue"/>
                <Setter Property="BorderThickness" Value="1"/>
            </Trigger>
        </Style.Triggers>


    </Style>

P.S Note that the text box does not have an IsSelected property.

  • 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-05-17T01:53:22+00:00Added an answer on May 17, 2026 at 1:53 am

    just see is this you want…

    <Style x:Key="TextBoxStyle1" BasedOn="{x:Null}" TargetType="{x:Type TextBox}">
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="AllowDrop" Value="true"/>
            <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="{x:Type TextBox}">
                    <Border x:Name="bg" BorderBrush="#FF825E5E" BorderThickness="1">
                            <ScrollViewer x:Name="PART_ContentHost" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
                            </Border>
                        <ControlTemplate.Triggers>
    
                            <Trigger Property="IsMouseOver" Value="True">
                                <Setter Property="BorderBrush" TargetName="bg" Value="DarkBlue"/>
                                <Setter Property="BorderThickness" TargetName="bg" Value="2"/>
                            </Trigger>
                            <Trigger Property="IsFocused" Value="True">
                                <Setter Property="BorderBrush" TargetName="bg" Value="DarkBlue"/>
                                <Setter Property="BorderThickness" TargetName="bg" Value="2"/>
                            </Trigger>
    
                        </ControlTemplate.Triggers>
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to make LabeledPieCharts in WPF (Source: Bea's Blog ) I have downloaded
I've to make a textbox(WPF) for entering time with validation. I want to enter
I want to make the Foreground property of a WPF Textbox red as long
I’m working with WPF and I’m trying to make a drag’n’drop textbox. In this
i want to make a textbox in my wpf application which will accept only
In WPF , I want to make a TextBox that validates user input to
I want to make impossible checking checkbox in WPF (from C# code). Only unchecking
I want to make a user Control in WPf with same properties and events
Hi iam trying to make an Wpf TextBlock to blink. I want like when
If we want in our WPF application to let a user make a SQL

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.