Here, we set up our two global variables and in the OnLoad event load all the GIFs to cache and display the Disabled GIFs first.
dim Site, Imgdir Site = "http://" & location.host Imgdir = Site + "/images/" Sub window_onLoad() Ld b1,"button1__off.gif" Ld b1,"button1__on.gif" Show b1,"button1__off.gif" Ld b2,"button2_off.gif" Ld b2,"button2_on.gif" Show b2,"button2_off.gif" Ld b3,"button3_off.gif" Ld b3,"button3_on.gif" Show b3,"button3_off.gif" Ld b4,"button4_off.gif" Ld b4,"button4_on.gif" Show b4,"button4_off.gif" Ld b5,"button5_off.gif" Ld b5,"button5_on.gif" Show b5,"button5_off.gif" end sub sub Ld (obj, pic) set lobj = obj lobj.LoadPictureToCache=Imgdir + pic end sub sub Show (obj, pic) set lobj = obj lobj.picture=Imgdir + pic end sub
For the MouseEnter and MouseExit event functions we change the GIFs accordingly. These functions are then repeated for each GIF thereafter.
Sub b1_MouseEnter() Show b1,"button1__on.gif" end sub Sub b1_MouseExit() show b1,"button1__off.gif" end sub© 1999 Microsoft Corporation. All rights reserved. Terms of use.