' Basic Programming
' Ch. 7 Demo #4
' by Mr. Minich
' Purpose - to demonstrate the use of a shortcut menu


Option Explicit Private Sub Form_MouseUp(Button As Integer, Shift As Integer, X As Single, Y As Single) ' presents a shortcut (or popup) menu when the user right-clicks on the form If Button = vbRightButton Then PopupMenu mnuShortcut End If End Sub Private Sub mnuShortcutChangeColor_Click() ' changes the background color of the form to red frmMain.BackColor = vbRed End Sub Private Sub mnuShortcutExit_Click() ' ends the program Unload Me End Sub ' Note that a menu must be created in order to execute this program