If you want to print the text of textbox or combobox
private void printButton_Cli ck(object sender, EventArgs e)
{
//initialize a print document
PrintDocument printDocument1= new PrintDocument() ;
//add print page event handler
printDocument1. PrintPage += new
System.Drawing. Printing.PrintP ageEventHandler
(this.printDocu ment1_PrintPage );
printDocument1. Print();
}
private void printDocument1_ PrintPage(objec t sender,
System.Drawing. Printing.PrintP ageEventArgs e)
{
//print the contents of textbox
e.Graphics.Draw String(TextBox. Text, new Font("Arial", 80,
FontStyle.Regul ar), Brushes.Black, 50, 100);
}
--
Shak
(Houston)
"freddy" <fr****@discuss ions.microsoft. com> wrote in message
news:8D******** *************** ***********@mic rosoft.com...
I am new to c#, I am trying to print the context of a textbox or a
combobox.