Q:

Wait for button press (no text boxes, etc.)

I have a code to take a screenshot, but I want it to be executed when I press the space button, how do I make it wait for me to press it?
Rectangle bounds = Screen.GetBounds(Point.Empty);
using (Bitmap bitmap = new Bitmap(bounds.Width, bounds.Height))
{
    using (Graphics g = Graphics.FromImage(bitmap))
    {
        g.CopyFromScreen(Point.Empty, Point.Empty, bounds.Size);
    }
    bitmap.Save("test.jpg", ImageFormat.Jpeg);
}

A:

That's actually the wrong paradigm. In Windows environments, you don't wait for events; you respond to them as they occur.
Assuming for a moment that this is a WinForms application, that means you write code for the KeyDown event of the form itself.

