Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Does a menu item already exist?
Message
 
 
À
12/04/2005 22:22:28
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Versions des environnements
Visual FoxPro:
VFP 8 SP1
OS:
Windows 2000 SP4
Divers
Thread ID:
01004016
Message ID:
01004025
Vues:
18
This message has been marked as the solution to the initial question of the thread.
Try
cMenuItem = "LifeCyle - Build"
lFound = .F.
FOR m=1 TO CNTBAR("_MTOOLS")
	lnBarNum = GETBAR('_MTOOLS', m)	
	lFound = lFound or (PRMBAR("_MTOOLS",lnBarNum)=cMenuItem)
NEXT
IF NOT lFound
	DEFINE BAR (CNTBAR("_MTOOLS")+1) OF _MTOOLS PROMPT cMenuItem KEY ALT+L MESSAGE "Open LifeCycle - Build Cycle"
	ON SELECTION BAR (CNTBAR("_MTOOLS")) OF _MTOOLS DO "&cAppPath.lcBuild"
ENDIF
>I am trying something like that.
>
>What I am attempting is to locate a popup item I may have placed there earlier. Here some code...
>
>
>cMenuItem = "LifeCyle - Build"
>lFound = .F.
>FOR m=1 TO CNTBAR("_MTOOLS")
>	lFound = lFound or (PRMBAR("_MTOOLS",m)=cMenuItem)
>NEXT
>IF NOT lFound
>	DEFINE BAR (CNTBAR("_MTOOLS")+1) OF _MTOOLS PROMPT cMenuItem KEY ALT+L MESSAGE "Open LifeCycle - Build Cycle"
>	ON SELECTION BAR (CNTBAR("_MTOOLS")) OF _MTOOLS DO "&cAppPath.lcBuild"
>ENDIF
>
>
>But, This fails to locate the menu item without erroring.
>
>I am trying to recall how I use to determine the existance of a menu item.
>
>
--sb--
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform