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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T16:17:53+00:00 2026-05-21T16:17:53+00:00

I have the following control set as the Child of a WinForms element host

  • 0

I have the following control set as the Child of a WinForms element host (WPF Interop). It seems when the the StrokeThickness is set to low values (i.e. 1), the IsMouseOver property is not consistently set and the correct styling does not appear. I confirmed the issue is not with WinForms, since I also tested the functionality in a WPF app. This is causing me issues because I’m using these rectangles as hidden overlays on a custom charting control. When the mouse enters a certain region of the chart, it becomes highlighted. Are there additional property constraints (i.e. StrokeThickness) when using the IsMouseOver property?

    <UserControl.Resources>
    <Style x:Key="myStyle" TargetType="{x:Type Rectangle}">
        <Style.Triggers>
            <Trigger Property="IsMouseOver" Value="true">
                <Setter Property="Fill" Value="Gold"/>
            </Trigger>
        </Style.Triggers>
        <Setter Property="Width" Value="100"/>
        <Setter Property="Height" Value="Auto"/>
        <Setter Property="Stroke" Value="Black"/>
        <Setter Property="StrokeThickness" Value="10"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
    </Style>
</UserControl.Resources>

<Grid VerticalAlignment="Stretch" HorizontalAlignment="Stretch" Height="Auto" Width="Auto">
    <StackPanel Orientation="Horizontal">
        <Rectangle Style="{StaticResource myStyle}"/>
        <Rectangle Style="{StaticResource myStyle}"/>
        <Rectangle Style="{StaticResource myStyle}"/>
        <Rectangle Style="{StaticResource myStyle}"/>
        <Rectangle Style="{StaticResource myStyle}"/>
    </StackPanel>
</Grid>

  • 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-21T16:17:53+00:00Added an answer on May 21, 2026 at 4:17 pm

    That’s because you’ve not set a background (Fill) for the rectangle. As such, the mouse is only considered over the rectangle when it’s over the stroke. Set the Fill to something other than null, even if it’s Transparent.

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

Sidebar

Related Questions

I have built the following custom control that I have built and I set
I have the following Data Trigger set-up on a Control Template <DataTrigger Binding={Binding Path=IsDragged}
I have the following set up Custom Control 1 - MyListControl - Nested Collection
I have a composite control that contains a different set of child controls based
I have the following htaccess file: <filesMatch \.png$> <ifModule mod_headers.c> Header set Cache-Control public
I have the following headers set on the server response.addHeader(Access-Control-Allow-Origin, *); response.addHeader(Access-Control-Allow-Methods, GET, POST,
I have following validator control. How can we set the color of Text of
I have following user control: <UserControl.Resources> <Style TargetType=HeaderedItemsControl> <Setter Property=Template> <Setter.Value> <ControlTemplate TargetType=HeaderedItemsControl> <Grid>
I have defined following control template for my custom control. <ControlTemplate TargetType={x:Type local:CustomControl}> <Grid
I have the following user-control: <%@ Control Language=C# AutoEventWireup=true CodeFile=FadingMessage.ascx.cs Inherits=includes_FadingMessage %> <asp:PlaceHolder Visible=false

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.