Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Using GRID to enter data
Message
 
À
09/04/2008 12:21:20
Fabian Borghi
Xenon Information Technology
Itaparica, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 8
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01309223
Message ID:
01309414
Vues:
7
>Thanks so much Tom but didn't function

Here one example based on Edward's suggestion:
PUBLIC oform1

oform1=NEWOBJECT("form1")
oform1.Show(1)
RETURN


**************************************************
*-- Form:         form1 (d:\all_zapl\test.scx)
*-- ParentClass:  form
*-- BaseClass:    form
*-- Time Stamp:   04/09/08 07:26:10 PM
*
DEFINE CLASS form1 AS form


    DoCreate = .T.
    Caption = "Form1"
    Name = "Form1"


    ADD OBJECT grid1 AS grid WITH ;
        ColumnCount = 4, ;
        Height = 200, ;
        Left = 7, ;
        Top = 15, ;
        Width = 345, ;
        Name = "Grid1", ;
        Column1.Name = "Column1", ;
        Column2.Name = "Column2", ;
        Column3.Name = "Column3", ;
        Column4.Name = "Column4"



    PROCEDURE Init
        WITH thisform.Grid1 AS Grid
             .RecordSource          = [crsTest]
             .Column1.ControlSource = [crsTest.Fld1]
             .Column2.ControlSource = [crsTest.Fld2]
             .Column3.ControlSource = [crsTest.Fld3]
             .Column4.ControlSource = [crsTest.Fld1+crsTest.Fld2+crsTest.Fld3]
             .Refresh()
        ENDWITH
    ENDPROC


    PROCEDURE Load
        CREATE CURSOR crsTest (Fld1 int, Fld2 int, Fld3 int)
        FOR lnFor = 1 TO 20
            INSERT INTO crsTest VALUES (lnFor , lnFor +7, lnFor +12)
        NEXT
        GO TOP
    ENDPROC


ENDDEFINE
*
*-- EndDefine: form1
**************************************************
Change ANY value of columns from 1-3 and you will see how the value of column 4 will be changed.
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform