**************************************************
PUBLIC goForm
goForm = NEWOBJECT("frmForm")
goForm.Visible = .T.
goForm.Show
Read Events
Close all
Clear All
RETURN
**************************************************
DEFINE CLASS txtEnterBox as TextBox
BackColor = RGB(75, 255, 255)
FontBold = .T.
PROCEDURE KeyPress()
LPARAMETERS nKeyCode, nShiftAltCtrl
IF nKeyCode = 13
NODEFAULT
KEYBOARD '{DNARROW}'
ENDIF
ENDPROC
ENDDEFINE
DEFINE CLASS frmForm AS Form
AutoCenter = .T.
Caption = "Cities"
ShowTips = .T.
Height = 360
Width = 648
MinHeight = This.Height
MinWidth = This.Width
ADD OBJECT grdCities AS Grid WITH ;
BackColor = RGB(125, 255, 255), ;
DeleteMark = .F., ;
Left = 12, ;
Top = 12, ;
Width = 648 - 24, ;
Height = 360 - 24, ;
RowHeight = 24, ;
AllowRowSizing = .F., ;
Anchor = 15, ;
Themes = .F., ;
Visible = .T., ;
ColumnCount = -1, ;
RecordSource = "curCities"
PROCEDURE grdCities.Init()
WITH This.Column1
.Header1.Caption = "City"
.Header1.FontBold = .T.
.Width = 120
.Resizable = .F.
.NewObject("txtCity","txtEnterBox")
.CurrentControl = "txtCity"
.txtCity.Visible = .T.
.Sparse = .F.
ENDWITH
With This.Column2
.Header1.Caption = "Country"
.Header1.FontBold = .T.
.Width = 60
.Resizable = .F.
.NewObject("txtCountry","txtEnterBox")
.CurrentControl = "txtCountry"
.txtCountry.Visible = .T.
.Sparse = .F.
ENDWITH
ENDPROC
PROCEDURE Load()
CREATE CURSOR curCities (cCity C(25), cCountry C(2))
INSERT INTO curCities VALUES ("New York", "US")
INSERT INTO curCities VALUES ("Moscow", "RU")
INSERT INTO curCities VALUES ("Paris", "FR")
INSERT INTO curCities VALUES ("Berlin", "GE")
INSERT INTO curCities VALUES ("London", "GB")
INSERT INTO curCities VALUES ("Den Haag", "NL")
LOCATE
ENDPROC
PROCEDURE Destroy
CLOSE ALL
Clear Events
ENDPROC
ENDDEFINE
*********************************************