C# Best Method to Dim Screen, Multiple Windows Forms?

后端 未结 1 379
粉色の甜心
粉色の甜心 2021-01-20 00:59

So I\'ve written code to create a new Windows form from the parent that is fullscreen, black and opacity of 80% to create a dimming effect.

Then another form is show

相关标签:
1条回答
  • 2021-01-20 01:26

    Another approach using only a single window would be to use an alpha blended image to draw the transparent dark background (you could even have a gradient) with a non-transparent custom drawn progress bar. See http://www.codeproject.com/KB/GDI-plus/perpxalpha_sharp.aspx .

    In that project you can find a class that you can use to easily assign an alpha blended Bitmap to a form's background. The problem with this method is that you must custom draw everything on the form, including the progress bar or whatever other controls you need on it.

    The effect that you are trying to achieve is kind of unusual for a windows application, that is why the best method is not very straightforward.

    0 讨论(0)
提交回复
热议问题