1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Silverlight and KeyDown

Discussion in 'C#' started by xds4lx, Aug 31, 2010.

  1. xds4lx

    xds4lx New Member

    Aug 31, 2010
    Likes Received:
    Trophy Points:
    So this is a kinda complex problem. I have a silverlight application that I have developed that relies on some key presses to function, when running this application it grabs the KeyDown and KeyUp events off the host user control, everything works great. Well this application has to be hosted inside of another silverlight application, so you could think of my application as a dll (after all it really is) and it gets loaded into the main application through reflection. This hosting application has a few buttons and you click one to launch the desired application. To get the key presses we first tried to capture the KeyDown/KeyUp events on the main user control and they did not fire at all. We then added KeyDown/KeyUp events to the buttons and are able to pass our Key events into the application however we can not pass in spacebar or enter this way. Is there a way to do this that I haven't thought of yet. I also tried to change the buttons to rectangles, which worked for the button press events, however the rectangle fails to keep focus so it also has no key events fire.

Share This Page