'参考学习来源:WEBBROWSER控件去边框 http://bbs.csdn.net/topics/310013215Private Sub Form_Load()
WebHtml WebBrowser1, "<a href='http://www.163.com' target='_blank'>网易首页</a>", True
End Sub
'┏〓〓〓〓〓〓〓〓〓 WebHtml,start 〓〓〓〓〓〓〓〓〓┓
'[简介]:
'把字符串显示在网页上,不保存到文件的方式
Sub WebHtml(Web1 As WebBrowser, html As String, Optional NoScroll As Boolean, Optional WaitMax As Long = 20000)
'[mycode_id:1336],edittime:2012/3/20 23:46:08
' On Error Resume Next
Web1.Silent = True
Web1.Navigate "about:blank"
DoEvents
Web1.Document.open
Web1.Document.write html
DoEvents
Web1.Stop
Web1.Document.Close
If NoScroll Then Web1.Document.body.Scroll = "No"
Web1.Document.body.Style.border = "0px"
Web1.Document.body.Style.overflow = "hidden"
'Web1.Document.body.Style.margain = "0px"
'Web1.Document.body.Style.padding = "0px"
End Sub
'┗〓〓〓〓〓〓〓〓〓 WebHtml,end 〓〓〓〓〓〓〓〓〓┛
WebHtml WebBrowser1, "<a href='http://www.163.com' target='_blank'>网易首页</a>", True
End Sub
'┏〓〓〓〓〓〓〓〓〓 WebHtml,start 〓〓〓〓〓〓〓〓〓┓
'[简介]:
'把字符串显示在网页上,不保存到文件的方式
Sub WebHtml(Web1 As WebBrowser, html As String, Optional NoScroll As Boolean, Optional WaitMax As Long = 20000)
'[mycode_id:1336],edittime:2012/3/20 23:46:08
' On Error Resume Next
Web1.Silent = True
Web1.Navigate "about:blank"
DoEvents
Web1.Document.open
Web1.Document.write html
DoEvents
Web1.Stop
Web1.Document.Close
If NoScroll Then Web1.Document.body.Scroll = "No"
Web1.Document.body.Style.border = "0px"
Web1.Document.body.Style.overflow = "hidden"
'Web1.Document.body.Style.margain = "0px"
'Web1.Document.body.Style.padding = "0px"
End Sub
'┗〓〓〓〓〓〓〓〓〓 WebHtml,end 〓〓〓〓〓〓〓〓〓┛
WebHtml WebBrowser1, "<a href='http://www.163.com' target='_blank'>网易首页</a>", True
End Sub
'┏〓〓〓〓〓〓〓〓〓 WebHtml,start 〓〓〓〓〓〓〓〓〓┓
'[简介]:
'把字符串显示在网页上,不保存到文件的方式
Sub WebHtml(Web1 As WebBrowser, html As String, Optional NoScroll As Boolean, Optional WaitMax As Long = 20000)
'[mycode_id:1336],edittime:2012/3/20 23:46:08
' On Error Resume Next
Web1.Silent = True
Web1.Navigate "about:blank"
DoEvents
Web1.Document.open
Web1.Document.write html
DoEvents
Web1.Stop
Web1.Document.Close
If NoScroll Then Web1.Document.body.Scroll = "No"
Web1.Document.body.Style.border = "0px"
Web1.Document.body.Style.overflow = "hidden"
'Web1.Document.body.Style.margain = "0px"
'Web1.Document.body.Style.padding = "0px"
End Sub
'┗〓〓〓〓〓〓〓〓〓 WebHtml,end 〓〓〓〓〓〓〓〓〓┛