printDialog pageSetupDialog, PrintDocument, printPreviewDialog
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 prindialog
{
public partial class Form1 : Form
{
public
Form1()
{
InitializeComponent();
}
private
void button1_Click(object
sender, EventArgs e)
{
pageSetupDialog1.ShowDialog();
}
private
void printDocument1_PrintPage(object sender, System.Drawing.Printing.PrintPageEventArgs e)
{
e.Graphics.DrawString(richTextBox1.Text,new
Font("Tahoma",
18),Brushes.Black,10,20);
}
private
void button2_Click(object
sender, EventArgs e)
{
printPreviewDialog1.ShowDialog();
}
private
void button3_Click(object
sender, EventArgs e)
{
printDialog1.ShowDialog();
}
}
}
Komentar
Posting Komentar