Content Supported by Sourcelens Consulting

VERSION 5.00
Begin {90290CCD-F27D-11D0-8031-00C04FB6C701} EventBub 
   ClientHeight    =   4770
   ClientLeft      =   1815
   ClientTop       =   1545
   ClientWidth     =   5985
   _ExtentX        =   10557
   _ExtentY        =   8414
   SourceFile      =   "C:\Program Files\Microsoft Visual Studio\MSDN98\98VS\1033\Samples\VB98\DHShowMe\EventBub.htm"
   BuildFile       =   "c:\dhtml\EventBub.htm"
   BuildMode       =   0
   TypeLibCookie   =   135
   AsyncLoad       =   0   'False
   id              =   "DHTMLPage1"
   ShowBorder      =   0   'False
   ShowDetail      =   0   'False
   AbsPos          =   0   'False
End
Attribute VB_Name = "EventBub"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Private Function EventArea_onclick() As Boolean
'If bubbling is enabled and the user selects the button,
'this event procedure will  be fired after the "TheButton_onclick"
'procedure, below. The code in this procedure changes the
'background color of the entire page to "wheat."
    DHTMLPage.Document.bgColor = "wheat"
End Function

Private Sub HTMLPage_Load()
'On load, initialize the checked state of the radio buttons
'so that nobubble is checked first.
    bubble.Checked = False
    nobubble.Checked = True
    
End Sub

Private Function TheButton_onclick() As Boolean
'Determine whether bubbling is enabled or not. The first action
'to take is to change the color of the button itself. If bubbling
'is enabled, the event automatically bubbles up to the EventArea
'DIV. If not, the bubbling is cancelled.
    If bubble.Checked = True Then
        TheButton.Style.backgroundColor = "slateblue"
    ElseIf nobubble.Checked = True Then
        TheButton.Style.backgroundColor = "slateblue"
        'Cancel bubbling:
        Document.parentWindow.event.cancelBubble = True
    End If
End Function

Private Sub TheButton_onmouseout()
'Return the document colors to their original state on
'mouseout so that the effect can be repeated on subsequent
'clicks.
    TheButton.Style.backgroundColor = "buttonface"
    Document.bgColor = "white"
End Sub