Needed help with command bar popup location (1 Viewer)

nax009

New member
Local time
Today, 13:17
Joined
Mar 27, 2023
Messages
15
Hi I have created a command bar which popup when the user click "cmd_file" button. What I need is to replicating a classic windows menu bar (i.e. MS Office 2003 style) by create a button that show command bar popup below the button. But my problem is I can't find a way to put the command bar below that button. I've written some code as shown in the attachment. I seek some tutorial to solve this. Anyone?


Option Compare Database
Option Explicit

Private Sub cmd_file_Click()
Set objPopup = CommandBars("t_m_A_1")
objPopup.ShowPopup Me.cmd_file.Left, Me.cmd_file.Top + Me.cmd_file.Height
Set objPopup = Nothing
End Sub
 

Attachments

  • img1.png
    img1.png
    286.5 KB · Views: 18

nax009

New member
Local time
Today, 13:17
Joined
Mar 27, 2023
Messages
15
sorry for those messy code, here's the new one

Code:
Option Compare Database
Option Explicit
Private Sub cmd_file_Click()
Set objPopup = CommandBars("t_m_A_1")
objPopup.ShowPopup Me.cmd_file.Left, Me.cmd_file.Top + Me.cmd_file.Height
Set objPopup = Nothing
End Sub
 

arnelgp

..forever waiting... waiting for jellybean!
Local time
Today, 14:17
Joined
May 7, 2009
Messages
19,243
custom shortcut menu pops-up at cursor position.
you can have a "dummy" textbox (Enabled=true,height=, width=0)
where you want your pop-up to appear.
and use that dummy textbox as reference.
 

nax009

New member
Local time
Today, 13:17
Joined
Mar 27, 2023
Messages
15
custom shortcut menu pops-up at cursor position.
you can have a "dummy" textbox (Enabled=true,height=, width=0)
where you want your pop-up to appear.
and use that dummy textbox as reference.
OH!! That's work! But can I ask something? Why can't I use the button's position why a textbox?
 

Users who are viewing this thread

Top Bottom