Results 1 to 3 of 3

Thread: PopUpMenu; x y coordinates [WORKAROUND FOUND]

  1. #1

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871

    Arrow PopUpMenu; x y coordinates [WORKAROUND FOUND]

    Hi everyone,

    I'm facing a strange problem with the PopUpMenu method. I'm building a plugin for Internet Explorer, and therefore my project is an ActiveX DLL. So when executed the Internet Explorer window hosts my DLL.

    Now I simply want to pop up a menu from a button on my IE Toolbar. Usually I use the following code for that:
    VB Code:
    1. PopupMenu "mnuFile", , Command1.Left, Command1.Top + Command1.Height
    In this case, however, it does not work at all. The menu appears somewhere on the page instead of directly under the button.

    See the screenshot for an example of what I mean (the menu appears after clicking the 'Content Creator' button, and should be directly under the button).

    Now there must be a way to get that menu to pop up where I want it to. Any thoughts?
    Attached Images Attached Images  
    Last edited by TheVader; Apr 26th, 2004 at 02:55 PM.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

  2. #2
    Hyperactive Member
    Join Date
    Mar 2003
    Location
    Greece, Salonica
    Posts
    473
    Wont
    VB Code:
    1. PopupMenu mnuFile
    work?

    The other things are optional...

    MSDN:
    PopupMenu Method Example
    This example displays a pop-up menu at the cursor location when the user clicks the right mouse button over a form. To try this example, create a form that includes a Menu control named mnuFile (mnuFile must have at least one submenu). Copy the code into the Declarations section of the form, and press F5.

    VB Code:
    1. Private Sub Form_MouseDown (Button As Integer, Shift As Integer, X As Single, Y As Single)
    2.    If Button = 2 Then
    3.       PopupMenu mnuFile
    4.    End If
    5. End Sub

    See?

  3. #3

    Thread Starter
    Fanatic Member TheVader's Avatar
    Join Date
    Oct 2002
    Location
    Rotterdam, the Netherlands
    Posts
    871
    PopupMenu pops up at the current mouse coordinates. In that case the location of the menu would depend on where the button is clicked. That doesn't look very well.

    Anyway, I've found a workaround. I wanted the menu to expand when the user clicked a button; but since I made that button myself I simply included it in the ActiveX control.

    It still remains odd, though.
    Author for Visual Basic Web Magazine

    My articles on the Web Browser Control:
    Using the Web Browser Control & Using the DHTML Document Object Model

    The examples referenced in the articles can be found here:

Posting Permissions

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



Click Here to Expand Forum to Full Width