I’m trying save the print screen with the code below but it doesn’ t work
private void button3_Click(object sender, EventArgs e)
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
button1.Visible = false;
button2.Visible = false;
Bitmap bitmap = new Bitmap(this.Width, this.Height);
this.DrawToBitmap(bitmap, this.ClientRectangle);
bitmap.Save("myPrintScreen.bmp");
button1.Visible = true;
button2.Visible = true;
}
}
Use a SaveFileDialog
You can set the filename with the
FilenameProperty. For your example:[Edit after question edit]
Change
to: