36.
printDocument1->Print();
37.
}
38.
finally{uqish->Close();} }
39.
catch(Exception^ Istisno){ MessageBox::Show(Istisno-
>Message);} }
40.
private: System::Void
printDocument1_PrintPage(System::Object^
41.
sender, System::Drawing::Printing::PrintPageEventArgs^ e) {
42.
// Sahifani pechatga chiqarish hodisasi
43.
Single sahifadagiQatorlar = 0;
44.
Single Y = 0;
45.
Single chapTomo = (Single) e->MarginBounds.Left;
46.
Single yuqoriTomon = (Single) e->MarginBounds.Top;
47.
String^ Qator = nullptr;
48.
Drawing::Font^ shrift =
49.
gcnew Drawing::Font("Times New Roman", 12.0F);
50.
// Bitta sahifadagi qatorlar soni
51.
sahifadagiQatorlar = e->MarginBounds.Height/shrift-
>GetHeight(
52.
e->Graphics);
53.
// Faylni har bir qatorini pechatga chiqarish
54.
int i=0;// qator soni
55.
while(i
56.
if(Qator == nullptr) break; // sikldan chiqish
Do'stlaringiz bilan baham: |