PrintPreview中的ctrl + p快捷键

问题描述:

如何为PrttPreview控制表单中的按钮Print添加快捷方式(ctrl + p)?

How to add a shortcut (ctrl+p) for the button Print in the PrttPreview Control form?

通过这些链接,您可能会有所了解。 ..

http://stackoverflow.com/questions/20897823/how-to-show-print-dialogue-when-i-press-control-p-in-windows-form [ ^ ]





http://stackoverflow.com/questions/7650915/capturing-ctrl-shift-p-key-stroke-in-ac -sharp-windows-forms-application [ ^ ]
go through these links you may get some idea...
http://stackoverflow.com/questions/20897823/how-to-show-print-dialogue-when-i-press-control-p-in-windows-form[^]


http://stackoverflow.com/questions/7650915/capturing-ctrl-shift-p-key-stroke-in-a-c-sharp-windows-forms-application[^]


http://www.c-sharpcorner.com/uploadfile/mahesh/printpreviewcontrol-in-C-Sharp/ [ ^ ]



https://documentation.devexpress.com/#xtrareports/CustomDocument2668 [ ^ ]

http://www.dotnetheaven.com/article/printpreview-control-in-vb.net [ ^ ]

打印预览控制栏 [ ^ ]
http://www.c-sharpcorner.com/uploadfile/mahesh/printpreviewcontrol-in-C-Sharp/[^]

https://documentation.devexpress.com/#xtrareports/CustomDocument2668[^]
http://www.dotnetheaven.com/article/printpreview-control-in-vb.net[^]
Print Preview Control Bar[^]


拖放PrintDailoG并设置PropartyAllowCurrentPage = True



和Cs之后的文件代码:





Drag An Drop "PrintDailoG" And Set Proparty "AllowCurrentPage = True"

And After Cs File Code:


protected override bool ProcessCmdKey(ref Message msg, Keys keyData)
       {
           
           if ((Keys.Control | Keys.P) == keyData)
           {
               PrintForm.ShowDialog(this);
           }


           return base.ProcessCmdKey(ref msg, keyData);
       }