Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New Coder
    Join Date
    Feb 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How to associate a popup menu with a listbox?

    Hi,

    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.

    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.Items.Add(listitem1)
    listbox1.AutoPostBack = True
    Me.Controls.Add(listbox1)
    AddHandler listbox1.SelectedIndexChanged, AddressOf Listbox1_SelectedIndexChanged

    menu1.ID = "ContextMenu1"
    menuitem1.Text = "Acknowledge"
    menu1.ContextMenuItems.Add(menuitem1)
    menu1.boundcontrols.add(listbox1)
    Me.Controls.Add(menu1)
    End Sub

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

  • #2
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Is this for ASP in HTML?
    Form elements take precidence over layers or other layout elements.

  • #3
    New Coder
    Join Date
    Feb 2006
    Posts
    30
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •