DougHennig / Ribbon

A Microsoft Office 365-like ribbon control for VFP forms
24 stars 11 forks source link

Add a Container or Shape in the Menu form to mimic MouseLeave to release it #22

Closed VfpImaging closed 1 year ago

VfpImaging commented 1 year ago

Hi Doug, I just played a little on this idea, and got it working. Hopefully you'd find it useful - When you find some time, you can try the following:

1 - In the menu Form, add a transparent container or a Shape control that should resize with the form every time a button is added 2 - The menu items don't need to be inside the container. Just make sure the container or shape is slightly bigger than the menu items, and Behind the menu items 3 - In the Container's 'MouseLeave()' event, add some code similar to the below

LPARAMETERS nButton, nShift, nXCoord, nYCoord
IF nXCoord <= This.Left OR nXCoord >= (This.Left + This.Width) OR ;
    nYCoord <= This.Top OR nYCoord >= (This.Top + This.Height)
    Thisform.Release()
ENDIF 
VfpImaging commented 1 year ago

Closing this topic, replaced with a better solution