trapping the previous ActiveControl after the OnExit event fires

From: NewGuy (NewGuy_at_NewGuy.com)
Date: 10/24/03


Date: Fri, 24 Oct 2003 09:04:13 -0400

For openers, I have inherited this code and have limited leeway in what I am
permitted to change.

I have a child form that has an TdbEdit box where the user enters initials.
The Initials are validated when leaving the edit box by use of the TQuery's
Field OnValidate event. This design was in place and is on hundreds of
forms.

I am working on the parent of this form and have added additional checks and
verifications that are common to all the child forms. In a nut shell, if
certain verifications fail, I want to land them back on the TdbEdit box to
correct it (or else close the form since they may not be authorized to
proceed). I can easily handle the form closure at the ancestor but I am
having trouble finding a way to return to the Edit box. The edit box has
different names and locations on the various child forms (probably 100).

I vaguely remember setting the focus to the 'previous control' in a project
I did years ago but can't seem to come up with the logic. Since I am
intent to do this on the parent form (not where the TDBEdit box resides), I
can come up with no way to issue a Set Focus to the Control that had focus
prior to the Exit event firing.

Appreciate any help.
Larry Killen



Relevant Pages

  • Re: ENTER key problem in edit box
    ... control=1 to solve the tab order prob between main dlg and child dlg). ... What control style value are you talking about? ... Putting the edit control in a child dialog seems a bit complex unless there is some ...
    (microsoft.public.vc.mfc)
  • Re: ENTER key problem in edit box
    ... control=1 to solve the tab order prob between main dlg and child dlg). ... if i set the control style value back to 0, now it is calling the OnOK ... Putting the edit control in a child dialog seems a bit complex unless there is some ...
    (microsoft.public.vc.mfc)
  • Re: ENTER key problem in edit box
    ... control=1 to solve the tab order prob between main dlg and child dlg). ... I have an edit boxand a list ... function of child dlg and the validation is perfect. ...
    (microsoft.public.vc.mfc)
  • Re: 2003 forest: accesing sysvol in child domain
    ... Are you trying to edit GPO's by editing files in the sysvol? ... member of Enterprise Admins. ... Notice that I can list and edit all files in \sysvol when using fqdn of a child DC, but not using fqdn of the child domain itself though it is pingable. ...
    (microsoft.public.windows.server.active_directory)
  • Re: getWindowText in Child Dialog
    ... >> to save text located in an Edit Control on a Child Dialog. ... > You cannot call GetWindowText() unless a window has been created. ... > utilize the string variables in the parent function, ...
    (microsoft.public.vc.mfc)