Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Addobject()
Message
De
11/04/2004 03:17:18
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Titre:
Divers
Thread ID:
00893864
Message ID:
00893888
Vues:
20
>Hi Patric,
>
>With you soultion you add an editbox. It's default type is Character and there is no problem to add it.
>
>What I'm looking for is to add (no need to remove textbox first) a control to a column which has different default type like checkbox. F.ex.
>
>Create a DBF with two columns F1 C(10) and F2 C(10).
>Add one record to the DBF.
>Create new form
>Open Dataenvironment
>Add above DBF to the DE
>Drag DBF from the DE to the from -> grid is created
>Add a checkbox to the COLUMN number 2 (drag and drop)
>Run form to see that it is working

This is just a example, you can change it to checkbox
>
>Then add a checkbox programmatically to the column number one
>f.ex Forms init method (or in column1 init where ever you like)
>
>ThisForm.grdGriddbf1.Column1.ADDOBJECT("check1","checkbox")
>With ThisForm.grdGriddbf1.Column1.check1
> .Top = 35
> .Left = 5
> .Height = 10
> .Width = 10
> .Caption = "Check1"
> .ControlSource = ""
> .Name = "Check1"
> .Visible = .T.
>Endwith
>
>Problem is that checkbox is added but you get an error too:
>Error with Check1 - Value : Data type mismatch

ofcoz.....Character VS logical ????

>
>It doesn't help that you have defined .ControlSource = ""
>
>If you look columns / checkboxes in column1 and column2 you see that
>column2.controlsource is table.f1 and VFP added it without a problem
>(maybe because it is initialized before the column) but in this case both
>do the same - one with an error.
>
>
>AT

you can change the check1.controlsource
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform