If you want to print the text of textbox or combobox
private void printButton_Click(object sender, EventArgs e)
{
//initialize a print document
PrintDocument printDocument1= new PrintDocument();
//add print page event handler
printDocument1.PrintPage += new
System.Drawing.Printing.PrintPageEventHandler
(this.printDocument1_PrintPage);
printDocument1.Print();
}
private void printDocument1_PrintPage(object sender,
System.Drawing.Printing.PrintPageEventArgs e)
{
//print the contents of textbox
e.Graphics.DrawString(TextBox.Text, new Font("Arial", 80,
FontStyle.Regular), Brushes.Black, 50, 100);
}
--
Shak
(Houston)
"freddy" <fr****@discussions.microsoft.com> wrote in message
news:8D**********************************@microsof t.com...
I am new to c#, I am trying to print the context of a textbox or a
combobox.