Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
What's Wrong Here?
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00560298
Message ID:
00560340
Views:
22
>I have a container with a button on it. When I click the button, I want
>to pop up a shortcut menu. The menu pops up, but WAY off the the right
>and WAY below the form.
>
>
>
>** Within the container
>WITH This
>
>  ** Define top, left position
>  nRow = ThisForm.Top + .Top + .tbnPopup.Height
>  nCol = ThisForm.Left + .Left
>
>  ** Create popup
>  DEFINE POPUP PopItems FROM nRow, nCol SHORTCUT
>
>  ** Add the menu bars
>  FOR nItem = 1 TO ALEN(aValues, 1)
>
>    DEFINE BAR nItem OF PopItems PROMPT aValues[nItem, 2]
>
>  ENDFOR
>
>  ** Define selection actions
>  ON SELECTION POPUP PopItems oContainer.SelectItem()
>
>  ** Show the popup
>  ACTIVATE POPUP PopItems
>
>ENDWITH
>



You can do something along these lines:
DEFINE POPUP shortcut SHORTCUT RELATIVE FROM MROW(),MCOL()
This will open the form relative from where the mouse is. If you want to do it relative from the button, it gets a bit more difficult. First of all, you will have to switch to "foxels" (ScaleMode property on the form). Then you have to traverse from the button back to the form it lives in, to figure out where the top end left corners of the button are (relative from the top, left corner of the form, NOT relative to the next container!).

Markus




Markus Egger
President, EPS Software Corp
Author, Advanced Object Oriented Programming with VFP6
Publisher, CoDe Magazine
Microsoft MVP since 1995
Previous
Reply
Map
View

Click here to load this message in the networking platform