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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T11:45:15+00:00 2026-05-11T11:45:15+00:00

I have a UserControl which basically wraps a ListBox like this – <ListBox x:Name=lb

  • 0

I have a UserControl which basically wraps a ListBox like this –

        <ListBox x:Name='lb' ItemsSource='{Binding ElementName=UC,Path=Pages}'              Background='{Binding ElementName=UC,Path=Background}'              BorderBrush='Transparent'              ScrollViewer.CanContentScroll='False'               ScrollViewer.HorizontalScrollBarVisibility='Hidden'               ScrollViewer.VerticalScrollBarVisibility='Disabled'>          <ListBox.ItemsPanel>             <ItemsPanelTemplate>                 <StackPanel Orientation='Horizontal' IsItemsHost='True'/>             </ItemsPanelTemplate>         </ListBox.ItemsPanel>          <ListBox.ItemTemplate>             <DataTemplate>                 <Grid Width='{Binding ElementName=UC,Path=ActualWidth}'>                     <Grid.ColumnDefinitions>                         <ColumnDefinition MinWidth='20'/>                         <ColumnDefinition/>                         <ColumnDefinition MinWidth='20'/>                     </Grid.ColumnDefinitions>                     <ContentPresenter Grid.Column='1' Content='{Binding}'/>                 </Grid>             </DataTemplate>         </ListBox.ItemTemplate>     </ListBox> 

I need to set the FocusVisualStyle to {x:Null} to hide this functionality but no matter where i apply it, i still get the default blue selection color. I’ve tried setting it on the ListBox, StackPanel and the Grid but to no avail.

Any help would be great. thanks.

  • 1 1 Answer
  • 1 View
  • 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. 2026-05-11T11:45:16+00:00Added an answer on May 11, 2026 at 11:45 am

    FocusVisualStyle applies the ‘marching ants’ around the focused element, not the background color. To change the background color of selected ListBoxItems, do something like:

    <ListBox>     <ListBox.Resources>         <SolidColorBrush x:Key='{x:Static SystemColors.HighlightBrushKey}' Value='Red'/>         <SolidColorBrush x:Key='{x:Static SystemColors.HighlightTextBrushKey}' Value='Black'/>     </ListBox.Resources>     </ListBox> 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an UserControl which has listbox. I put this UserControl on the Mainpage.xaml.
I have a custom usercontrol, which is basically a dropdownlist, prepopulated with values from
I have a usercontrol which overrides the property Text. But this property is not
I have a UserControl which contains a listbox and few buttons. <UserControl x:Class=ItemControls.ListBoxControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation
I have a UserControl, which is basically a wrapper for a GridView that needs
I have an asp.net usercontrol which represents a popup dialog. Basically, it's a wrapper
Basically, I have an asp.net ajax enabled usercontrol, and now I'd like to just
I have a UserControl which acts like a basic button control (it is hand
I have a UserControl which is basically a DataGrid. The datagrid has one TemplateColumn
I have created a usercontrol which is basically a button with some nice little

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.