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
An alternative to this approach is to use an inherited form instance which hides the showDialog. Then you can disable/enable all forms bar the current one. The code for the dummy form is to deal with the issue described here; Cannot fire form activate event - issue with disabled forms
One of the advantages to this approach is that it requires no change to the normal handling of the showDialog method. Just call it like;
if (dlg.ShowDialog(this) == DialogResult.OK) {
// etc...
}
In your inherited form
public abstract class MyBaseForm : XtraForm
{
private DialogResult setFormsToBackground(Form fParent)
{
Form dummyForm = new Form();
dummyForm.ShowInTaskbar = false;
dummyForm.FormBorderStyle = FormBorderStyle.None;
dummyForm.Load += ((object sender, EventArgs e) => { (sender as Form).Size = new Size(0, 0); });
List