Quote:I use this code to make to print screen my screen, its working but my problem is when I minimize the application I can not use the shortcut key , any help?
private void button1_Click(object sender, EventArgs e) { Bitmap bitmap = new Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height); Graphics graphics = Graphics.FromImage(bitmap as Image); graphics.CopyFromScreen(0, 0, 0, 0, bitmap.Size); var date = DateTime.Now.ToString("MMddyyHmmss"); bitmap.Save(@"C:\Users\Public\Pictures" + date + ".jpg"); } private void Form1_KeyDown(object sender, KeyEventArgs e) { if (e.KeyCode == Keys.F12) { button1.PerformClick(); } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)