Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add column to grid textbox is readonly
Message
From
26/01/2004 14:58:40
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00870614
Message ID:
00870739
Views:
12
I just modified Nancy's code from your message below and it appears to work. Can't figure out why it doesn't in our case yet...
Here is the test code that works:
CLOSE ALL
RELEASE ALL
CLEAR ALL

DELETE FILE ROTextbox.SC? RECYCLE

* Make a form
CREATE FORM ROTextbox NOWAIT
LOCAL laObject[1], lo
ASELOBJ(laObject,1)
lo = laObject[1]

* Add a grid with 1 column
lo.ADDOBJECT('grid1','grid')
lo.Grid1.COLUMNCOUNT = 1

* Make a simple cursor so the grid has something
* to bind to. Note, though, that this isn't
* necessary to trigger the issue.
lo.WRITEMETHOD("Load",;
  "CREATE CURSOR temp (l1 l)" + CHR(13) + ;
  "APPEND BLANK")

* Add code to the Grid's Init() to add a
* textbox at runtime and confirm it's invisible.
lo.Grid1.COLUMNS(1).WRITEMETHOD("Init",;
  "THIS.ADDOBJECT('text2','textbox')" + ;
  CHR(13) + ;
  "THIS.CURRENTCONTROL = 'text2'" + ;
  CHR(13) + ;
  "Messagebox('text2.Visible='+" + ;
  "TRANSFORM(This.text2.Visible))")

* Save and run the form.
KEYBOARD '{CTRL-W}'
DOEVENTS FORCE
DO FORM ROTextbox

CLOSE ALL
RELEASE ALL
CLEAR ALL

DELETE FILE ROTextbox.SC? RECYCLE

* Make a form
CREATE FORM ROTextbox NOWAIT
LOCAL laObject[1], lo
ASELOBJ(laObject,1)
lo = laObject[1]

* Add a grid with 1 column
lo.ADDOBJECT('grid1','grid')
lo.Grid1.COLUMNCOUNT = 1

* Make a simple cursor so the grid has something
* to bind to. Note, though, that this isn't
* necessary to trigger the issue.
lo.WRITEMETHOD("Load",;
  "CREATE CURSOR temp (l1 l)" + CHR(13) + ;
  "APPEND BLANK")

* Add code to the Grid's Init() to add a
* textbox at runtime and confirm it's invisible.
lo.Grid1.COLUMNS(1).WRITEMETHOD("Init",;
  "THIS.ADDOBJECT('text2','textbox')" + ;
  CHR(13) + ;
  "THIS.text2.visible = .T." +;
  CHR(13) + ;
  "THIS.CURRENTCONTROL = 'text2'" + ;
  CHR(13) + ;
  "Messagebox('text2.Visible='+" + ;
  "TRANSFORM(This.text2.Visible))")

* Save and run the form.
KEYBOARD '{CTRL-W}'
DOEVENTS FORCE
DO FORM ROTextbox
>Hi Tracy,
>
>I don't know why it doesn't works. See THREAD#848757 I had this exact problem and the visible property did the trick.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform