Hello,
Thank you for writing.
You can achieve the desired result by taking a screenshot of your screen and using it as a background to a form which is shown in a modal window. The
SolidBrush class can help you to create the gray overlay. Please check my code snippet below showing how you can handle this scenario on your primary screen:
public
partial
class
Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void
radButton1_Click(
object
sender, EventArgs e)
{
Screen screen = Screen.PrimaryScreen;
int
ix, iy, iw, ih;
ix = Convert.ToInt32(screen.WorkingArea.X);
iy = Convert.ToInt32(screen.WorkingArea.Y);
iw = Convert.ToInt32(screen.WorkingArea.Width);
ih = Convert.ToInt32(screen.WorkingArea.Height);
Bitmap image =
new
Bitmap(iw, ih, PixelFormat.Format32bppArgb);
Graphics g = Graphics.FromImage(image);
g.CopyFromScreen(ix, iy, ix, iy,
new
System.Drawing.Size(iw, ih),
CopyPixelOperation.SourceCopy);
Brush b =
new
SolidBrush(Color.FromArgb(180, 211, 211, 211));
g.FillRectangle(b,
new
Rectangle(
new
Point(0, 0), image.Size));
b.Dispose();
g.Dispose();
RadForm1 f =
new
RadForm1();
f.ShowInTaskbar =
false
;
f.StartPosition = FormStartPosition.Manual;
f.BackgroundImage = image;
f.FormBorderStyle = FormBorderStyle.None;
f.Size = image.Size;
f.Location =
new
Point(0, 0);
f.ShowDialog();
}
}
I hope this helps. Should you have further questions please do not hesitate to write back.
Regards,
Hristo
Telerik by Progress