This might be a trifle late, but here's a snippet that makes cancel the
default button:

function MessageDlgWithCancelFocussed( Msg : string ; DlgType : TMsgDlgType;
Buttons : TMsgDlgButtons; HelpCtx : Longint ) : Word;
begin
  with CreateMessageDialog(Msg, DlgType, Buttons) do
    try
      HelpContext := HelpCtx;
      HelpFile := '';
      Position := poScreenCenter;
      if FindComponent('Cancel') <> nil then
       ActiveControl := (FindComponent('Cancel') as TWinControl);
      if FindComponent('No') <> nil then
       ActiveControl := (FindComponent('No') as TWinControl);
      Result := ShowModal;
    finally
      Free;
    end;
end;

HTH,
Deepak Shenoy
Agni Software
http://www.agnisoft.com

----- Original Message -----
From: "Jeremy Coulter" <[EMAIL PROTECTED]>
To: "Multiple recipients of list delphi" <[EMAIL PROTECTED]>
Sent: Wednesday, March 28, 2001 12:48 AM
Subject: [DUG]: Deafult Button


> Hi all. I am SURE this has been asked before, BUT, is there away to set
the
> default button in a messagedlg ? or am I better to write my own and do it
> that way?
>
> Cheers, Jereym Coulter
>

---------------------------------------------------------------------------
    New Zealand Delphi Users group - Delphi List - [EMAIL PROTECTED]
                  Website: http://www.delphi.org.nz
To UnSub, send email to: [EMAIL PROTECTED] 
with body of "unsubscribe delphi"

Reply via email to