View Single Post
Old Aug 7th, 2005, 3:07 AM   #1
George Giolfan
Newbie
 
Join Date: Aug 2005
Location: Romania
Posts: 13
Rep Power: 0 George Giolfan is on a distinguished road
How to handle keyboard events in an app containing ActiveX Controls ?

1. I am trying to create a custom media player based on Windows Media Player ActiveX control. I want a form that contains only the control, and another with the rest of the interface (buttons and position slider). I want a common keyboard handler for the two forms. This works fine with the second form, but sometimes when the form containing the Media Player control has focus and I press a key, nothing happens. It seems to be related to focus (pressing Tab seems to affect the problem). Also I would like to disable the focus cue (a light colored rectangle around the Media Player control).
2. I am using the WebBrowser ActiveX control to display some information in a program. I am navigating to "about:blank" and then using the Document property to add the information. The problem is that if the user presses a key combination normally used in Internet Explorer (such as F5 for Refresh) while the control has focus it is interpreted by the control. I tried to set the Handled property of the EventArgs instance I get in the event handler, but it seems that the event is not raised event with KeyPreview set to True.
George Giolfan is offline   Reply With Quote