Page 1 of 1

Moveable Menu Button

PostPosted: Thu Feb 07, 2002 3:30 pm
by Jim Brammer
Have you ever made a button that activates a Menu or MenuEx that during design time you have to re-locate and re-adjust it's placement on your page? When you move the button the Menu still pops up in the old location. At design time, until you finally get everything in it's final position, you might need to move that button several times. Each time you move it you also have to re-set the position where the Menu pops up. After 3-4 times that gets aggravating.

Instead, use the sample code below and the menu will follow the button no matter where you place it giving you one less thing to do (or several) while designing your PUB.

GetObjectInfo "FileMnuBtn" "Left" "[FileMnu_X]"
GetObjectInfo "FileMnuBtn" "Top" "[FileMnu_T]"
GetObjectInfo "FileMnuBtn" "Height" "[FileMnu_H]"
Math "[FileMnu_T]+[FileMnu_H]" "" "[FileMnu_Y]"
MenuEx "[FileMnu_X]" "[FileMnu_Y]" "Open|Save|Print|Exit" "[FileMnuSelect]"