Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Determing what an object is in.. i.e is it in a grid??
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00267662
Message ID:
00267668
Vues:
18
>I have taken the sample date time class from this site.. (The one that pops up a claendar, +,- moves days, etc..) and I want to change it to do the following: When the object is in a grid, the pgup and pgdn function keys do not affect it.
>
>I need to findout how I can find out if it is in a grid. I then set a propert called ingrid to .t. which in the keypress event disables the processing of the pgup and pgdn keys.
>
>I have tried the following, in the init method:
>*- Check to see if contol is in a grid
>if this.parent.parent.parentclass='Grid'
> this.inGrid=.t.
>else
> this.inGrid=.f.
>endif
>
>It works fine if the control is in a grid, however if the control is on a form it crashes with:"Parent is not an object".
>
>How can I make the control code generic so that if it is on a form that it sets inGrid to .f. and if it is in a Grid to .t.?

You could check the TYPE first, to see if it's 'U' or not...
The Anonymous Bureaucrat,
and frankly, quite content not to be
a member of either major US political party.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform