掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
MassageDlgのcaptionを変更するには? (ID:9126)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
> 無理じゃないけど面倒。 こんな感じです。 type TForm1 = class(TForm) Button1: TButton; procedure Button1Click(Sender: TObject); private { Private 宣言 } public procedure WMApp(var Msg:TMessage);message WM_APP; end; var Form1: TForm1; implementation {$R *.DFM} procedure TForm1.Button1Click(Sender: TObject); begin PostMessage(Handle,WM_APP,0,0); if MessageDlg('mbYes のキャプションを「うん」に変えたよ', mtConfirmation, [mbYes, mbNo], 0) = mrYes then ShowMessage('「うん」を選んだね'); end; procedure TForm1.WMApp(var Msg: TMessage); var Form:TForm; YesButton:TButton; i:integer; begin YesButton := nil; Form := Screen.ActiveForm; for i := 0 to Form.ControlCount-1 do if Form.Controls[i] is TButton then if TButton(Form.Controls[i]).Caption = 'はい(&Y)' then YesButton := TButton(Form.Controls[i]); if Assigned(YesButton) then YesButton.Caption := 'うん(&U)'; end;
←解決時は質問者本人がここをチェックしてください。
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.