I have a program where the user can re-access some textboxes with the view of editing them. I have no trouble giving the textbox(s) the focus or in saving the edited text but would like the user to be able to use overwrite rather than delete and insert to accomplish the edit.
I know that there are many examples of using overwrite in a textbox in these forums but none appear to be simple code examples where the program automatically goes to overwrite when placed in edit mode.
Following is the code I use to reverse from textbox to textbox which is really like <SHIFT+TAB> except that it eliminates the chance of completely deleting the contents of the textbox. This code is triggered by a hotkey.
Can anyone help me out of this jam. Thanks
I know that there are many examples of using overwrite in a textbox in these forums but none appear to be simple code examples where the program automatically goes to overwrite when placed in edit mode.
Following is the code I use to reverse from textbox to textbox which is really like <SHIFT+TAB> except that it eliminates the chance of completely deleting the contents of the textbox. This code is triggered by a hotkey.
Code:
SUB GoBack() LOCAL Txt$ SELECT CASE TRIM$(Info.ContNo) 'the selects act as equiv. to shift+tab CASE "1","3" SELECT CASE GetFocus CASE GetDlgItem( hDlg17& ,3108) 'call to brno CONTROL SET FOCUS hDlg17& ,1137 CASE GetDlgItem( hDlg17& ,1137) 'brno to exch CONTROL SET FOCUS hDlg17& ,3109 CASE GetDlgItem( hDlg17& ,3109) 'exch to call CONTROL SET FOCUS hDlg17& ,3108 END SELECT CASE "2" SELECT CASE GetFocus CASE GetDlgItem( hDlg17& ,1138) 'name to brno CONTROL SET FOCUS hDlg17& ,1137 CASE GetDlgItem( hDlg17& ,1137) 'brno to exch CONTROL SET FOCUS hDlg17& ,3109 CASE GetDlgItem( hDlg17& ,3109) 'exch to call CONTROL SET FOCUS hDlg17& ,3108 CASE GetDlgItem( hDlg17& ,3108) 'call to name CONTROL SET FOCUS hDlg17& ,1138 END SELECT CASE ELSE '4 to 12 SELECT CASE GetFocus CASE GetDlgItem( hDlg17& ,3109) 'exch to call CONTROL SET FOCUS hDlg17& ,3108 CASE GetDlgItem( hDlg17& ,3108) 'call to exch CONTROL SET FOCUS hDlg17& ,3109 END SELECT END SELECT CONTROL GET TEXT hDlg17&, 3108 TO Txt$ 'callsign (this block saves the edits) HS.CSign = Txt$ '(to the hs. type/end type) CONTROL GET TEXT hDlg17&, 3109 TO Txt$ 'exchrec HS.ExchRec = Txt$ CONTROL GET TEXT hDlg17&, 1137 TO Txt$ 'branchno HS.BrNoRec = Txt$ CONTROL GET TEXT hDlg17&, 1138 TO Txt$ 'name HS.NameRec = Txt$ END SUB

Comment