PUBLIC oform1 oform1=NEWOBJECT("form1") oform1.Show RETURN DEFINE CLASS form1 AS form Top = 0 Left = 1 Height = 250 Width = 458 DoCreate = .T. Caption = "SelStart value" Name = "Form1" ADD OBJECT text1 AS textbox WITH ; Tag = "Without", ; ControlSource = "this.tag", ; Height = 23, ; Left = 88, ; Top = 32, ; Width = 128, ; Name = "Text1" ADD OBJECT text2 AS textbox WITH ; Tag = "With WHEN", ; ControlSource = "this.tag", ; Height = 23, ; Left = 88, ; Top = 66, ; Width = 128, ; BackColor = RGB(255,193,193), ; Name = "Text2" ADD OBJECT text3 AS textbox WITH ; Tag = "With VALID", ; ControlSource = "this.tag", ; Height = 23, ; Left = 88, ; Top = 96, ; Width = 128, ; BackColor = RGB(255,193,193), ; Name = "Text3" ADD OBJECT timer1 AS timer WITH ; Top = 158, ; Left = 90, ; Height = 23, ; Width = 23, ; Interval = 2000, ; Name = "Timer1" ADD OBJECT label3l AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 232, ; Top = 100, ; Width = 72, ; Name = "Label3l" ADD OBJECT label2 AS label WITH ; Caption = "LostFocus", ; Height = 17, ; Left = 232, ; Top = 8, ; Width = 96, ; Name = "Label2" ADD OBJECT label3 AS label WITH ; Caption = "GotFocus", ; Height = 17, ; Left = 8, ; Top = 10, ; Width = 78, ; Name = "Label3" ADD OBJECT label1l AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 232, ; Top = 38, ; Width = 72, ; Name = "Label1l" ADD OBJECT label2l AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 232, ; Top = 70, ; Width = 72, ; Name = "Label2l" ADD OBJECT label3g AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 8, ; Top = 98, ; Width = 72, ; Name = "Label3g" ADD OBJECT label1g AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 8, ; Top = 36, ; Width = 72, ; Name = "Label1g" ADD OBJECT label2g AS label WITH ; Caption = "Label3", ; Height = 17, ; Left = 8, ; Top = 68, ; Width = 72, ; Name = "Label2g" PROCEDURE text1.LostFocus thisform.label1l.Caption = TRANSFORM(this.SelStart) this.SelStart = 2 ENDPROC PROCEDURE text1.GotFocus thisform.label1g.Caption = TRANSFORM(this.SelStart) this.SelStart = 4 ENDPROC PROCEDURE timer1.Timer KEYBOARD '{TAB}' PLAIN ENDPROC PROCEDURE text2.When * ENDPROC PROCEDURE text2.LostFocus thisform.label2l.Caption = TRANSFORM(this.SelStart) this.SelStart = 2 ENDPROC PROCEDURE text2.GotFocus thisform.label2g.Caption = TRANSFORM(this.SelStart) this.SelStart = 4 ENDPROC PROCEDURE text3.LostFocus thisform.label3l.Caption = TRANSFORM(this.SelStart) this.SelStart = 2 ENDPROC PROCEDURE text3.Valid * ENDPROC PROCEDURE text3.GotFocus thisform.label3g.Caption = TRANSFORM(this.SelStart) this.SelStart = 4 ENDPROC PROCEDURE Gotfocus thisform.SetAll("selStart",2) ENDDEFINE