The control's release notes can be found on our web site, looking for the Release Notes column in the control's main page. Click here for direct link.
The control provides two properties: Show and ShowAtCursor. The Show property requires x and y coordinates where the popup menu will be displayed. The ShowAtCursor property doesn't require any additional parameters. Both properties return the identifier of selected item. The Command property can be used to retrieve the selected item. For instance:Dim i As Long i = PopupMenu1.ShowAtCursor()
The Items property of control retrieves the collection of items. The Items property gets an object of Menu type. The EXPOPUPMENULibCtl.Menu object exports methods like Add, Remove, Clear to add or remove items at runtime. For instance, the following sample adds a separator item:The following sample adds a new sub menu to the control:With PopupMenu1.Items .Add "", Separator ' Adds a separator item End WithWith PopupMenu1.Items With .Add("Popup", SubMenu).SubMenu .Add "Item 1", Default, 1001 .Add "Item 2", Default, 1002 .Add "Item 3", Default, 1003 End With End With
In VB environment, the F2 opens the object browser. Select the EXPOPUPMENULibCtl item, and you have the entire list of exported objects, properties and methods.
Since we need this for our intranet application running on IE5+, wanted to know if this product is meant for internet apps?
Yes. The control can be used in a script environment such as IE. The setup installs a WEB folder where you can find the sample.htm file. The sample shows how ExPopupMenu and ExMenuButton controls work.
Yes. The control's library provides a MenuButton object that helps you to attach a popup menu to a command button. The following code associates a popup menu object to the menu button control:Set MenuButton1.Menu = PopupMenu1
It would be nice to have the ability to mark some items using bold or italic font attribute. Is this possible?
More than that, the version 126.96.36.199 adds the ability to use built-in HTML format in item's caption. The built-in HTML tags supported are:
In design mode, I've added items to a popup menu, and I want to move one to another position. What should I do?
Open the control's menu editor ( by selecting 'Properties...' from object's context menu ), select an item using the mouse, and then press CTRL + arrow key to move the selected item to a new position.
I am using the popupmenu editor to create the popup menu at design time. I do not understand how to import images into the editor. It says to drag the file into the editor but how?
Open an Windows Explorer window and drag icon files, or files that contains icons as internal resource to the images list panel.
Yes. The control provides a method Attach that helps you to attach a menu to a window. When you don't need anymore the menu bar, the Detach method should be called. If you are using the VB environment, make sure that you have the NegociateMenus property of the Form to False. By default it is True. The following sample attaches a menu bar to the form's window:PopupMenu1.Attach Me.hWnd
Please check the ForeColor and BackColor properties. They will help you to customize the general foreground and background color used. If you are trying to change the foreground or background property for a specific item you should look at the "It would be nice to have the ability to mark some items using bold or italic font attribute. Is this possible?". Using the built-in HTML feature you can specify whatever you want for an item.
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.
Unfortunately you cannot add new items to the popup menu, while it is shown ( opened ). You can add new items only if the popup menu is not opened.
The Gray and Highlight properties of Item object helps you to specify how the item appear when it is disabled and selected. For instance, the following sample adds an unselectable item:With PopupMenu1 With .Items.Add("My <b>title</b>", Default, 1234) .Highlight = False .Enabled = False .Gray = False End With End With
Use a syntax like follows:axMenuButton1.Menu = ( axPopupMenu1.GetOcx() as EXPOPUPMENULib.PopupMenu );
The differences between exMenu and exPopupMenu components include:
The Command event is fired only if the menu is attached to a form using the Attach method. The Command event is never fired if you display the control using the Show or ShowAtCursor properties. Use the Attach method to attach a menu bar to a dialog or a form. The Command event is fired when user clicks or selects an item from the dialog/form's menu bar.