Board index » delphi » ShowModal problem

ShowModal problem

I am using Delphi 1.

When using SHOW for a form that pops up when invalid
data was corrected, I do not experience any problems
when I close it.  When I use ShowModal however, you
have to <shift-TAB> to get the MaskEdit box active
again.

Why is this?  Can the problem be solved.  Any sggestions
and or solutions are welcomed...

Thanking you all in advance
--

__________
Studebaker

 

Re:ShowModal problem


Studebaker schrieb in Nachricht <01be2038$7a3b0be0$b2401fc4@lexlines>...
Quote
>I am using Delphi 1.

>When using SHOW for a form that pops up when invalid
>data was corrected, I do not experience any problems
>when I close it.  When I use ShowModal however, you
>have to <shift-TAB> to get the MaskEdit box active
>again.

>Why is this?  Can the problem be solved.  Any sggestions
>and or solutions are welcomed...

>Thanking you all in advance
>--

>__________
>Studebaker

If I really got you the problem is loosing the focus after closing the form?
Is it, because you're using a button to close the window?
By pressing the button the MaskEdit looses the focus and next time you open
the window
he still got the focus.
In this case it would help you to use the OnShow event and this code in
there:
procedure YourForm.FormShow(Sender: TObject);
begin
       ActiveControl:=YourMaskEdit;
end;

Hth,
Matthias.

Re:ShowModal problem


Showing the form modal will set the active focus to the form.  In the modal
form's FormShow procedure use the following :

Maskedit.Setfocus;

Where MaskEdit is whatever you called your mask edit box.

Regards

Neil Palfreyman

Other Threads