I would like to set the focus to the item "vLastname" and move to next item by pressing enter. I've tried some of the examples in Learning Xdialog, but can't get 'set the focus' or use the 'enter' key to work.
Code:
'Create an XDialog dialog box to prompt for parameters. DIM SHARED varC_result as C dim vFirstName as c dim vSuffix as c dim vSuffixList as c dim vLastname as c dim vState as c dim vCity as c dim vNewClntid as c = default var->clntid dim vSpouse as c dim vAddress_1 as c dim vAddress_2 as c dim vZip as c dim vPhoneHome as c dim vPhoneMobile as c dim vPhoneFax as c dim vPhoneWork as c dim vEmail1 as c dim vEmail2 as c dim ps1 as p dim ps1.def as c ps1.def = <<%str% hasToolbar=false hasHelp=false splitter=.2 visualtheme=0 order=category verbs= ^^Client Id state=opened show_label= type=category ++Client Id var=vNewClntid event= type=edit smartbutton=$a5_hammer enable=.f. ^^Name state=opened show_label= type=category ++Last var=vLastname event=Text Event type=edit smartbutton=$a5_hammer ++Suffix var=vSuffix event=Text Event type=edit smartbutton=$a5_hammer ++First var=vFirstName event=Text Event type=edit smartbutton=$a5_hammer ++Spouse var=vSpouse event=Text Event type=edit smartbutton=$a5_hammer ^^Address state=opened show_label= type=category ++Address1 var=vAddress_1 event=Text Event type=edit smartbutton=$a5_hammer ++Address2 var=vAddress_2 event=Text Event type=edit smartbutton=$a5_hammer ++City var=vCity event= type=edit smartbutton=$a5_hammer show=vZip > "" ++State var=vState event= type=edit smartbutton=$a5_hammer show=vZip > "" ++Zip Code var=vZip event=ZipCode Event_* type=edit smartbutton=$a5_hammer ^^Phone state=opened show_label= type=category ++Home var=vPhoneHome event=HomePhone type=edit smartbutton=$a5_hammer ++Work var=vPhoneWork event=WorkPhone type=edit smartbutton=$a5_hammer ++Mobil var=vPhoneMobile event=MobilePhone type=edit smartbutton=$a5_hammer ++Fax var=vPhoneFax event=FaxPhone type=edit smartbutton=$a5_hammer ^^Email state=opened show_label= type=category ++Email var=vEmail1 event= type=edit smartbutton=$a5_hammer help=Enter Email address ++Email1 var=vEmail2 event= type=edit smartbutton=$a5_hammer help=Enter Second Email address %str% ok_button_label = "&OK" cancel_button_label = "&Cancel" Delete XdialogStyle dim XDialogStyle as p XDialogStyle.AccentColor = "White" XDialogStyle.Color = "#253+236+180" varC_result = ui_dlg_box("MDC Prospect System",<<%dlg% {Windowstyle=Gradient Horizontal Top} {region} {Region} ; {Endregion}; {Region} Enter prospect information below:; {propgrid=100,35ps1}; {Endregion}; {Region} ; {Endregion}; {line=1,0}; <*15=ok_button_label!OK> <15=cancel_button_label!CANCEL>; {endregion}; %dlg%,<<%code% if a_dlg_button = "MobilePhone" then 'Change event xbasic vPhoneMobile = TRANSFORM(vPhoneMobile,"@R (999) 999-9999") else if a_dlg_button = "WorkPhone" then 'Change event xbasic vPhoneWork = TRANSFORM(vPhoneWork,"@R (999) 999-9999") else if a_dlg_button = "ZipCode Event_change" then ' Change event code. ' Keydown event code. if vZip > "" dim tbl as p tbl = table.open("zipcode") tbl.index_primary_put("Zip") tbl.fetch_find(vZip) vCity = tbl.City vState = tbl.State tbl.close() end if else if a_dlg_button = "ZipCode Event_killfocus" then ' Killfocus event code. dim tbl as p tbl = table.open("zipcode") tbl.index_primary_put("Zip") tbl.fetch_find(vZip) vCity = tbl.City vState = tbl.State tbl.close() else if a_dlg_button = "Text Event" then ' Change event code. vLastname = w_upper(vLastname) vFirstname = w_upper(vFirstname) vSpouse = w_upper(vSpouse) vAddress_1 = w_upper(vAddress_1) vAddress_2 = w_upper(vAddress_2) vSuffix = w_upper(vSuffix) else if a_dlg_button = "FaxPhone" then ' Change event code. vPhoneFax = TRANSFORM(vPhoneFax,"@R (999) 999-9999") else if a_dlg_button = "HomePhone" then ' Change event code. vPhoneHome = TRANSFORM(vPhoneHome,"@R (999) 999-9999") end if %code%)
Comment