Hi,
I just discovered that the value of a listbox created programmatically on the fly can be captured when cicking on another object. This isn't feasible after all. I need a way to determine if an object (listbox) exsists in order for this capturing code not to give an error. The other problem would be that I would have to put capture code in all objects for that listbox. Is there a way to create a listbox on the fly on the push of a button and to capture the value the user selects all within the same button?
Thanks
thisform.AddObject("List1","ListBox")
thisform.refresh
thisform.list1.Height=58
thisform.list1.Width=300
thisform.refresh
FOR lni = 1 TO 3
DO CASE
CASE lni = 1
lcValue = "Original Print Format"
CASE lni = 2
lcValue = "PDF"
OTHERWISE
lcValue = "PDF and Original Print Format"
ENDCASE
THISFORM.list1.ADDLISTITEM(lcValue,lni,1)
THISFORM.list1.ADDLISTITEM(lcValue,lni,2)
THISFORM.list1.ADDLISTITEM(lcValue,lni,3)
ENDFOR
thisform.list1.top=290
thisform.list1.left=288
thisform.list1.visible=.t.
thisform.list1.enabled=.t.
thisform.Refresh
I just discovered that the value of a listbox created programmatically on the fly can be captured when cicking on another object. This isn't feasible after all. I need a way to determine if an object (listbox) exsists in order for this capturing code not to give an error. The other problem would be that I would have to put capture code in all objects for that listbox. Is there a way to create a listbox on the fly on the push of a button and to capture the value the user selects all within the same button?
Thanks
thisform.AddObject("List1","ListBox")
thisform.refresh
thisform.list1.Height=58
thisform.list1.Width=300
thisform.refresh
FOR lni = 1 TO 3
DO CASE
CASE lni = 1
lcValue = "Original Print Format"
CASE lni = 2
lcValue = "PDF"
OTHERWISE
lcValue = "PDF and Original Print Format"
ENDCASE
THISFORM.list1.ADDLISTITEM(lcValue,lni,1)
THISFORM.list1.ADDLISTITEM(lcValue,lni,2)
THISFORM.list1.ADDLISTITEM(lcValue,lni,3)
ENDFOR
thisform.list1.top=290
thisform.list1.left=288
thisform.list1.visible=.t.
thisform.list1.enabled=.t.
thisform.Refresh