Print Page | Close Window

Display popup menu for drop down push button

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Controls
Forum Description: Topics Related to Codejock Controls
URL: http://forum.codejock.com/forum_posts.asp?TID=10265
Printed Date: 19 April 2024 at 12:00am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Display popup menu for drop down push button
Posted By: RedFin
Subject: Display popup menu for drop down push button
Date Posted: 16 April 2008 at 10:02pm
Hi,

I am using a drop down push button and displaying a command bar context menu when the button is clicked, using this code -

Private Sub cmdChangeStatus_Click()
Dim Popup As CommandBar

    Set Popup = gRbn.CommandBars.ContextMenus.Find(400)
    With Popup
        Select Case ebStatusCode.Value
            Case "OP": .Controls(1).Enabled = False
            Case "PA": .Controls(2).Enabled = False
            Case "PC": .Controls(3).Enabled = False
            Case "CL": .Controls(4).Enabled = False
        End Select
       
        .ShowPopup
    End With

End Sub

The problem is that the popup context menu appears where the mouse was clicked ... that is, over the push button.

Can anyone tell me which methods/properties I can control the position of the popup so that it appears at the base of the push button ... I've looked and looked through the help, but can't work out what to use.

Alternatively, is there some other method I should be using??


Cheers,

Rohan



Replies:
Posted By: wlcabral
Date Posted: 16 April 2008 at 10:36pm
Did you try the x,y parameters ?
 
Public Function ShowPopup( _
   Optional ByVal mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20v12.0.0\Help\SymbolReference.chm::/XtremeCommandBars~CommandBar~ShowPopup.html# - Flags As Variant, _
   Optional ByVal mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20v12.0.0\Help\SymbolReference.chm::/XtremeCommandBars~CommandBar~ShowPopup.html# - x As Variant, _
   Optional ByVal mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20v12.0.0\Help\SymbolReference.chm::/XtremeCommandBars~CommandBar~ShowPopup.html# - y As Variant _
) As Long

Parameters

Flags
The  mk:@MSITStore:C:\Program%20Files\Codejock%20Software\ActiveX\Xtreme%20SuitePro%20ActiveX%20v12.0.0\Help\SymbolReference.chm::/XtremeCommandBars~Enumerations~XTPTrackPopupFlags_EN.html - flags of the popup
x
The x-coordinate where the popup menu should be shown
y
The y-coordinate where the popup menu should be shown


-------------
wlcabral


Posted By: RedFin
Date Posted: 16 April 2008 at 10:44pm
Oh dear ... don't I feel stupid

I had copied and pasted the code from one of the samples, so never even saw the intellisense popup in the IDE. I had been looking for things like popup.top etc.

Thanks wlcabral.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net