掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
文字列に「&」を代入して表示するとアンダーラインになるのを回避するには? (ID:36161)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
すでに解決済みですが・・・ ShowMessageも内部で的にMessageDlgを呼んでいるだけなので、MessageDlgを解決してみることに。 function MessageDlgNoAccelChar(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): Integer; var msgCtrl :TComponent; begin with CreateMessageDialog(Msg, DlgType, Buttons) do try msgCtrl := FindComponent('Message'); if (msgCtrl <> nil) and (msgCtrl is TLabel) then begin TLabel(msgCtrl).ShowAccelChar := False; end; Position := poScreenCenter; Result := ShowModal; finally Free; end; end; procedure ShowMessageNoAccelChar(const Msg: string); begin MessageDlgNoAccelChar(Msg, mtCustom, [mbOK]); end; 使い方は以下の通り var s:String; begin s := 'www.example.com?a=aaa&b=bbb'; MessageDlgNoAccelChar(s, mtConfirmation, [mbOk]); ShowMessageNoAccelChar(S); end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.