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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:49:23+00:00 2026-05-24T07:49:23+00:00

I have a template for my list box item. It includes an image button.

  • 0

I have a template for my list box item. It includes an image button. The button changes images when you hover. The problem I’m having is it’s adding a weird artifact to the button when I hover. This ONLY happens though if it’s in a ListBoxItem. If I put the button on the main canvas, it works fine.

Here is the image in the normal state:

alt text

Here is the image in the hover state: Notice the 2 white lines on the top and right edges.

alt text

What’s even more strange, is when you move the mouse off, and it reverts the image, the artifact stays:

alt text

Here is the code for my button. I’ve tried playing with every background brush (both the button, the listbox item, etc.)

    <Style x:Key="RedXButton" TargetType="{x:Type Button}">
        <Setter Property="FocusVisualStyle" Value="{StaticResource ButtonFocusVisual}"/>
        <Setter Property="Background" Value="Black"/>
        <Setter Property="BorderBrush" Value="Transparent"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="Transparent"/>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type Button}">
                    <Image Width="19" Height="18">
                            <Image.Style>
                                <Style TargetType="{x:Type Image}">
                                    <Setter Property="Source" Value="Views/Images/RedX.png"/>
                                        <Style.Triggers>
                                            <Trigger Property="IsMouseOver" Value="True">
                                                <Setter Property="Source" Value="Views/Images/RedXHover.png"/>
                                            </Trigger>
                                        </Style.Triggers>
                                </Style>
                            </Image.Style>
                        </Image>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsKeyboardFocused" Value="true"/>
                        <Trigger Property="ToggleButton.IsChecked" Value="true"/>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Setter Property="Width" Value="19"/>
        <Setter Property="Height" Value="18"/>
        <Setter Property="OpacityMask" Value="{x:Null}"/>
    </Style>

My listbox item template:

<Canvas x:Name="LayoutRoot">
        <Image x:Name="image" Source="/Views/Images/FileGradient.png" Width="375" Height="43"/>
        <Button x:Name="RedX" Style="{DynamicResource RedXButton}" Command="{Binding RemoveCommand}" Canvas.Left="11" Canvas.Top="13" Width="19" Height="18" />
    </Canvas>
  • 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-24T07:49:23+00:00Added an answer on May 24, 2026 at 7:49 am

    It ended up being multiple styles for different elements conflicting. I’m not sure what the actual fix was. I just simplified all the styles and re-created some of the controls, and it went away. Unfortunately I can’t add any more beyond that, since I’m not sure what ultimately fixed it.

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

Sidebar

Related Questions

I have a Listbox with a Item Template as Text box and button (Add)
I'm having a strange problem with a colour animation. I have a list of
I have the following data template for a list box items: <DataTemplate x:Key=substanceListShower> <ListBox
So I have this Xaml inside a ListBox Item Template: <ListBox.ItemTemplate> <DataTemplate> <Grid Height=22
I have a screen with a ListBox of items. The item template contains an
I have defined a custom list template type for SharePoint . I install it
I have a base.html template that contains a list of links. Example: <div id=sidebar1>
I have a Python list that I'm supplying to the template: {'error_name':'Please enter a
I have created an editor template for representing selecting from a dynamic dropdown list
I have code that looks like this: template<class T> class list { public: class

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.