views:

228

answers:

2

(my first question!) Can anyone tell me why, in winforms, layered transparent regions lose their transparency and show black in formerly transparent areas?

These forms are shown as a modal dialog that has been launched from a modal dialog. (2 deep) In this application, modal dialogs are shown in a shadow box effect, so the entire screen is covered with a fill of semi-transparent black, then the modal form is shown.

The first modal form has rounded corners. The first modal form displays beautifully. When a second modal dialog is triggered out of the first modal dialog (also with the full transparent black layer and rounded corners) The clientrectangle of the original modal dialog that isn't covered (the square behind rounded corners) turns black.

Can anyone tell me why this is happening, I need to come up with a fix. Thanks!

A: 

Try show the dialogs on separated threads, or just the second one.

It's can be tricky, read this thread too.

boj
Thank-you. I will try this.
BPerreault
A: 

Thank-you folks for your help. As it turns out, the answer was quite simple. I realized it today when running these controls in a different scenario. ( And it's kind of embarrasing but at least this thread will be complete)

When these modal dialogs are displayed, the screen is covered with 50% transparent rectangle of black color and a form is shown modally on top.

The second modal dialog is shown the same way, 50% transparent black over the owning form. So, I only today realized what happens when 50% transparent is layered over 50% transparent. !!!!!

Anyway, operator error. I just have to figure a way to cover only the region of the rounded corner panel with the transparent black and the problem goes away.

BPerreault