This happens when the 16 pins in a VGA cable aren't connecting properly to the 16 pins in a port. It can usually be corrected by taking the vga out (very gently) and reinserting. Try wiggling it a little and sometimes this will fix it. In the rare case that a pin gets bent on the VGA cable, it can be replaced.