Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Close form by pressing ESC
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01538616
Message ID:
01538851
Vues:
153
J'aime (1)
KeyPreview doesn't work from the Web Browser control. When the WebBrowser has control your FoxPro keystroke events are not getting processed as you are effectively inside of that 'window'. In order to capture events you need to handle the browser's DOM events.

You can call JavaScript functions from FoxPro code and pass in a reference to the FoxPro form, then call that from script code for example.

Here's some basic info on calling JavaScript code in the Web Browser control:

http://www.west-wind.com/weblog/posts/2008/Sep/27/Calling-JavaScript-functions-in-the-Web-Browser-Control

+++ Rick ---

>Hi everybody,
>
>I have a form with Web Browser control taking all the form. I set KeyPreview property to .t. and added a code in KeyPress event
>
> if nKeyCode = 27
>   thisform.release()
>endif
>
>However, pressing ESC doesn't close the form. Do you know how can I make this form to close on ESC?
>
>Thanks in advance.
+++ Rick ---

West Wind Technologies
Maui, Hawaii

west-wind.com/
West Wind Message Board
Rick's Web Log
Markdown Monster
---
Making waves on the Web

Where do you want to surf today?
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform