PDA

View Full Version : مشکل با خصوصیت LandScape کنترل PrintDocument



MohammadSoft
یک شنبه 28 مهر 1387, 09:26 صبح
سلام
من در برنامه ام برای Print کردن از قطعه کد زیر استفاده می کنم :




void printDocument_PrintPage(object sender, PrintPageEventArgs e)
{
if (PrintedBay < Bays.Count )
{
BayViewer TempBay = (BayViewer)Bays[BaysKeysArray[PrintedBay]];
e.PageSettings.Landscape = false;
TempBay.Print(e);
PrintedBay++;
if (PrintedBay < Bays.Count)
e.HasMorePages = true;
else
e.HasMorePages = false;

e.PageSettings.Landscape = true;
}
}




مشکل اینجاست که صفحه اول پرینت LandScape نمی شود ولی باقی صفحات هیچ مشکلی ندارند .

MohammadSoft
یک شنبه 28 مهر 1387, 16:36 عصر
برای حل این مشکل از این کد استفاده کنید :


printDocument.DefaultPageSettings.Landscape = true;