我正在尝试使用下面的代码保存打印屏幕,但它不起作用
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;
}
}