General information
Category:
Forms & Form designer
Title:
How to add object with procedure, programmatically in form
First Question
If I put a checkbox in a grid and then set the recordsource to
.grid1.recordsource = .grid1.recordsource
the checkbox will dissappeared. Why and how to solve it???
Second Question
I want to put a checkbox in a column(grid) programmatically,
e.g. : .grid1.column7.addobject('Check1','CHECKBOX')
The problem with the above statement is it will add a basic vfp base class of checkbox. So I tried this statement:
do program\definecheckbox.prg
Check11 = CREATEOBJECT("Check1")
thisform.grid1.column7.ADDOBJECT('chkSelect',Check11)
but, as u know the third line give error...
thisform.grid1.column7.ADDOBJECT('chkSelect',Check11)
Check11 must be in single quote
thisform.grid1.column7.ADDOBJECT('chkSelect','Check11')
but, the above statement also have error...
Class Definition Check11 is not found
So, anyone can help???
**************** definecheckbox.prg
DEFINE CLASS Check1 AS CheckBox
Caption = ''
PROCEDURE InteractiveChange
ENDDEFINE
**********
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only