首页 > 学院 > 开发设计 > 正文

直接修改TWebBrowser显示内容

2019-11-18 18:14:57
字体:
来源:转载
供稿:网友

PRocedure TForm1.Button1Click(Sender: TObject);
begin 
  
Webbrowser1.Navigate('about:blank');
end;

procedure TForm1.Button2Click(Sender: TObject);
var
  
V: OleVariant;
begin 
  V := WebBrowser1.Document;
  s := '<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"></head><body>'+
       '<style type="text/CSS">' +
       'body {font-family: "宋体", "Times New Roman"; font-size: 12px;margin-left: 0px;margin-top: 0px;margin-right: 0px;margin-bottom: 0px;}' +
       '</style><b>Welcome!</b></body>';
  V.Script.Document.Body.InnerHTML := s;
end;


上一篇:应用程序中当前路径的两中写法、COM中当前路径取得

下一篇:注册快捷方式

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表
学习交流
热门图片

新闻热点

疑难解答

图片精选

网友关注