Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Keypress on form with CR ViewerControl

Status
Not open for further replies.

tcorrigan

Programmer
Jun 3, 1999
43
US
I am trying to set things up so that the user can use the PageUp and PageDown keys when viewing a report in the CR Viewer Control in a VB app. However, even though KeyPreview is set to true in the underlying form, the form's KeyDown event isn't being fired. Does anybody know how to capture the keystrokes?
 
I don't think you need to do anything programming-wise.

If the user just clicks the mouse anywhere in the preview pane of the report, the page up/page down buttons work at that point.
 
The problem is that the user doesn't want to use the mouse, he wants to use the keyboard.
 
Okay...

Call the .ZOrder method of your CRViewer object. If you put your code in the Form Load event to create and display the report, make CRViewer1.ZOrder the last line of code in the Form Load event.

This appears to work for me. It puts the focus in the preview pane and you can page up/down without a mouse.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top