Set KeyPreview Property of your form to true
private void frmReports_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && (e.KeyCode.ToString() == "P" || e.KeyCode.ToString() == "p"))
{
this.KeyPreview = false;
reportViewer1.PrintDialog();
}
}
private void frmReports_KeyDown(object sender, KeyEventArgs e)
{
if (e.Control && (e.KeyCode.ToString() == "P" || e.KeyCode.ToString() == "p"))
{
this.KeyPreview = false;
reportViewer1.PrintDialog();
}
}
No comments:
Post a Comment