有什么方法可以加载HTML字符串(string_包含HTML代码直接到Web浏览器? [英] s there any way I can load a HTML string (string_ that contains HTML code directly into the Web Browser?

查看:451
本文介绍了有什么方法可以加载HTML字符串(string_包含HTML代码直接到Web浏览器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我有什么方法可以加载
mstrHTML 
字符串(字符串_包含HTML代码直接进入Web浏览器?我正在使用silverlight 4.0

Is there any way I can load a mstrHTML string (string_ that contains HTML code directly into the Web Browser? I'm using silverlight 4.0

Dim  mstrHTML as Sting =<html><head> testing</head> </html>



我正在尝试这样但得到编译错误。

I'm trying like this but getting compile error.

Dim urlStr As String = String.Format("window.open('{0}', '{1}', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=1,resizable=1,width=800,height=1200,left=50,top=50')",mstrHTML, "MyWindow")

System.Windows.Browser.HtmlPage.Window.Eval(urlStr)







推荐答案

嗨shilpi,

Hi shilpi,

>>有什么办法我可以直接加载HTML字符串...... Web浏览器?

>>there any way I can load a HTML string...directly into the Web Browser?

此论坛正在讨论并询问有关Windows窗体的问题,因此您提到的Web浏览器是Winform中的控件?如果因此,您可以直接使用以下代码显示HTML:

This forum is discussing and asking questions about the Windows Form, so the Web Browser you mentioned is the control in the Winform? If so, you can display the HTML with the following code directly:

private void Form3_Load(object sender, EventArgs e)
{
      webBrowser1.DocumentText = "<html><head> testing</head> </html>";
}   

如果不是,请告诉我您想如何显示HTML。

If no, please let me know how do you want to show the HTML.

>>我正在尝试这样但收到编译错误。

>>I'm trying like this but getting compile error.

你得到了什么错误?请提供有关此错误消息的更多详细信息。

What error did you get? Please provide more details about this error message.

最好的问候,

Stanly


这篇关于有什么方法可以加载HTML字符串(string_包含HTML代码直接到Web浏览器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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