Form::Init Local oPage As Page, HiTab, HiControl As TextBox, oControl as textbox This.pageframe1.ZOrder(1) This.container1.ZOrder(0) With This.pageframe1 For Each oPage In .Pages HiTab = 0 HiControl = '' For Each oControl In oPage.Controls If Pemstatus(oControl,'Lostfocus',5) If oControl.TabIndex > HiTab HiTab = oControl.TabIndex HiControl = oControl Endif Endif Endfor If Not Empty(HiTab) Bindevent(HiControl,'lostfocus',This,'tabhandler',7) Endif Endfor ENDWITHNow create a the method I will call TabHandler
Form::TabHandler IF INLIST(LASTKEY(),9,13) && Only interested in TAB and CR this.container1.command1.SetFocus() ENDIFAnd that's all there is to it.