************************************************** *-- Form: form1 (c:\z\form311.scx) *-- ParentClass: form *-- BaseClass: form *-- Time Stamp: 01/29/03 06:01:10 PM * DEFINE CLASS form1 AS form DoCreate = .T. Caption = "Form1" Name = "Form1" ADD OBJECT grid1 AS grid WITH ; ColumnCount = 2, ; Height = 200, ; Left = 24, ; RecordSource = "table2", ; Top = 24, ; Width = 320, ; Name = "Grid1", ; Column1.ControlSource = "table2.wtkgs", ; Column1.Name = "Column1", ; Column2.Bound = .F., ; Column2.ControlSource = "", ; Column2.Sparse = .F., ; Column2.DynamicCurrentControl = "thisform.calcpounds()", ; Column2.Name = "Column2" ADD OBJECT form1.grid1.column1.header1 AS header WITH ; Caption = "Kg", ; Name = "Header1" ADD OBJECT form1.grid1.column1.text1 AS textbox WITH ; BorderStyle = 0, ; Margin = 0, ; ForeColor = RGB(0,0,0), ; BackColor = RGB(255,255,255), ; Name = "Text1" ADD OBJECT form1.grid1.column2.header1 AS header WITH ; Caption = "Pound", ; Name = "Header1" ADD OBJECT form1.grid1.column2.text1 AS textbox WITH ; BorderStyle = 0, ; Margin = 0, ; ForeColor = RGB(0,0,0), ; BackColor = RGB(255,255,255), ; Name = "Text1" PROCEDURE calcpounds lparameter tn thisform.grid1.column2.Text1.Value = wtkgs*2.205 return tn ENDPROC PROCEDURE text1.Valid replace wtkgs with this.value/2.205 ENDPROC PROCEDURE text1.GotFocus this.parent.parent.refresh() ENDPROC ENDDEFINE * *-- EndDefine: form1 **************************************************the code piece in the grid definition:
PROCEDURE text1.GotFocus this.parent.parent.refresh() ENDPROCis there to prevent the focus jumping.