Message Dialog Question

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #37962
    TAZ
    Participant

    I am using sCreateMessageDialog to show my message dialogs.

    I have attached snapshots of a confirmation message when you use sMessageDialog and sCreateMessageDialog. Notice the “Cancel” button for sCreateMessageDialog is red, not blue.

    Digging deeper I see that sCreateMessageDialog inherits from Dialogs – CreateMessageDialog while sMessageDialog inherits from sMessageDlgPosHelp.

    Here is my code for using sCreateMessageDialog which gives me a greater degree of control.

    What do I need to do to get the color scheme to agree with what is showing in sMessageDialog?

    Thanks.

    Code:
    function MsgDlg(const Msg: string; const DlgType: TMsgDlgType = mtInformation; const Buttons: TMsgDlgButtons = [mbOk]; const DefaultButton: TMsgDlgBtn = mbOk): integer;
    var
    S: string;
    begin
    with sCreateMessageDialog(Msg, DlgType, Buttons, DefaultButton) do
    begin
    case DlgType of
    TMsgDlgType.mtWarning:
    S := 'Warning Notification';
    TMsgDlgType.mtError:
    S := 'Error Notification';
    TMsgDlgType.mtInformation:
    S := 'Information Notification';
    TMsgDlgType.mtConfirmation:
    S := 'Confirmation Notification';
    end;
    Caption := S;
    BorderStyle := bsDialog;
    BorderIcons := [];
    Position := poOwnerFormCenter;
    Result := ShowModal;
    end;
    end;
    #58457
    Support
    Keymaster

    I will improve it in the nearest release.

    #58484
    TAZ
    Participant

    Excellent. It works. Thanks.

    'Support' wrote:

    I will improve it in the nearest release.

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.