用代码更换WebBrowser的背景图片。(100)

  • 主题发起人 linuxping
  • 开始时间
L

linuxping

Unregistered / Unconfirmed
GUEST, unregistred user!
也就是设置<body background="">.....</body> background的属性值。而且必须使用MSHtml接口。下面是我的代码,但是有问题.var vbg:OleVariant; bg,tobg:string; accept:Boolean; I:Integer; disp:IDispatch; img:IHTMLImgElement; body:IHTMLBodyElement;begin //parse backgroud attrbute disp:=FDoc2.body; if not FAILED(disp.QueryInterface(IID_IHTMLBodyElement,body)) then begin bg:=body.background; if (bg<>'') and Assigned(FOnParse) then begin accept:=False; FOnParse(Self ,bg,tobg,accept); if accept then body.background:=tobg; end; end;end以上代码中body.background始终为空串,我不知道错在哪里。
 
顶部