Einzelnen Beitrag anzeigen

Benutzerbild von toms
toms
(CodeLib-Manager)

Registriert seit: 10. Jun 2002
4.648 Beiträge
 
Delphi XE Professional
 
#2

Re: Im Webbrowser mit Tab navigieren

  Alt 25. Mär 2009, 04:10
Hallo

Setze den Focus zuvor auf den Body des Documents:

Delphi-Quellcode:
uses
  MSHTML;

procedure SetFocusToBody(Webbrowser: TWebbrowser);
var
  bodyElement: IHTMLElement2;
  HTMLDoc2: IHTMLDocument2;
begin
  if Supports(Webbrowser.Document, IHtmlDocument2, HTMLDoc2) then
  begin
    bodyElement := HTMLDoc2.body as IHTMLElement2;
    if Assigned(bodyElement) then
      bodyElement.focus;
  end;
end;
Thomas
  Mit Zitat antworten Zitat