vb.Net 2008中Crystal Report PRINT选项的快捷键 [英] short cut key for crystal report PRINT option in vb.Net 2008

查看:74
本文介绍了vb.Net 2008中Crystal Report PRINT选项的快捷键的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个固定的报告.....我想要任何可以自动打印报告的快捷键.... ??
如何设置快捷键?

i have a crystal report.....i want any shortcut key that can auto-maticaly print a report....??
How can i set a short-cut key ?? it is possible ???

推荐答案

嗨.
您可以通过Keypress事件捕获键.
例如:
Hi.
You can catch keys with the Keypress event.
example:
Private Sub Form1_KeyPress(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles MyBase.KeyPress

End Sub


然后,您可以使用e.KeyPress ...

或者,也许MSDN-Help可以帮助您:


Then you can work with e.KeyPress...

Or maybe the MSDN-Help can help you:
System.Windows.Forms.Keypresseventargs




Regards,
The.Z


为表单设置 KeyPreview = True ,以便在任何控件上按下的键都将到达Form1_KeyPress.
Set KeyPreview=True for your form, so that key pressed over any controls gets to the Form1_KeyPress.

Private Sub Form1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles Me.KeyDown
  If e.Control And e.KeyCode = Keys.P Then
    'here goes your code to print the report
    CrystalReportViewer1.PrintReport()
  End If
End Sub


我喜欢创建快捷方式通过使用菜单对象来设置键,然后通过将可见性设置为false来隐藏它们.您可以使用所需的任何快捷键来设置menuItem,并在click事件中添加要执行的代码.
I like to create shortcut keys by using menu objects and then hiding them by setting visibility to false. You can setup the menuItem with whatever shortcut key(s) you want and add the code you want it to execute in the click event.


这篇关于vb.Net 2008中Crystal Report PRINT选项的快捷键的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆