WebBrowers控件如何去边框
WebBrowers加载html后就有个3D边框,如何能把它去掉。
[最优解释]
IDocHostUIHandler接口的GetHostInfo中处理,设置个DOCHOSTUIFLAG_NO3DBORDER标志即可。懒得实现的话,用个容器盖住,让webbrowser尺寸大于容器
[其他解释]
最简单的办法是把WebBrowser包在一个Picturebox里,比如:
Private Sub Form_Load()
Dim PicBox As PictureBox
Me.ScaleMode = vbPixels
Set PicBox = Me.Controls.Add("VB.PictureBox", "PicBox1")
PicBox.ScaleMode = vbPixels
PicBox.Appearance = 0
PicBox.BorderStyle = 0
PicBox.Move Me.WebBrowser1.Left, Me.WebBrowser1.Top, Me.WebBrowser1.Width, Me.WebBrowser1.Height
PicBox.Visible = True
Set Me.WebBrowser1.Container = PicBox
Me.WebBrowser1.Move -2, -2, Me.WebBrowser1.Width + 3, Me.WebBrowser1.Height + 3
Me.WebBrowser1.Navigate2 "http://www.baidu.com"
End Sub
[其他解释]