First - Hello.
Second - I am developing a WPF application in C# so I wasn't sure where to post. I've decided to post the question in this forum, sorry if I'm wrong.
The application has a custom GUI (not just a clone of the Windows Shell GUI or Ribbon GUI), so many of the buttons have non-standart shapes. To create the shapes I need, I added PNG images with a transparent backgrounds. They work just fine, but
the problem is that most of the images intersect, so clicking a "button" (i.e. image) near it's border will result it actually clicking the adjacent button.
I figured out 2 ways to solve the problem:
1. Using the MouseDown event to bring the current button (image) on top of the Grid. This will disable the adjacent images to overlay the current one. After the MouseUp event is triggered, the object returns to it's original position in the order
hierarchy, below the adjacent images, thus achieving the goal. Unfortunetely if hovering the mouse next to the button area, the marginal buttons would be highlighted. It's a minor bug observed even in Windows 7, but I DON'T WANT IT. So:
2. Using the MouseDown event to get the position of the cursor and checking whether the part of the image underneath is opaque or not. If it is not, bypassing the further events. The
View Complete Post