Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setfocus() gives error Cannot call setfocus from within
Message
De
10/02/2005 10:31:23
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
10/02/2005 08:16:26
Freddie Rodrigues
Bitrun Business Solutions
Mumbai, Inde
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00985506
Message ID:
00985566
Vues:
25
>I have placed a grid on a Form. To Add & Delete records, I have two seperate [command buttons]. After I have clicked any of each I need the cursor to get back to the grid & record accordingly.
>
>In the [Click Event] of the [command button]
>Typed Code & the Error message received thereafter.
>
>thisform.pageframe1.page1.grditemsgrid.setfocus()
>
>Error message: Cannot call Setfocus from within a When, Valid, RangeHigh or RangeLow event.

Frankly, I find this error to be particularly annoying. I don't frequently discard errors, but this is one I will toss. So, I don't know what your error handling is managed, but you could trap the error.
PROCEDURE Error
  Lparameters nError, cMethod, nLine
  *!* 11/08/03 03:21:40 PM nf 1: Fix problem in OrderHistory, e.g.
  Do Case
  Case nError = 2012 && Cannot call SetFocus from within a When, Valid, RangeHigh or RangeLow event. 
  * It can be very hard to tell where in a call stack a method might be called. Eat this error.

...etc...
I expect this would come under the heading of unsupported and possibly dangerous? I don't know. I haven't had a problem with it. YMMV
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform