델파이 MessageDlg 한글쓰기
function DefMessageDlg(const aCaption: string;
const Msg: string;
DlgType: TMsgDlgType;
Buttons: TMsgDlgButtons;
DefButton: Integer;
HelpCtx: Longint): Integer;
var
i: Integer;
btn: TButton;
begin
with CreateMessageDialog(Msg, DlgType, Buttons) do
try
Caption := aCaption;
HelpContext := HelpCtx;
for i := 0 to ComponentCount - 1 do
begin
if Components[i] is TButton then
begin
btn := TButton(Components[i]);
if btn.name = 'Yes' then btn.Caption := '영어';
if btn.name = 'No' then btn.Caption := '수학';
btn.Default := btn.ModalResult = DefButton;
// 포커스를 변경해주고 싶으면..
// if btn.Default then
// ActiveControl := Btn;
end;
end; { For }
Result := ShowModal;
finally
Free;
end;
end;
procedure TForm1.Button1Click(Sender: TObject);
begin
if DefMessageDlg('선택창', '영어와 수학중 선택하세요.', mtConfirmation,
[mbYes,mbNo], mrno, 0) = mrYes
then
ShowMessage('영어를 선택하셨습니다.');
end;
댓글