Thursday, September 8, 2011

Ctrl + P in Report Viewer Visual Studio 2010 C#

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();
           }


}

No comments:

Post a Comment