Option Explicit

Dim LastPicture As Integer

Private Sub CloseButton_Click()
    Unload Form2
    End
End Sub

Private Sub Form_Unload(Cancel As Integer)
    Unload Form2
End Sub

Private Sub PicTimer_Timer()
    ' Update the button bitmap every so often to get the
    ' spinning globe effect
    With SftButton4
        Set .Image1.Picture = WImage(LastPicture).Picture
        LastPicture = LastPicture + 1
        If LastPicture >= 16 Then LastPicture = 0
    End With
End Sub

Private Sub SftButton1_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton1_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim x As Single, y As Single
    With SftButton1
        x = .Left + .Width
        y = .Top + .Height
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
    End With
End Sub

Private Sub SftButton2_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton2_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim x As Single, y As Single
    With SftButton2
        x = .Left + .Width
        y = .Top + .Height
        .BorderAlways = True
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
        .BorderAlways = False
    End With
End Sub

Private Sub SftButton3_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton3_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim x As Single, y As Single
    With SftButton3
        x = .Left + .Width
        y = .Top + .Height
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
    End With
End Sub

Private Sub SftButton4_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton4_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim x As Single, y As Single
    With SftButton4
        x = .Left + .Width
        y = .Top + .Height
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
    End With
End Sub

Private Sub SftButton5_Click()
    ' Invoke the default action, because the button was clicked
    Call Form2.popupMenu_DefaultAction_Click
End Sub

Private Sub SftButton5_DropDownClick()
    ' The drop down button was clicked. Display a popup menu
    ' right-aligned with the right edge of the button
    Dim x As Single, y As Single
    With SftButton5
        x = .Left + .Width
        y = .Top + .Height
        PopupMenu Form2.mainMenu, vbPopupMenuRightAlign, x, y, Form2.popupMenu_DefaultAction
    End With
End Sub