View Full Version : How to associate a popup menu with a listbox?

02-22-2006, 09:40 AM

I created a web parts control consisting of a listbox and a pop up menu. When the user rightclicks on the listbox, the pop up menu is supposed to appear.

However, the menu always seems to be blocked by the listbox e.g The menu seems to be in the background and is partially blocked by the listbox. Something like dragging 1 control on top of the other on a windows form.:mad:

How do I enable the menu to be displayed on top of the listbox?

Below is a code snippet in vb:

'Creates child controls (a menu and a listbox)
Protected Overrides Sub CreateChildControls()

listbox1.ID = "List1"
listitem1.Text = "Testing"
listbox1.AutoPostBack = True
AddHandler listbox1.SelectedIndexChanged, AddressOf Listbox1_SelectedIndexChanged

menu1.ID = "ContextMenu1"
menuitem1.Text = "Acknowledge"
End Sub

I tried changing the order of the controls but its still the same thing. Any solutions for this problem?:(

02-22-2006, 02:31 PM
Is this for ASP in HTML?
Form elements take precidence over layers or other layout elements.

02-23-2006, 01:52 AM
Its a custom control built for web applications. I created the control in a vb.net class file then opened up an ASP.Net website to test the control

Is the pop up menu considered a layout element?

Is there anything to do to solve it?