MTK2010
دوشنبه 14 تیر 1389, 17:15 عصر
سلام دوستان من با VisualBasic 2008 کار میکنم
موقه پرینت گرفتن از Textbox باید محتوای نوشتاری Textbox سمت راست Output بشه که نمیشه ( محتوای نوشتاری TextBox سمت چپ Output میشه ).
My TextBox1.Text Properties
Right to Left : Yes
Text Align : Right
لطفا پروژه رو گذاشتم یکی زحمت تصحیحش رو بگردن بگیره ، ممنون میشم اگه برادری زحتمش رو متقبل بشه.
http://www.4shared.com/file/sxdiBicc/PrintTextBox.html
Imports System.Drawing.Printing
-----------------------------------------------
Public Class DataForm
Private Sub printText(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(TextBox1.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub
.
.
.
.
.
Private Sub BTNPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNPrint.Click
Try
Dim prindoc As New PrintDocument
AddHandler prindoc.PrintPage, AddressOf Me.printText
prindoc.Print()
Catch ex As Exception
MessageBox.Show("Error", ex.ToString())
End Try
End Sub
موقه پرینت گرفتن از Textbox باید محتوای نوشتاری Textbox سمت راست Output بشه که نمیشه ( محتوای نوشتاری TextBox سمت چپ Output میشه ).
My TextBox1.Text Properties
Right to Left : Yes
Text Align : Right
لطفا پروژه رو گذاشتم یکی زحمت تصحیحش رو بگردن بگیره ، ممنون میشم اگه برادری زحتمش رو متقبل بشه.
http://www.4shared.com/file/sxdiBicc/PrintTextBox.html
Imports System.Drawing.Printing
-----------------------------------------------
Public Class DataForm
Private Sub printText(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(TextBox1.Text, New Font("Arial", 12, FontStyle.Regular), Brushes.Black, 120, 120)
ev.HasMorePages = False
End Sub
.
.
.
.
.
Private Sub BTNPrint_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BTNPrint.Click
Try
Dim prindoc As New PrintDocument
AddHandler prindoc.PrintPage, AddressOf Me.printText
prindoc.Print()
Catch ex As Exception
MessageBox.Show("Error", ex.ToString())
End Try
End Sub