Here's a crude method that will get you started:
public Panel CreateFloatingPanel(Panel originalPanel)
{
Bitmap bmp = new Bitmap(originalPanel.Width,
originalPanel.Height);
Rectangle rect = new Rectangle(0, 0,
bmp.Width, bmp.Height);
originalPanel.DrawToBitmap(bmp, rect);
foreach (Control ctrl in originalPanel.Controls)
{
ctrl.Visible = false;
}
using (Graphics g = Graphics.FromHwnd(originalPanel.Handle))
{
g.DrawImage(bmp, 0, 0);
bmp.Dispose();
SolidBrush brush =
new SolidBrush(Color.FromArgb(128, Color.Gray));
g.FillRectangle(brush, rect);
brush.Dispose();
}
Panel floater = new Panel();
floater.Size = originalPanel.Size;
floater.Left = originalPanel.Left - 50;
floater.Top = originalPanel.Top - 50;
this.Controls.Add(floater);
floater.BringToFront();
return floater;
}
This method takes a panel with some controls on it, draws the panel with all its controls onto a temporary bitmap, makes all the controls invisible, draws the temporary bitmap onto the panel, then adds a semi-transparent Gray layer onto the panel. The method then creates a new panel and floats it over the original panel, above and to the left, and then returns it. This basically makes the new panel a sort of modal popup window, kind of like how web pages do it sometimes.
To use this on your form, put all the controls you want to be grayed-out underneath onto a panel, then have your button's Click event do something like this:
Panel floater = CreateFloatingPanel(panel1);
floater.BackColor = Color.White;
ListView lv = new ListView();
floater.Controls.Add(lv);
To undo the effect, you would just remove the floating panel from the form's Controls collection, then make visible again all the controls on the original panel, and then Refresh or Invalidate the panel to get rid of the grayed-out stuff. The simple Invalidate will work because the grayed-out effect does not persist - to get that you'd have to make this all a bit more complicated. But this should get you started, at least.