procedure WB_Set3DBorderStyle(Sender: TObject; bValue: Boolean);
var
Document : IHTMLDocument2;
Element : IHTMLElement;
StrBorderStyle: string;
begin
//去掉边框
try
Document := TWebBrowser(Sender).Document as IHTMLDocument2;
if Assigned(Document) then
begin
Element := Document.Body;
if Element <> nil then
begin
case BValue of
False: StrBorderStyle := 'none';
True: StrBorderStyle := '';
end;
Element.Style.BorderStyle := StrBorderStyle;
end;
end;
except
//..
end;
end;
procedure TFrmWebBrowser.WebBrowser1DocumentComplete(Sender: TObject;
const pDisp: IDispatch; var URL: OleVariant);
begin
WB_Set3DBorderStyle(Sender,false);
end;