Link to home
Start Free TrialLog in
Avatar of jinxster
jinxster

asked on

Printing crviewer control by pressing one key only

Hi, I have a form (frmReport) which has one control on it (crvReport).

What I would like is when you press the "/" (Asc(47)) button the form must close and when pressing the "*" (Asc(42))  button the form must print and close.

The trouble is there is no keyboard event for the crviewer control.

What can I try?

TIA
Avatar of Mike McCracken
Mike McCracken

Nothing in CR that I am aware of since it cannot respond to a keypress event.

I wonder if you could put a timer on the form and have it check for a keypress through Windows API calls.  I don't know how to do it but it might be possible.

mlmcc

?

If you set keypreview to true on the form, you should get the form's key_press event.
Am I missing something?
Eddy - The Crystal control only exposes the click events.

mlmcc
ASKER CERTIFIED SOLUTION
Avatar of jinxster
jinxster

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
PAQ.  no refund unless he responds
Avatar of jinxster

ASKER

I gave my own solution so I do not feel anyone really earned any points, sorry.