private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int x = 40;
int y = 20;
int w = 125;
int h = 125;
for(int i = 1; i <= Convert.ToInt32(textBox8.Text);i++)
{
e.Graphics.DrawImage(pb1.Image, x, y, w, h);
x = x + w + 40;
}
private void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
int x = 40;
int y = 20;
int w = 125;
int h = 125;
int c = 1;
for(int i = 1; i <= Convert.ToInt32(textBox8.Text);i++)
{
e.Graphics.DrawImage(pb1.Image, x, y, w, h);
x = x + w + 40;
c++;
if(c>=5)
{
c =1;
y+=50 //ความสูงที่ต้องการ
}
}