Subject Re: [IBO] IBD_Login question
Author Helen Borrie
At 12:16 PM 22/04/2003 +1000, you wrote:
>The default login dialog, IBD_Login has some nice settings which are set in
>the IB_Connection component.
>It returns, however, a mrCancel result from the cancel button, and no way to
>catch this at the login attemtps.
>there is an Onlogin event and a failure event.. but no cancel event.
>I suppose I just have to edit the source of the login.pas? There isn't
>another way is there?
>I just want to application.terminate on cancel...

Use the BeforeConnect event and read the LoginAborted property. This is a
variable which is set in a variable parameter of the OnLogin event.

procedure TdmMyDm.cn1BeforeConnect(Sender: TIB_Connection);
begin
if LoginAborted then
begin
ShowMessage('Login cancelled"); // only if you want to give feedback
Sysutils.Abort;
end
else
inherited;
end;

Helen