PDA

View Full Version : پرینت گرفتن از اطلاعلت یک richtextbox



mmd2009
پنج شنبه 17 دی 1388, 02:43 صبح
سلام بچه ها
چطور میشه اطلاعات درون یک richtextbox رو چاپ کنم؟

مرسی

sari-1369
پنج شنبه 17 دی 1388, 11:11 صبح
اول 2 تا شی PrintDialog و PrintDocument به فرمت اضافه کن .

حالا تو دکمه Print این کد رو بنویس :


PrintDialog1.Document = PrintDocument1
If PrintDialog1.ShowDialog() = Windows.Forms.DialogResult.OK Then
PrintDocument1.PrinterSettings = PrintDialog1.PrinterSettings
PrintDocument1.Print()
End If

تو رویداد PrintDocument1_PrintPage هم اینو بنویس :


Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintDocument1.PrintPage
e.Graphics.DrawString(RichTextBox1.Text, New Font("tahoma", 11), Brushes.Blue, 40, 40)
End Sub

Navid Asadi
پنج شنبه 17 دی 1388, 12:05 عصر
راهنمایی دوست عزیزمون درسته ولی اگه از کریستال ریپورتر استفاده کنی راهت تره...
در مورد کریستال ریپرتر با سرچ همه چی دستت میاد...