Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Remove default mouseover/focus effect on textboxes

Tags:

I have created a kind of custom TextBox in Expression Blend. I have changed the fill of the background and border to a gradient, and added in a Shadow Effect.

I've noticed that when I mouseover or focus my TextBox, some default behavior/(style?) of WPF takes over and my border is changed.

I was wondering if there was anyway to prevent or stop WPF from changing my TextBoxes style when I focus or mouseover it. Is this possible?

like image 681
mattsven Avatar asked Jun 19 '11 17:06

mattsven


1 Answers

The easier solution is just set texbox border thickness to 0, then wrap texbox to your own border:

<Border BorderBrush="LightGray" BorderThickness="1">
   <TextBox Text="{Binding OutlinePlain, Mode=TwoWay, NotifyOnTargetUpdated=True}"
                         BorderThickness="0"                                
   </TextBox>
</Border>
like image 56
igorGIS Avatar answered Oct 01 '22 03:10

igorGIS