Needed help with command bar popup location (1 Viewer)

nax009

New member
Local time
Tomorrow, 00:44
Joined
Mar 27, 2023
Messages
23
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: 61
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
 
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.
 
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

Back
Top Bottom