JavaScript Editor JavaScript Editor     JavaScript Debugger

Previous Section Next Section

Main Page

Using the Popup Event

The MenuItem Popup event occurs when a menu item is about to be displayed, and you can execute code to configure the item in this event's handler. For example, you might have an item that lets the user connect to the Internet, and you might want to set the caption to "Connect" if they are presently disconnected, and "Disconnect" if they're connected. Here's an example that uses this event to display a message box before the corresponding menu item is displayed:

Private Sub MenuItem6_Popup(ByVal sender As Object, _
    ByVal e As System.EventArgs) Handles MenuItem6.Popup
    MsgBox("I'm about to open my submenu!")
End Sub
Previous Section Next Section

JavaScript Editor Free JavaScript Editor     JavaScript Editor