Everything OriginalGriff said is true. Your loop is fine but since you are creating graphics everytime you paint a pixel you are draining resources (and slowing down your loop considerably). You also call refresh entire form after drawing every single pixel. You make your code performing very, very slow.
Just modify your code slighlty. Create graphisc only once and do not refresh 16 million times. You should see your colored squares fine.
using (Graphics gr = this.CreateGraphics())
{
for (byte z = 128; z < 255; z++)
{
for (byte x = 0; x < 255; x++)
{
for (byte y = 0; y < 255; y++)
{
Color c = Color.FromArgb(z, x, y);
gr.FillRectangle(new SolidBrush(c), x, y, 1, 1);
}
}
this.Refresh();
}
}