Working with the document object model

Working with the document object model

Welcome to my first VB tutorial. VB as powerful as it is , has yet amazed me again. This time with the DHTML edit control. In this tutorial i will show you how to add a dropshadow effect to your vb web page!

Option Explicit
Private Const HEAD_STYLE = "<div ID=foo style='width :100%;filter:dropshadow'>"
Private Const TAIL_STYLE = "</div>"
Dim cInnerHTML As String
Dim DHTMLEditInitialized As Boolean

Private Sub cmddrop_Click()
Dim cInnerHTML As String
Dim oElement As IHTMLElement
Dim bdoc As HTMLBody


 Command button
   Set oElement = DHTMLEdit1.DOM.All.Item("foo")
   If oElement Is Nothing Then
   ' no div style
       cInnerHTML = DHTMLEdit1.DOM.body.innerHTML
   Else
   ' just get the damn html
       cInnerHTML = oElement.innerHTML
   End If

   ' add drop shadow
       DHTMLEdit1.DOM.body.innerHTML = HEAD_STYLE & cInnerHTML & TAIL_STYLE
   
 
that should do it

You might also like...

Comments

 nikocom

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“Walking on water and developing software from a specification are easy if both are frozen.” - Edward V Berard