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 biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shortcut key and ListView control 1

Status
Not open for further replies.

wgcs

Programmer
Mar 31, 2002
2,056
EC
How can I make the ListView control ( mscomctllib.listviewctrl.2 ) pop up a shortcut menu when I press the "Short Cut Key"?

When a foxpro control (command button, etc) has focus, the parameters returned for the "Shortcut key" are KeyCode=93 and ShiftAltCtrl=1, but:

Code in the ListView's KeyPress event does NOT fire when pressing the shortcut key (or any other key that the ListView "absorbs" and reacts to, like arrow keys)

Setting THISFORM.KeyPreview=.T. does NOT make the form KeyPress fire when keys are pressed and the listview has focus.

The VFP Debugger shows no events happen when pressing that key in the listview control...

Very frustrating! I would expect it to be simulating a click with the right mouse button, but it doesn't! (my code in the Click, MouseDown and MouseUp events works properly, when the mouse causes the events.)

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Check KeyUp, KeyDown and Kepress evets of the control.

Borislav Borissov
 
Well, Whaddya know!?

Thanks Borislav,

While the KeyPress event is a VFP event (and the only key event that can be tracked in the Event Logger) and never fires,

the other two, KeyUp and KeyDown work exactly as expected!

The code for the shortcut key is 93, and works like a charm!

Thanks again!

- Bill

Get the best answers to your questions -- See FAQ481-4875.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top