Article ID: 156580
Article Last Modified on 10/15/2003
<form>.Setall('value', '', 'textbox')
However, issuing the following sets properties for all text boxes, even
those contained in grids:
<form>.Setall(<other property besides value>, ;
<property value>, 'textbox')
In Visual FoxPro 5.0 and 6.0, the following works for all text boxes, even
those contained in grids within <form>:
<form>.Setall('value', '', 'textbox')
* Start of code example
*
PUBLIC oform
LOCAL lnI
CREATE TABLE table_1 (field1 C(10), field2 C(10))
FOR lnI=1 TO 3
INSERT INTO table_1 VALUES ('xx','yy')
ENDFOR
GO TOP
oform=CREATEOBJECT("grid_form")
oform.SHOW()
DEFINE CLASS grid_form AS FORM
AUTOCENTER = .T.
ADD OBJECT grid1 AS GRID WITH ;
Top = 10, ;
Left = 30, ;
RecordSource = 'Table_1', ;
ColumnCount = 2, ;
Name = "Grid1", ;
Column1.Sparse=.F., ;
Column2.Sparse=.F.
ADD OBJECT Text1 AS TEXTBOX WITH ;
Top = 220, ;
Left = 45, ;
Height = 23, ;
Width = 95, ;
Value = "zz", ;
Name = "Text1"
ADD OBJECT command1 AS COMMANDBUTTON WITH ;
Top = 218, ;
Left = 145, ;
Height = 27, ;
Width = 95, ;
Caption = "Set Values", ;
Name = "Command1"
ADD OBJECT command2 AS COMMANDBUTTON WITH ;
Top = 218, ;
Left = 245, ;
Height = 27, ;
Width = 95, ;
Caption = "Set FontSize", ;
Name = "Command2"
PROCEDURE DESTROY
USE
ENDPROC
PROCEDURE Command1.Click
THISFORM.SetAll('Value', '', 'TextBox')
* The above works for text boxes in grid columns
* under Visual FoxPro 5.0 only
THISFORM.Grid1.SetFocus()
ENDPROC
PROCEDURE Command2.Click
THISFORM.SetAll('FontSize', 12, 'textbox')
* The above works for text boxes in grid columns
* under Visual FoxPro 3.x and 5.0.
THISFORM.Grid1.SetFocus()
ENDPROC
ENDDEFINE
*
* End of code example
Keywords: kbinfo kbsetup KB156580