Results 1 to 3 of 3

Thread: Popup menu stuff

  1. #1

    Thread Starter
    Member
    Join Date
    May 1999
    Location
    San Jose, CA, USA
    Posts
    43

    Question

    I'd like to make a popup menu appear when a button is clicked right under that button... I've never really done any popup menu stuff, so can anyone help?
    -_=Progrium=_-
    Progrium Software

    Using: VB 6 Pro

  2. #2
    Hyperactive Member
    Join Date
    Sep 1999
    Location
    Cleveland, Ohio
    Posts
    263

    Lightbulb

    PopupMenu Method

    Displays a pop-up menu on an MDIForm or Form object at the current mouse location or at specified coordinates. Doesn't support named arguments.

    Syntax

    object.PopupMenu menuname, flags, x, y, boldcommand

    The PopupMenu method syntax has these parts:

    Part Description

    object Optional. An object expression that evaluates to an object in the Applies To list. If object is omitted, the form with the focus is assumed to be object.

    menuname Required. The name of the pop-up menu to be displayed. The specified menu must have at least one submenu.

    flags Optional. A value or constant that specifies the location and behavior of a pop-up menu, as described in Settings.
    x Optional. Specifies the x-coordinate where the pop-up menu is displayed. If omitted, the mouse coordinate is used.
    y Optional. Specifies the y-coordinate where the pop-up menu is displayed. If omitted, the mouse coordinate is used.
    boldcommand Optional. Specifies the name of a menu control in the pop-up menu to display its caption in bold text. If omitted, no controls in the pop-up menu appear in bold.
    This argument works only for applications running under Windows 95. The application will ignore this argument when running under 16-bit versions of Windows or Windows NT 3.51 and earlier.

    Settings

    The settings for flags are:

    Constant (location) Value Description

    vbPopupMenuLeftAlign 0 (Default) The left side of the pop-up menu is located at x.
    vbPopupMenuCenterAlign 4 The pop-up menu is centered at x.
    vbPopupMenuRightAlign 8 The right side of the pop-up menu is located at x.

    Constant (behavior) Value Description

    vbPopupMenuLeftButton 0 (Default) An item on the pop-up menu reacts to a mouse click only when you use the left mouse button.
    vbPopupMenuRightButton 2 An item on the pop-up menu reacts to a mouse click when you use either the right or the left mouse button.

    Note The flags parameter has no effect on applications running under Microsoft Windows version 3.0 or earlier. To specify two flags, combine one constant from each group using the Or operator.

    Remarks

    These constants are listed in the Visual Basic (VB) object library in the Object Browser.
    You specify the unit of measure for the x and y coordinates using the ScaleMode property. The x and y coordinates define where the pop-up is displayed relative to the specified form. If the x and y coordinates aren't included, the pop-up menu is displayed at the current location of the mouse pointer.
    When you display a pop-up menu, the code following the call to the PopupMenu method isn't executed until the user either chooses a command from the menu (in which case the code for that command's Click event is executed before the code following the PopupMenu statement) or cancels the menu. In addition, only one pop-up menu can be displayed at a time; therefore, calls to this method are ignored if a pop-up menu is already displayed or if a pull-down menu is open.

    A pop-up menu that isn't visible on the menu bar because its Visible property is set to False in the Menu Editor can still be displayed because the Visible property of the specified menu is ignored when Visual Basic displays a pop-up menu.
    Just put this in any mouse up procedure when the right mouse button clicks.

  3. #3

    Thread Starter
    Member
    Join Date
    May 1999
    Location
    San Jose, CA, USA
    Posts
    43
    oh thanks!! where did you find that?
    -_=Progrium=_-
    Progrium Software

    Using: VB 6 Pro

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