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;