You can't "run" a Form without a message loop/pump. To get one, you need to call
Application.Run()
Without a pump the Form will be dead, no events will occur, the PB will not show anything.
But then, with a pump, your Console App basically got turned into a WinForms app.
The work-around is to not rely on events, and orchestrate everything explicitly; this is the most compact piece of code that does so IMO:
using System;
using System.Drawing;
using System.IO;
using System.Threading;
using System.Windows.Forms;
namespace ConsoleApplication1 {
class Program {
static void Main(string[] args) {
Screen screen = Screen.PrimaryScreen;
using (Form form = new Form()) {
form.FormBorderStyle = FormBorderStyle.None;
form.Bounds = screen.Bounds;
PictureBox pb=new PictureBox();
pb.Dock=DockStyle.Fill;
pb.SizeMode=PictureBoxSizeMode.StretchImage;
form.Controls.Add(pb);
form.Show();
string[] imageFiles = Directory.GetFiles("images", "*.jpg");
while (true) {
foreach (string imageFile in imageFiles) {
pb.Load(imageFile);
form.Refresh();
Thread.Sleep(2000);
}
}
}
}
}
}
Note doublebuffering was not used, I see no point to use it.