Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Form.KeyPress
Message
De
01/12/2007 05:16:35
 
 
À
30/11/2007 21:42:04
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01272436
Message ID:
01272616
Vues:
22
Hi,

I think Einar's right. The WebBrowser control derives from WebBrowserBase which is bascially a wrapper for the ActiveX control.
Regards,
Viv

>ActiveX control? Are you not using the new System.Windows.Forms.WebBrowser control? You should be. It's not ActiveX.
>
>~~Bonnie
>
>
>
>
>>Viv,
>>Thanks for testing. I also created a new test form and now I can get the form's keyobard events to fire, but only after I mouse click the webbrowser control on the form. After I click a keyboard button and the keyboard even fire I have to mouse click the webbrowser control again. Is that the behaviour you saw?
>>
>>I tried to access the keyboard events for the WebBrowser control in code (not through the property window) and exceptions were thrown left and right, but I noticed that the WebBrowser control is an ActiveX control, and that might be the reason for my troubles.
>>
>>Einar
>>
>>UPDATE: If I display something in the webbrowser control using the Url property (this.webBrowser1.Url = new Uri(@"c:\einar\1024x768.pdf");) the keyboard events don't fire even after mouse clicking the webbrowser control.
>>
>>>Hmm. WebBrowser control derives from Control and Control has a KeyPress event. Why do you say it WebBrowser doesn't have one? (Just looking at docs - haven't tried it.....)
>>>
>>>UPDATE: Just tried a WebBrowser on a form with KeyPreview true. Form got the KeyPress event just fine. OTOH, you seem to be right - the WebBrowser control doesn't expose the KeyPress event (at least not in the properties window)....
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform