0

I'm maintaining a Windows forms application that sits on top of (in front of?) another company's application. Our application has two click-thru panels over two specific areas of the other application that the user needs to have access to. Our application is built in C# using VS2017 on .NET4. Between Windows 7 and Windows 10, something has changed, and I'm hoping someone has run into it before and has a solution. (I should note that I have the same issue when building with .Net 4.7.2.)

form fragment being described

Our application's form has two track bars that fully occupy the space between the two transparent panels, see the image above. On Windows 7, this wasn't any problem. On Windows 10, the handle for the track bar that sits immediately below the upper panel is essentially disabled. The mouse can't grab the handle. Normally, when the mouse grabs the track bar handle, it turns from blue to black. On Windows 10, that doesn't happen and the handle can't be dragged. The trackbars are controlling some overlay information in the lower click-thru panel.

After much experimentation, I discovered the following:

If the TransparencyKey for our form is set to a color that allows for click-thru, the mouse can't grab the trackbar. If the TransparencyKey is set to a color that doesn't allow click-thru, then the mouse can grab the handle. It appears that there is around a 28-pixel zone below the click-thru panel that disables clicking anything on our form. In fact, I created a test app that uses the Click method on the main form to detect mouse clicks. It does not get invoked for any mouse clicks in this "dead" zone below the click-thru panel.

My current workaround is to reduce the size of the two trackbars so that they fit between the "dead" zone and the lower panel. Anyone have a solution or a better workaround?

Thanks.

knupug
  • 1
  • 3
  • When the Window under the transparent area belongs to another Process, then yes, the clipping region *bleeds in* a few pixels, depending on the screen resolution. It's not related to any specific Control (e.g., your Panels or the TrackBar), it would be the same if you were to paint the same rectangular area using the TransparencyKey as the Color of the Brush. Moving other Controls some pixels aways from that area, is probably a simple fix – Jimi Jul 19 '23 at 06:20
  • @Jimi I'm not sure I understand your response. The issue isn't with clicking on a control on the other Process' form through the transparent area. I can do that just fine. The issue is that I can't click on a control on my own form that's within 28 pixels of the bottom of the transparent area. – knupug Jul 22 '23 at 02:09
  • That's what I said. When **the Window that is under the transparent area of your Form** belongs to another Process (i.e., it doesn't happen if the Window **belongs to your Process**), then the clipping region generated by Desktop Window Manager *bleeds in*. So an area slightly larger than the transparent region of your Form is not clickable, because the transparent clipping region expands inside the client area of the Form and *covers it* – Jimi Jul 22 '23 at 02:41
  • @Jimi thanks. I understand now. I don't like it but I understand – knupug Jul 23 '23 at 05:21

0 Answers0