-
Does any one know how to make a popup button appear right of an object that is clicked?
The following code makes the popup button appear just below the object that is clicked:
frmMenu = the form where the original menu has been placed
mnuFile = name of the menu that is going to be popped up
cmdFile = the command button to be pressed so the popup button appears
PopupMenu frmMenu.mnuFile, 0, cmdFile.Left, cmdFile.Top + cmdFile.Height
So again, if someone can be real helpful and tell me the code that can make the popup button appear just right of the cmdFile button when it is pressed.
Thank you. Also, if you can be so kind as to explain how one comes up with such numbers or ways to make it so I could make the popup button appear just up, left, diagonal whatever. But most importantly, I need the code to make it appear right of the command button. Thank you very much!
-
Hi,
To make it appear to the right of your button, you just need to add the width of your button to it's Left property.
Example:
Code:
PopupMenu frmMenu.mnuFile, 0, cmdFile.Left + cmdFile.Width, cmdFile.Top
To get it to appear elsewhere, you just need to play around with the left,top,width and height properties!
Hope this helps
Totally :confused:
-
<?>
Code:
Private Sub Command1_Click()
'self explanatory...use the button's left plus it's widht to get to the right side
'then use the button's top plus it's height to get tot the bottom
PopupMenu smenu, 0, Command1.Left + Command1.Width, Command1.Top + Command1.Height
End Sub