Ryuk
Ryuk

Reputation: 95

Disable Windows Control Focus

Im making a custom UI using WPF.

Currently I am not using Blend, but if I have to I will learn how to use it.

Im trying to remove the effect that happens when you hover over a control, this is what it looks like without hover:

no hover

and with hover:

hover

Does anyone know how I can remove this?

Upvotes: 1

Views: 125

Answers (1)

Xelom
Xelom

Reputation: 1625

Controls have VisualStates in WPF and Silverlight. If you are using default textbox control it has VisualState for MouseOver:

<vsm:VisualState x:Name="MouseOver">
              <Storyboard>
                <ColorAnimation Storyboard.TargetName="MouseOverBorder" Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="#FF99C1E2" Duration="0"/>
              </Storyboard>
            </vsm:VisualState>

My suggestion for you is go to this website:TextBox Default Template

Get the default template for textbox then remove the visualstate for MouseOver. Or you can do it for any template like this.

Hope you got the idea!

Upvotes: 3

Related Questions