When opening Dialog form using Form.ShowDialog() I want to dim the rest of application with a shade of gray.
From my own research it seems that the way to do it is to open a borderless form with black background and opacity less than 100% but I haven’t put all the pieces together how it would work or if it’s the best way to do it.
Any suggestions would be helpful.
Thanks.
This is best done by overlaying the open forms with another form that’s borderless and the same size. This allows you do make the entire form look disabled, including the controls and the title bar. Add a new class to your project and paste this code:
And use it like this:
Tweak the Opacity and BackColor properties to adjust the effect. It will work with any kind of dialog, including the built-in ones like OpenFileDialog, and any set of open forms in your application. Beware that Application.OpenForms is a wee bit buggy.