{
Jeder der mal TWebBrowser.SetFocus ausprobiert hat,
musste feststellen, dass der Fokus nicht auf das Webbrowser
Dokument (eine Webseite) setzt, sondern auf das Webbrowser Control,
was uns nicht gerade viel bringt.
Hier werden zwei Moglichkeiten beschrieben, wie man den Fokus auf
die "Webseite" (d.h Dokument des Webbrowser) setzen kann.
{
{
Anyone that has worked with TWebBrowser knows that the
TWebBrowser.SetFocus procedure doesn't set focus on the "web page",
but rather on the control itself, which doesn't do us a whole lot of good.
Here are two possibilities to set the focus on the "web page" (i.e.,
document):
}
uses
ActiveX;
begin
WebBrowser1.Navigate('irgendeinedatei.html');
with
WebBrowser1 do
if
Document <> nil
then
with
Application as
IOleobject do
DoVerb(OLEIVERB_UIACTIVATE, nil
,
WebBrowser1, 0, Handle,
GetClientRect);
end
;