MessageDlg editor uygulamasında bu şekilde yazılması gerektiğini gösteriyor.
Kod: Tümünü seç
MessageDlgEx('Dialog title', 'mesaj ?', mtWarning, ['Evet', 'Hayır'], [mrYes, mrNo], 0, dckScreen, 0, 0, 0);
sanırım hatayı Buttons: array of string; karsılık gelen ['Evet', 'Hayır'] dan dolayı veriyor
çünkü
Kod: Tümünü seç
MessageDlgEx('Dialog title', 'mesaj ?', mtWarning, GetCustomButtonNames, [mrYes, mrNo], 0, dckScreen, 0, 0, 0)
GetCustomButtonNames içeriğide bole
Kod: Tümünü seç
function TfrmMessageDlgEditor.GetCustomButtonNames: TDynStringArray;
var
J: Integer;
I: Integer;
S: string;
begin
SetLength(Result, mmCustomButtons.Lines.Count);
J := 0;
for I := 0 to mmCustomButtons.Lines.Count - 1 do
begin
if (Trim(mmCustomButtons.Lines[I]) <> '') then
begin
S := mmCustomButtons.Lines.Names[I];
if (Trim(mmCustomButtons.Lines.Values[S]) <> '') and (S = Trim(S)) then
begin
Result[J] := S;
Inc(J);
end;
end;
end;
SetLength(Result, J);
end;
yardım dosyasında formatıd böle
yardım lütfen Buttons: array of string; için ['Evet', 'Hayır'] yerine nasıl yazılmalıfunction MessageDlgEx(const Msg: string; const DlgType: TMsgDlgType; const Buttons: array of string; const Results: array of Integer; const HelpCtx: Longint; const Center: TDlgCenterKind = dckScreen; const Timeout: Integer = 0; const DefaultButton: Integer = 0; const CancelButton: Integer = 1; const HelpButton: Integer = -1; const ADynControlEngine: TJvDynControlEngine = nil): TModalResult; overload;
function MessageDlgEx(const Caption: string; const Msg: string; const DlgType: TMsgDlgType; const Buttons: array of string; const Results: array of Integer; const HelpCtx: Longint; const Center: TDlgCenterKind = dckScreen; const Timeout: Integer = 0; const DefaultButton: Integer = 0; const CancelButton: Integer = 1; const HelpButton: Integer = -1; const ADynControlEngine: TJvDynControlEngine = nil): TModalResult; overload;
function MessageDlgEx(const Caption: string; const Msg: string; const Picture: TGraphic; const Buttons: array of string; const Results: array of Integer; const HelpCtx: Longint; const Center: TDlgCenterKind = dckScreen; const Timeout: Integer = 0; const DefaultButton: Integer = 0; const CancelButton: Integer = 1; const HelpButton: Integer = -1; const ADynControlEngine: TJvDynControlEngine = nil): TModalResult; overload;