Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/321.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何消除网络浏览器闪烁?_C#_Html_Background_Browser_Flicker - Fatal编程技术网

C# 如何消除网络浏览器闪烁?

C# 如何消除网络浏览器闪烁?,c#,html,background,browser,flicker,C#,Html,Background,Browser,Flicker,我正在聊天应用程序中使用WebBrowser控件。每次添加用户消息时,它都会用新内容刷新WebBrowser。而且效果很好。 但当我在html代码中添加了一个背景后,它开始在每次刷新时闪烁。 下面是我的Navigate()方法: 这是我的html文件头: addText("<html>\r\n<head>\r\n<meta charset=utf-8>\r\n</head>\r\n<body %bg% bgproperties=\"fixed

我正在聊天应用程序中使用WebBrowser控件。每次添加用户消息时,它都会用新内容刷新WebBrowser。而且效果很好。 但当我在html代码中添加了一个背景后,它开始在每次刷新时闪烁。 下面是我的Navigate()方法:

这是我的html文件头:

addText("<html>\r\n<head>\r\n<meta charset=utf-8>\r\n</head>\r\n<body %bg% bgproperties=\"fixed\" onload=\"window.scrollTo(0,2147483647);\">\r\n<span style=\"line-height: 20px\" style=\"font-family: Arial; font-size: 14px\">\r\n<font color=black>", NewLine.No);
addText(“\r\n\r\n\r\n\r\n\r\n\r\n”,换行。否);
每次用户添加消息时,我的程序都会将其添加到html文件的末尾,并执行Navigate()方法


你有什么办法来删除闪烁吗?

不是每次都重新加载新文档,而是设置现有
文档的
InnerHTML

<meta http-equiv='Page-Exit' content='filter: expression(document.execCommand("BackgroundImageCache", false, true))'>

我的html代码,它不会闪烁。我不知道它是如何工作的(我不知道html),只是花了一些时间在谷歌上搜索解决方案

这很奇怪,因为我可以替换:
表达式(document.execCommand(“BackgroundImageCache”,false,true))

添加到任何其他内容,它仍然有效。

标记中添加以下两行

<meta http-equiv="Page-Enter" content="blendTrans(Duration=0)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0)">

它工作正常。

如果您指的是“webBrowser1.Document.Body.InnerHtml=text;”而不是“webBrowser1.DocumentText=text;”-它不会改变任何东西。加载时背景图像仍在闪烁。
<meta http-equiv="Page-Enter" content="blendTrans(Duration=0)">
<meta http-equiv="Page-Exit" content="blendTrans(Duration=0)">