Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Controls
  New Posts New Posts RSS Feed - Display popup menu for drop down push button
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Display popup menu for drop down push button

 Post Reply Post Reply
Author
Message
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post Topic: Display popup menu for drop down push button
    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
Back to Top
wlcabral View Drop Down
Groupie
Groupie
Avatar

Joined: 25 April 2007
Location: Brazil
Status: Offline
Points: 72
Post Options Post Options   Thanks (0) Thanks(0)   Quote wlcabral Quote  Post ReplyReply Direct Link To This Post Posted: 16 April 2008 at 10:36pm
Did you try the x,y parameters ?
 
Public Function ShowPopup( _
   Optional ByVal Flags As Variant, _
   Optional ByVal x As Variant, _
   Optional ByVal y As Variant _
) As Long

Parameters

Flags
The 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
Back to Top
RedFin View Drop Down
Groupie
Groupie
Avatar

Joined: 26 March 2008
Location: Australia
Status: Offline
Points: 47
Post Options Post Options   Thanks (0) Thanks(0)   Quote RedFin Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.142 seconds.