I created a form that has printpreview dialog and set the print button tool for show print dialog like this
this is a code
public partial class frmTest : Form
{
public frmTest()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
PrintPreviewDialog printPrvDlg = new PrintPreviewDialog();
ToolStripButton b = new ToolStripButton();
b.Image = ((System.Windows.Forms.ToolStrip)
(printPrvDlg.Controls[1])).ImageList.Images[0];
b.DisplayStyle = ToolStripItemDisplayStyle.Image;
b.Click += printPreview_PrintClick;
((ToolStrip)(printPrvDlg.Controls[1])).Items.RemoveAt(0);
((ToolStrip)(printPrvDlg.Controls[1])).Items.Insert(0, b);
printPrvDlg.ShowDialog();
}
private void printPreview_PrintClick(object sender, EventArgs e)
{
PrintDialog printDlg = new PrintDialog();
printDlg.ShowDialog();
}
}
when the ptintpreview Dialog appear and i clicked the printer button it's ok to show printDialog but i want to use keyboard ctrl+P to show PrintDialog instead of Clicking Does Anyone feel free to help me thank you