---
title: "WPF: Opacity and the MouseEnter Event."  
description: "WPF: Opacity and the MouseEnter Event."  
author: "shreesh chandra shukla"  
published: 2013-07-15  
updated: 2013-07-15  
canonical: https://www.mindstick.com/forum/1286/wpf-opacity-and-the-mouseenter-event  
category: "wpf"  
tags: ["wpf"]  
reading_time: 1 minute  

---

# WPF: Opacity and the MouseEnter Event.

Hi [developers](https://www.mindstick.com/articles/12875/blunders-you-must-avoid-while-hiring-java-developers-to-get-the-best-fulfilling-your-needs)!

c# wpf mouseevent opacity

As part of a diagram, I am drawing a few overlapping Shapes, each with `Opacity=0.5`, like here:

```
<Grid>
    <Rectangle Fill="Blue" Opacity="0.5" MouseEnter="Rectangle_MouseEnter" />
    <Rectangle Fill="Red" Opacity="0.5" />
</Grid>
private void Rectangle_MouseEnter(object sender, MouseEventArgs e)
  {
     MessageBox.Show("Entered");
  }
```

When the [user](https://www.mindstick.com/articles/13001/multi-statement-table-valued-user-defined-function-in-sql-server) enters the shape with the [mouse](https://yourviews.mindstick.com/story/5122/the-story-behind-lord-ganesha-s-mouse-mushak), some [additional information](https://www.mindstick.com/forum/160484/error-failed-to-launch-debug-adapter-additional-information-may-be-available-in-the-output-window) should be displayed, but the [event handler](https://www.mindstick.com/forum/1371/c-sharp-dot-net-event-handler-delegate-question) [never](https://yourviews.mindstick.com/view/290/zoos-prisons-for-beings-who-have-never-committed-a-crime) gets called.

Is there a way to get MouseEnter [events](https://www.mindstick.com/blog/102/events-in-c-sharp) for all Shapes, [instead of](https://www.mindstick.com/articles/330/triggers-in-sql-server) just the topmost one?


---

Original Source: https://www.mindstick.com/forum/1286/wpf-opacity-and-the-mouseenter-event

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
