Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Hiding a item in a menu/submenu
Message
De
06/07/2007 00:47:55
 
 
À
05/07/2007 13:24:06
Tim Muller
Innovative Solutions, Inc.
West New York, New Jersey, États-Unis
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire de menu & Menus
Divers
Thread ID:
01238009
Message ID:
01238159
Vues:
8
>Is there a way to hide (as oppposed to disable with SKIP FOR) an item in a menu/submenu in VFP 8? What of VFP 9?
>
>Thanks.
>
>
>Tim

Here is some code I use. Add it to the Cleanup section of your menu.
If _vfp.StartMode #0
	For padcnt = 1 To Cntpad('_msysmenu')
		cmenuname = Getpad('_msysmenu', padcnt)
		nremoved = 0
		nMax = Cntbar(Left(cmenuname, 10))
		nEmptybars = 0
		lFirst = .T.
		For barcnt = 1 To nMax
			cbarname = Prmbar(Left(cmenuname, 10), Getbar(Left(cmenuname,  ;
				10), barcnt - nremoved))
			If Not Empty(cbarname)
				If  .Not. ShouldIShowThisMenuBar(Upper(Alltrim(cbarname)))
					ccmd = "RELEASE BAR " + Transform(barcnt) + " OF " +  ;
						LEFT(cmenuname, 10)
					&ccmd
					nremoved = nremoved + 1
					lFirst = .T.
				Else
					lFirst = .F.
				Endif
			Else
				nEmptybars = nEmptybars + 1
				If nEmptybars = 2
					nEmptybars = nEmptybars - 1
				Endif
				If nEmptybars = 2 Or lFirst
					ccmd = "RELEASE BAR " + Transform(barcnt) + " OF " +  ;
						LEFT(cmenuname, 10)
					&ccmd
					nremoved = nremoved + 1
				Endif
			Endif
		Endfor
	Endfor
Endif
The Function called - ShouldIShowThisMenuBar()
Here you decide whether the bar should be hidden or shown and return .T. or .F. as needed.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform