silverlight内嵌HTML内容和HTML页面
来源:互联网 发布:微信数据精灵授权码 编辑:程序博客网 时间:2024/05/22 13:24
欢迎转载!注明为 CSDN我一直在寻找原创
我看到网上有许多朋友在silverlight嵌入html都没有实现,我2年前就搞定了,以为SL4.0会出来就没有放出来,但发现SL5.0bata版也要在安装成脱离浏览器才能用,我实在看不下去了,只好把我的压箱底的东西拿出来了
因为CSDN不能传附件,但是可以传图片,我把源代码用rar压缩后把后缀名改为.gif了,需要的下载下来后把后缀改为.rar然后解压就行了,我用的是VS2010的SL4做的,因为我比较老土了用了13年VB了,程序就用VB.net 做的,学C#的朋友就撮合看把。 用网际快车或者迅雷下载后面的网址吧(http://hi.csdn.net/attachment/201105/27/0_1306507975155E.gif )
也可以看一下代码:
Imports System.Windows.Browser
Partial Public Class MainPage
Inherits UserControl
Public Sub New()
InitializeComponent()
End Sub
Public Div As System.Windows.Browser.HtmlElement
Public Iframe As System.Windows.Browser.HtmlElement
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles Button1.Click
Div = HtmlPage.Document.CreateElement("div")
Dim Form1 As System.Windows.Browser.HtmlElement
Form1 = HtmlPage.Document.GetElementById("form1")
If Form1 Is Nothing Then
MessageBox.Show("依托网页没有元素""form1""不能进行!!")
Return
End If
Form1.AppendChild(Div)
Div.SetStyleAttribute("ID", "EmbeddedBrowser1")
Div.SetStyleAttribute("position", "absolute")
Div.SetStyleAttribute("top", "100px")
Div.SetStyleAttribute("left", "100px")
Div.SetStyleAttribute("width", "1000px")
Div.SetStyleAttribute("height", "1000px")
Iframe = HtmlPage.Document.CreateElement("iframe")
Div.AppendChild(Iframe)
Iframe.SetAttribute("ID", "EmbeddedBrowserIframe1")
Iframe.SetStyleAttribute("top", "0px")
Iframe.SetStyleAttribute("left", "0px")
Iframe.SetStyleAttribute("width", "1000px")
Iframe.SetStyleAttribute("height", "1000px")
Iframe.SetAttribute("src", "http://www.sina.com")
End Sub
End Class
欢迎转载!注明为 CSDN我一直在寻找原创
- silverlight内嵌HTML内容和HTML页面
- Flex内嵌html页面
- html页面内嵌mp3
- html页面内跳转
- SilverLight浏览器交互之:Html页面通过Javascript调用SilverLight程序内方法(附源码)
- 利用webBrowser获取框架内Html页面内容
- 利用webBrowser获取框架内Html页面内容
- 利用webBrowser获取框架内Html页面内容
- C# webBrowser 获取框架内Html页面内容
- Silverlight 和html 交互
- 获取html页面内容
- HTML页面内容
- html页面内嵌 视频代码
- 动态生成Html页面内容
- html内容页面音频代码
- python爬取贴吧HTML页面内容
- 浅谈Silverlight页面显示Html问题
- SilverLight 操作HTML元素 和HTML元素操作SilverLight对象
- 在同一个tomcat中,配置两个端口进行提供服务
- Resque a background job ruby system
- Sql server 和 excel 表格的数据交互
- C++中 Debug Assertion Failed! 代码调试
- 开始写技术博客了
- silverlight内嵌HTML内容和HTML页面
- Nagios - The Industry Standard In IT Infrastructure Monitoring
- JavaMail 搜索指定邮件示例
- 选择承受.......
- 内存的分配和回收
- S3C2440驱动简析——I2C驱动(2)
- 在同一个tomcat中,配置两个端口进行提供服务
- 《一》基础知识
- 从零开始 一步一步 编写 Bootloader