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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T13:50:12+00:00 2026-06-05T13:50:12+00:00

I am working on a WPF application having lots of screens and every screen

  • 0

I am working on a WPF application having lots of screens and every screen has lots of controls on it.
It becames very difficult to determine which control has focus.

So i want to highlight the control that currently have focus on it. It could be textbox, button, combobox, listbox or grid.

It’ll be better if we could do this using styles and triggers.

Thanks

  • 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-05T13:50:14+00:00Added an answer on June 5, 2026 at 1:50 pm

    You should use a trigger for the right event. In your case it’s IsFocused. Simple example:

    <Trigger Property="IsFocused" Value="true">
        <Setter Property="BorderBrush" Value="Red" />
        <Setter Property="BorderThickness" Value="1" />
    </Trigger>
    

    You should use a Style tag, if you want to apply this style for a particular control type (use TargetType="{x:Type TextBox}", for example).

    If you want to apply to all control types in your application, than you should consider using a base style with only such kind of trigger and than just inherit it in your custom styles with a help of BasedOn attribute:
    <Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource BaseFocusStyle}">

    Good example of how to do this is a SO question: “How to make Style.Triggers trigger a different named style to be applied“.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am working on WPF application. I have a window which has Combobox and
I am working on an application having both WinForms and WPF controls; In case
Working with a WPF application. I am very much wonderin if it is possible
I'm working on a WPF application which should be utilizable with two monitors. In
I am working on a WPF application which doesnot seem to release all the
I am working on WPF application, and now I have to choose which database
I am working on WPF application which uses Entity Framework alongwith POCO classes. I
I have a simple WPF application I'm working on, which performs a SQL query
I am working on a wpf application. I am having one image, i have
I'm working on a WPF application and I'm using the MVVM pattern. I use

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.