delphi嵌套一个webbrowser 如何去掉它的边框
展开全部
//去除顷帆睁轿察边框,雀岁滚动条
procedure WB_Set3DBorderStyle(Sender: TObject; bValue: Boolean);
var
Document : IHTMLDocument2;
Element : IHTMLElement;
StrBorderStyle: string;
begintry
Document := TWebBrowser(Sender).Document as IHTMLDocument2;
TWebBrowser(Sender).OleObject.Document.Body.Scroll := 'no';//去除滚动条
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;
procedure WB_Set3DBorderStyle(Sender: TObject; bValue: Boolean);
var
Document : IHTMLDocument2;
Element : IHTMLElement;
StrBorderStyle: string;
begintry
Document := TWebBrowser(Sender).Document as IHTMLDocument2;
TWebBrowser(Sender).OleObject.Document.Body.Scroll := 'no';//去除滚动条
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;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询