Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Valid method in a grid textboxes
Message
De
30/03/2001 07:17:39
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00489616
Message ID:
00490258
Vues:
8
Hi Nadya.

>> I have a grid and I placed Valid method for several columns (in their textbox control - I use default textbox). Today I noticed, that this Valid method fires each time, I tab between columns or navigate in a grid. <<

Keep in mind, that there is also a teensy weensy little bug that could thwart your validation in the textboxes.

When moving from a grid to another object on the form, the grid's Valid fires before the valid of the active cell. This is a bug. Normally you would expect to use the control's Valid method to determine whether that control can lose focus. However, when a control is contained within a grid, there are two levels at which focus operates. First, between the control and other controls that are also within the grid. In this context things behave normally.

Second there is the issue of which form object has focus. This bug will bite you when focus is being moved between the grid and another object. It is, as you would expect, the grid’s Valid method that determines whether the grid can lose focus. However, because the grid’s Valid is called before that of any contained control, a contained control cannot prevent the grid from losing focus even though its own validation has failed.

This can and will allow bad data to be entered into the grid.

Marcia
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform