please i need to print a listview, c#
how print a listview
Collapse
X
-
Tags: None
-
What have you tried so far?
Is your current code for printing producing an error or exception?
MSDN "how-to" for printing a document -
-
no, i need print a listview in a printer. I have this code, but exist other opcion to print only text, not use a bitmap???
Code:Font printFont; Bitmap bitmap; public void PrintAString(Bitmap data) { PrintDocument pd = new PrintDocument(); printFont = new Font("Arial", 12); pd.PrintPage += new PrintPageEventHandler(PrintPage); pd.DefaultPageSettings.Landscape = true; pd.Print(); } private void PrintPage(object sender, PrintPageEventArgs e) { bitmap = new Bitmap(this.listView2.Width, this.listView2.Height); listView2.DrawToBitmap(bitmap, this.listView2.ClientRectangle); e.Graphics.DrawImage(bitmap, new Point(70, 70)); } private void imprimirToolStripMenuItem_Click(object sender, EventArgs e) { PrintAString(bitmap); }Last edited by tlhintoq; Dec 1 '09, 04:48 PM. Reason: [CODE] ...your code here... [/CODE] tags addedComment
-
TIP: When you are writing your question, there is a button on the tool bar that wraps the [code] tags around your copy/pasted code. It helps a bunch. Its the button with a '#' on it. More on tags. They're cool. Check'em out.Comment
Comment