Is there any way to close the popup menu programmatically?
The control provides a CloseOnClick property. The CloseOnClick property specifies whether the control is closed when the user clicks. If the CloseOnClick property is True, the control will be automatically closed when the user clicks the mouse. If the CloseOnClick property is False, the popup menu is closed when the mouse cursor leaves the client area of the popup menu. The CloseOnClick property should be called at run time, just before ShowAtCursor or Show method.