webbrowser control border

C

cdheresniak

Using VS 2005, load a very simple document using <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
results in a 3D border around the control at run time. Load the same
document using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"> and there is no 3D border. I am trying to eliminate
the 3D border. I have tried setting the <body> border style in the
document to overide this, but it has no affect when <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> is in place. Would anyone
know how to address this? Thanks.
 
H

Herfried K. Wagner [MVP]

Using VS 2005, load a very simple document using <!DOCTYPE HTML PUBLIC
"-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
results in a 3D border around the control at run time. Load the same
document using <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"> and there is no 3D border. I am trying to eliminate
the 3D border. I have tried setting the <body> border style in the
document to overide this, but it has no affect when <!DOCTYPE HTML
PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd"> is in place. Would anyone
know how to address this?

Did you already try '<body style="border: none">...</body>'?
 
C

Charles Law

Implement the IDocHostUIHandler interface in the parent form, and in
GetHostInfo() set

dwflags = DOCHOSTUIFLAG_NO3DBORDER

something like this

<code>
Public Function GetHostInfo(ByRef pInfo As DOCHOSTUIINFO) As HRESULT
Implements IDocHostUIHandler.GetHostInfo

With pInfo
.cbSize = Len(pInfo)

' Turn off 3D-border, and some other optional stuff
.dwFlags = DOCHOSTUIFLAG.DOCHOSTUIFLAG_DIV_BLOCKDEFAULT Or _
DOCHOSTUIFLAG.DOCHOSTUIFLAG_FLAT_SCROLLBAR Or _
DOCHOSTUIFLAG.DOCHOSTUIFLAG_NO3DBORDER

.dwDoubleClick = DOCHOSTUIDBLCLK.DOCHOSTUIDBLCLK_DEFAULT
.pchHostCss = 0
.pchHostNS = 0
End With

Return HRESULT.S_OK

End Function
</code>

You set your form as the UI handler by calling this function

<code>
Private Sub SetUIHandler()

'*********************************************************
' Get a handle to the ICustomDoc interface on the document
Dim icd As ICustomDoc

icd = DirectCast(WebBrowser1.Document.DomDocument, ICustomDoc)

icd.SetUIHandler(Me)
'*********************************************************

'*** Remember to wait for the readyState to go to "complete" before
returning ***

End Sub
</code>

HTH

Charles
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Setting Strict On 3
XHTML Strict - Is this right? 4
Doc Type in FrontPage Webs 1
html in vb 1
Unusual IE7 behaviour 4
Validating a page 1
Response.Write Problem 2
Style sheet question 2

Top