Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Sedna DBI-tech control problems
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Contrôles ActiveX en VFP
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Divers
Thread ID:
01413493
Message ID:
01413910
Vues:
70
>I have similar code, it works fine. What I wanted was to disable the choice the user just selected, so the user does not press, say 'report b32' multiple times.
>
>What I ended up doing is when the user selects report32b I see if the form is already instantiated or not. If not, I create it. if it is, I switch to it. Very inelegant, the menu should disable.
>
>Thanks,
>
>Tuvia
>
>(BTW, the docs state, and I agree, bad practice to call things by their nitem. Every time you add or remove a menu option, the number of the option could change. The docs suggest getting the control number, which you define, and use that instead.)

I don't add menu options at runtime. At design time I add a blank toolbar on my form, add the menu options I will require for that particular form, and now I know in the Itemclick event for that form how many menu options I need to check. So if the user clicks on the first menu option (say navigate to the first record of the table - so now I need to disable that menu option because the user cannot go any further to the top of the table), my code would look like this:
Do Case
	Case nitem = 1
		Go Top
		Skip 1
		Wait Window Nowait 'Top of file'
		This.ItemEnabled(1)=.F.
endcase
Seems to work fine for me.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform