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:
01414544
Vues:
43
>I have hundreds of options, I do not want hundreds of case statements each with a disable command. The nitem param should work, although I am confused: what does
>
>		Go Top
>		Skip 1
>		Wait Window Nowait 'Top of file'
>
>
>have to do with it? In the Itemclick a param is passed with the menu item number (nitem).

No you do not. I use the ctToolbar as a navigation toolbar on a form, and since all the menu options will most likely use the current alias, and I was showing you the code for the first button (Top of of the table). Here is a more complete version of the Itemclick code, so you can see what I am doing. (The first menu option is "Top of fiel", the second one is "previous record", the third one is "Next record" etc.....)
Lparameters nitem, barrow
Local lcAlias
lcAlias = Thisform.DataEnvironment.InitialSelectedAlias

Select (lcAlias)
Set Order To Tag nnas
Do Case
	Case nitem = 1
		Go Top
		Skip 1
		Wait Window Nowait 'Début du fichier'
		Thisform.dobeforeinit()
		Thisform.tbrinform1.ItemEnabled(1)=.F.
		Thisform.tbrinform1.ItemEnabled(2)=.F.
		Thisform.tbrinform1.ItemEnabled(3)=.T.
		Thisform.tbrinform1.ItemEnabled(4)=.T.
		Thisform.getphoto(client.nas)
		thisform.coMMIS1.Value = client.commis
		Thisform.Refresh()
	Case nitem = 2
		Select (lcAlias)
		If !Bof()
			Skip -1
			If Bof()
				Skip 1
				Thisform.tbrinform1.ItemEnabled(1)=.F.
				Thisform.tbrinform1.ItemEnabled(2)=.F.
				Thisform.tbrinform1.ItemEnabled(3)=.T.
				Thisform.tbrinform1.ItemEnabled(4)=.T.
			Else
				Thisform.tbrinform1.ItemEnabled(1)=.T.
				Thisform.tbrinform1.ItemEnabled(2)=.T.
				Thisform.tbrinform1.ItemEnabled(3)=.T.
				Thisform.tbrinform1.ItemEnabled(4)=.T.
			Endif
		Else
			Go Top
			Thisform.tbrinform1.ItemEnabled(1)=.F.
			Thisform.tbrinform1.ItemEnabled(2)=.F.
			Thisform.tbrinform1.ItemEnabled(3)=.T.
			Thisform.tbrinform1.ItemEnabled(4)=.T.
		Endif
		Thisform.dobeforeinit()
		thisform.coMMIS1.Value = client.commis
		Thisform.getphoto(client.nas)
		Thisform.Refresh()
	Case nitem = 3
		Select (lcAlias)
		If !Eof()
			Skip 1
			If Eof()
				Go Bottom
				Thisform.tbrinform1.ItemEnabled(1)=.T.
				Thisform.tbrinform1.ItemEnabled(2)=.T.
				Thisform.tbrinform1.ItemEnabled(3)=.F.
				Thisform.tbrinform1.ItemEnabled(4)=.F.
			Else
				Thisform.tbrinform1.ItemEnabled(1)=.T.
				Thisform.tbrinform1.ItemEnabled(2)=.T.
				Thisform.tbrinform1.ItemEnabled(3)=.T.
				Thisform.tbrinform1.ItemEnabled(4)=.T.
			Endif
		Else
			Go Bottom
			Thisform.tbrinform1.ItemEnabled(1)=.T.
			Thisform.tbrinform1.ItemEnabled(2)=.T.
			Thisform.tbrinform1.ItemEnabled(3)=.F.
			Thisform.tbrinform1.ItemEnabled(4)=.F.
			Wait Window Nowait 'Fin du fichier'
		Endif
		Thisform.dobeforeinit()
		thisform.coMMIS1.Value = client.commis
		Thisform.getphoto(client.nas)
		Thisform.Refresh()
                                           etc.......
But if you are not using the toolbar in that fashion, you do not need to use "Go Top" or anything related to a table movement.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform