Board index » delphi » OnExit calling ShowModal

OnExit calling ShowModal

I have a component on a form that calls another form with its OnExit
event.  When the called form closes, the cursor is gone from the
calling form.

Code looks something like this:

   if CustomerNoEdit.Text<>'' then
   begin
       NotesForm.ShowModal;
       CustomerForm.ActiveControl:=ShipToNoEdit;
   end;

The last line is an attempt to restore the cursor in the next
component.   Could the problem be the fact that I'm calling the other
form from the exit event of the control?  All I really want is a
window to open when the user exits the customer number.  When they
close that window, the cursor should be in the next component.

 

Re:OnExit calling ShowModal


Quote
bviv...@primenet.com (Brian Vivian) wrote:
>I have a component on a form that calls another form with its OnExit
>event.  When the called form closes, the cursor is gone from the
>calling form.
>Code looks something like this:
>   if CustomerNoEdit.Text<>'' then
>   begin
>       NotesForm.ShowModal;
>       CustomerForm.ActiveControl:=ShipToNoEdit;
>   end;
>The last line is an attempt to restore the cursor in the next
>component.   Could the problem be the fact that I'm calling the other
>form from the exit event of the control?  All I really want is a
>window to open when the user exits the customer number.  When they
>close that window, the cursor should be in the next component.

I think I narrowed it down.  If you call any message window (even
ShowMessage) the focus is gone from the next control.   HELP!  I need
the cursor back.

Other Threads