Library code snippets

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

Comments

  1. 01 Jan 1999 at 00:00

    This thread is for discussions of Working with the document object model.

Leave a comment

Sign in or Join us (it's free).