AxWebBrowser身体背景 [英] AxWebBrowser body background

查看:61
本文介绍了AxWebBrowser身体背景的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以帮助我


我正在开发一个仅在PC(客户端)上运行的应用程序。对于图形化的原因,我们决定将内容显示在浏览器中,即

嵌入在Windows窗体应用程序中(VS net 2003)c#


我有一个使用webbrowser(AxWebBrowser)的Windows窗体来显示从内部类派生的
html,这些内部类是从数据库构建数据的。

HTML正确显示。 HTML是在运行时构建的,图像是本地存储在c:驱动器上的



我遇到的问题是使用正文显示背景JPG背景

标签。

例如

< body background =''C:\ DOCUME~1 \ user \ LOCALS~ 1'\\Temp\SalesBa ckGround.jpg''>


i也试过了


< body

background =''file:/// C:\ DOCUME~1 \ user\LOCALS~1\Temp\SalesBackGround.jpg;


''leftmargin =''0''marginheight =''0''marginwidth =''0''");


i也尝试将图像复制到可执行文件的路径


< body background =''SalesBackGround.jpg''leftmargin =''0''marginheight =''0''

marginwidth =''0 ''


Evthing在此声明后显示核心但身体背景


如果我复制t运行后的HTML到新文件(比如在首页)和

预览html它完美运行


任何人都可以帮助我


谢谢


Richard

解决方案

嗨理查德,

< body background =''SalesBackGround.jpg''leftmargin =''0''marginheight =''0''
marginwidth =''0 ''

此声明之后的Eveything显示核心但身体背景

如果我将运行后的HTML复制到新文件(比如在首页)和
预览html工作得很好




你能用IE预览那个HTML文件吗?


再见

Rob


是的,我可以,一旦它被保存为html

" Robert Jordan" < RO ***** @ gmx.net>在消息中写道

news:cj ************* @ news.t-online.com ...

嗨理查德,

< body background =''SalesBackGround.jpg''leftmargin =''0''marginheight =''0''
marginwidth =''0''

此声明之后的Eveything显示核心但身体背景

如果我将运行后的HTML复制到新文件(比如在首页)并
预览html它的工作原理完美



你能用IE预览那个HTML文件吗?
再见
Rob



我也经历了DOM并访问了body.background,这是

在运行时空白


我设法欺骗了WebBrowser通过导航

来加载背景


a html文件有背景图片,然后我将动态html加载到

DOM的内部HTML

我或者但是,原始计划是将我的所有图像作为嵌入资源并且

加载背景


,具体取决于运行时的方法,只需将HTML加载到DOM的'

innerHTML,我想避免导航到一个html文件


因为这会加载滚动条而我的应用程序不会调用滚动< br $> b $ b吧


这是一个错误还是我错过了一些东西

" Richard Steele" < RI ************ @ megwich.com>在消息中写道

新闻:OA ************** @ tk2msftngp13.phx.gbl ...

是的,我可以,一次它被保存为html

" Robert Jordan" < RO ***** @ gmx.net>在消息中写道
新闻:cj ************* @ news.t-online.com ...

嗨理查德,
< blockquote class =post_quotes>< body background =''SalesBackGround.jpg''leftmargin =''0''marginheight =''0''
marginwidth =''0''

如果我将运行后的HTML复制到新文件(比如在首页)并且
预览html它完美地运行


你能用IE预览那个HTML文件吗?
再见
Rob




Can anyone help me

I am developing an application runs on a PC (client) only. For graphical
reasons it was decided that the content would be displayed in a Browser that
is embedded in a Windows Forms application (VS net 2003) c#

I have a Windows Form that uses a webbrowser (AxWebBrowser) )to display
html derived from internal classes that builds data from a database. The
HTML displays correctly. The HTML is built at runtime and the images are
stored locally on the c: drive

The issue i am having is displaying a background JPG using a body background
tag.
for example
<body background=''C:\DOCUME~1\user\LOCALS~1\Temp\SalesBa ckGround.jpg''>

i have also tried

<body
background=''file:///C:\DOCUME~1\user\LOCALS~1\Temp\SalesBackGround.jpg ;

'' leftmargin=''0'' marginheight=''0'' marginwidth=''0''");

i have also tried copying the image to the executable''s path

<body background=''SalesBackGround.jpg''leftmargin=''0'' marginheight=''0''
marginwidth=''0''

Eveything after this statement displays corectly but the body background

if i copy the HTML after runtime to a new file (say in frontpage) and
preview the html it works perfectly

Can anybody help me

Thank You

Richard


解决方案

Hi Richard,

<body background=''SalesBackGround.jpg''leftmargin=''0'' marginheight=''0''
marginwidth=''0''

Eveything after this statement displays corectly but the body background

if i copy the HTML after runtime to a new file (say in frontpage) and
preview the html it works perfectly



Can you preview that HTML file with IE?

bye
Rob


Yes i can, once it has been saved as html
"Robert Jordan" <ro*****@gmx.net> wrote in message
news:cj*************@news.t-online.com...

Hi Richard,

<body background=''SalesBackGround.jpg''leftmargin=''0'' marginheight=''0''
marginwidth=''0''

Eveything after this statement displays corectly but the body background

if i copy the HTML after runtime to a new file (say in frontpage) and
preview the html it works perfectly



Can you preview that HTML file with IE?

bye
Rob



I have also gone through the DOM and accessed the body.background, this is
blank at runtime

I have managed to trick the WebBrowser to load the background by navigating
to

a html file that has the background image, then i load the dynamic html into
the DOM''s innerHTML

my original plan though, was to have all my images as a embeded resource and
load the background

depending on the method at runtime ans simply load the HTML into the DOM''s
innerHTML , i wanted to avoid navigating to a html file

as this loads the scrollbars and my application does not call for scroll
bars

Is this a bug or am i missing something
"Richard Steele" <ri************@megwich.com> wrote in message
news:OA**************@tk2msftngp13.phx.gbl...

Yes i can, once it has been saved as html
"Robert Jordan" <ro*****@gmx.net> wrote in message
news:cj*************@news.t-online.com...

Hi Richard,

<body background=''SalesBackGround.jpg''leftmargin=''0'' marginheight=''0''
marginwidth=''0''

Eveything after this statement displays corectly but the body background

if i copy the HTML after runtime to a new file (say in frontpage) and
preview the html it works perfectly



Can you preview that HTML file with IE?

bye
Rob




这篇关于AxWebBrowser身体背景的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆