• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint

Designers Corner

Earlier in the chapter we talked about using Class modules to setup event handlers for FrontPage 2000 events. This is not the only method to catch events. UserForm modules can also be used to setup event handlers. The following example uses the withevents keyword discussed in this chapter to setup an OnClick event handler for the first image on the current page.

Option Explicit
Public WithEvents eimage As FrontPageEditor.FPHTMLImg

Private Function eimage_onclick() As Boolean
    MsgBox "OnClick for the Image"
End Function

Private Sub UserForm_Initialize()
Set eimage = ActivePageWindow.Document.images(0)
End Sub


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint