Code snippet here:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
 
namespace WindowsFormsApplication2
{
    public partial class Form1 : Form
    {
        DataSet ds = new DataSet();
        public Form1()
        {
            InitializeComponent();
        }
 
        private void button1_Click(object sender, EventArgs e)
        {
            printDialog1.Document = printDocument1;
            if (printDialog1.ShowDialog() == System.Windows.Forms.DialogResult.OK)
            {
                printDocument1.Print();
            }
        }
 
        private void printDocument1_PrintPage(object sender, 
		System.Drawing.Printing.PrintPageEventArgs e)
        {
            e.Graphics.DrawString("test",new Font(FontFamily.GenericSerif,12),
			Brushes.Black,100,100);
        }
    }
}
VN:F [1.1.6_502]
Rating: 0.0/5 (0 votes cast)
Share:
  • Digg
  • del.icio.us
  • Facebook
  • Google
  • DotNetKicks
  • LinkedIn
  • Live
  • MySpace
  • StumbleUpon
  • Technorati

Related posts:

  1. Change attributes of items in a combobox
  2. Filter Listbox based on Textbox entry
  3. c# Listbox – change color of items
  4. Move a control with mouse on form
  5. C# Multiple Watermarking in same image