Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why is a grid added to a form automatically bound to a t
Message
De
01/05/2000 17:17:50
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00364907
Message ID:
00364910
Vues:
29
>How does a grid when .Add-ed to a form get bound automatically to an open table? Here's my code
>
>CLOSE ALL  && Close tables and databases
>OPEN DATABASE (HOME(2) + 'Data\testdata')
>USE customer IN 0
>frmMyForm = CREATEOBJECT('Form')
>WITH frmMyForm
>	.AddObject('grdGrid1','Grid')  && me:  bound
>		.grdGrid1.Left = 25
>		.grdGrid1.Visible = .T.
>	.AddObject('cmdCommand1','cmdMyCmdBtn')
>		.cmdCommand1.Left = 125
>		.cmdCommand1.Top = 210
>		.cmdCommand1.Visible =.T.
>	.AddObject("txtText1",'Textbox')  && me: not bound
>		.txtText1.Left = 125
>		.txtText1.Top = 240
>		.txtText1.Visible = .T.
>	.Closable = .F.  && Disable the window pop-up menu
>	.SHOW
>ENDWITH
>READ EVENTS
>
>DEFINE CLASS cmdMyCmdBtn AS CommandButton
>	Caption = '\<Quit'
>	Cancel = .T.
>	Height = 25  && me: withour this property it's reeeal small
>	PROCEDURE Click
>		CLEAR EVENTS
>		CLOSE ALL
>ENDDEFINE
>
>
It automatically uses whatever the current workarea is. If you want to use a different table, set the grid's RecordSource property to be the name of whatever table you want:

thisform.grdGrid1.RecordSource = "myAlias"
Fred
Microsoft Visual FoxPro MVP

foxcentral.net
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform