掲示板システム
ホーム
アクセス解析
カテゴリ
ログアウト
WebBrowserで表示中の画面の文字列検索は? (ID:18628)
名前
ホームページ(ブログ、Twitterなど)のURL (省略可)
本文
あっあと、テストだけなら こっちの方が無難です。 procedure WBLocateHighlight(WB: TWebBrowser; Text: string) ; const prefix = '<span style="color:white; background-color: blue;">'; suffix = '</span>'; var tr: IHTMLTxtRange; begin if Assigned(WB.Document) then begin tr := ((wb.Document AS IHTMLDocument2).body AS IHTMLBodyElement).createTextRange; if tr.findText(Text, 1, 0) = True then begin tr.pasteHTML(prefix + tr.htmlText + suffix) ; tr.scrollIntoView(True) ; end; //while tr.findText(Text, 1, 0) do //begin // tr.pasteHTML(prefix + tr.htmlText + suffix) ; // tr.scrollIntoView(True) ; //end; end; end;
←解決時は質問者本人がここをチェックしてください。
更新する
戻る
掲示板システム
Copyright 2021 Takeshi Okamoto All Rights Reserved.