Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Addobject()
Message
De
11/04/2004 12:16:54
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00893864
Message ID:
00893919
Vues:
21
Arto-

I expect you're missing two important things. You have to set the Column's Bound and Sparse properties .F. Here's an example that does what I think you're trying to do.
oform1=NEWOBJECT("form1")
oform1.SHOW
RETURN

DEFINE CLASS form1 AS FORM

  ADD OBJECT grid1 AS GRID WITH ;
    COLUMNCOUNT = 1, ;
    RECORDSOURCE = "temp", ;
    NAME = "Grid1", ;
    Column1.BOUND = .F., ;
    Column1.SPARSE = .F.

  ADD OBJECT command1 AS COMMANDBUTTON WITH ;
    TOP = 200, ;
    HEIGHT = 27

  PROCEDURE LOAD

    CREATE TABLE temp (c1 C(10),l1 L)
    INSERT INTO temp VALUES ("Hello", .T.)

  ENDPROC

  PROCEDURE INIT

    WITH THIS.grid1.Column1

      .ADDOBJECT('check1','checkbox')
      .check1.CONTROLSOURCE = "temp.l1"
      .text1.CONTROLSOURCE = "temp.c1"

    ENDWITH

  ENDPROC

  PROCEDURE command1.CLICK

    WITH THISFORM.grid1.Column1

      IF .CURRENTCONTROL = "Text1"
        .CURRENTCONTROL = "Check1"
      ELSE
        .CURRENTCONTROL = "
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform