How to relate the printDocument to the information we want to print
Hello i need some help in finding the way to relate the printDocument to the information i have in a panel control container... please iff anyone can point the way!!!!
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Karthikeyan AnbarasanPosted Apr 8, 2011, 2:25 AM
FroglegPosted Mar 29, 2011, 2:04 PM
http://msdn.microsoft.com/en-us/library/bb669065.aspx
Jorge TorselliPosted Mar 28, 2011, 9:40 PM
login falied for user TYM-01\guest.... and the connection string is these...
Data Source=192.168.1.5\Coatepeque;Initial Catalog=BDKR; user id = jose; password = 123; Integrated Security=True
or i have try these other conection string
Data Source=TYM-01\Coatepeque;Initial Catalog=BDKR; user id = jose; password = T0rs3ll1; Integrated Security=True
if you can see the user id is jose and i dont know why the hell is telling me TYM-01\guest
i have start and enable remote conections in sql instance and enable tcp/ip protocol....
so tell me what you tink ok???
thanks again....
Jorge
FroglegPosted Jan 10, 2011, 2:18 PM
The text that appears in my sample loaded automatically so during creating the project - I did not have to continually type in the textbox
to disable the text: comment out loadTxt() ie:
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'loadTxt()
RadioButton1.Checked = True
PrintDocument1.DefaultPageSettings.PaperSize = New Printing.PaperSize(("A4 (210 x 297 mm)"), 827, 1169)
End Sub
Jorge TorselliPosted Jan 10, 2011, 10:12 AM
in other word at desing time .....
FroglegPosted Jan 8, 2011, 2:07 PM
Regions are used to group code so that it makes it easier for someone to read, and you can expand / contract a region once that particular code is finished
#Region "Call it whatever"
#End Region
Jorge TorselliPosted Jan 8, 2011, 12:18 PM
question...1 i have to declare in the eload event the paper size? yes???
quetstion... 2 i never seen regions and end region would you be kind to explaint to me...
once again thanks.... am new into programing so this is been a great deal for me really thanks...
FroglegPosted Jan 4, 2011, 10:28 PM
ev.Graphics.DrawString(RichTextBox1.Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, 60, 300)
End Sub
In this sub the 60 and 300 are fixed margins so they need to adjustable
There are two types of RichTextBox printing examples in zip file, your's that I modified and another probably better way
Anyway try it and let me know what you think
Jorge TorselliPosted Jan 4, 2011, 10:48 AM
This is the code Im using to print the ritchTextbox, but I still cannot set the paper size in order to make the printer to recognize the margins in the content of the ritchTextBox, Once again thanks...
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Try
Dim printdoc As New PrintDocument
AddHandler printdoc.PrintPage, AddressOf Me.printext
printdoc.Print()
Catch ex As Exception
MessageBox.Show("Error vuelva a intentarlo")
End Try
End Sub
Private Sub printext(ByVal sender As Object, ByVal ev As PrintPageEventArgs)
ev.Graphics.DrawString(RichTextBox1.Text, New Font("Arial", 11, FontStyle.Regular), Brushes.Black, 60, 300)
End Sub
ev.HasMorePages = False
FroglegPosted Jan 4, 2011, 3:23 AM
If you are still having problems can you post your code
Jorge TorselliPosted Dec 31, 2010, 1:44 PM
Jorge TorselliPosted Dec 31, 2010, 1:43 PM
Thankyu for replying... sorry for my spellig,
Jorge
FroglegPosted Dec 21, 2010, 6:14 PM
You will be probably be using the graphics of printDocument