Hello, I would like to limit dragging of a button only to vertically.
Can someone please help me.
Thanks in advance
Otto
Hello, I would like to limit dragging of a button only to vertically.
Can someone please help me.
Thanks in advance
Otto
if Valtype( ::bDrag ) == 'B'
Eval( ::bDrag, ::nTop + nRow - nMRow, ::nLeft + nCol - nMCol )
endif if lMoved .AND. valtype( ::bPostDrag ) == 'B'
Eval( ::bPostDrag, SELF )
endifDear Antonio,
thank you for your help.
oBtn:bDrag := { | y,x,flags | oBtn:nLeft := 1000 }
For testing purpose I tried the following codeblock and it seems I can achieve what I want to do.
Best regards,
Otto




FUNCTION BTN_MOVE(oBtn3, x, y)
LOCAL nNewTop := x, nNewLeft := y, lNew := .F.
IF x < oGroup:nTop
nNewTop := oGroup:nTop
lNew := .T.
ENDIF
IF y < oGroup:nLeft
nNewLeft := oGroup:nLeft
lNew := .T.
ENDIF
IF x + oBtn3:nHeight > oGroup:nBottom
nNewTop := oGroup:nBottom - oBtn3:nHeight
lNew := .T.
ENDIF
IF y + oBtn3:nWidth > oGroup:nRight
nNewLeft := oGroup:nRight - oBtn3:nWidth
lNew := .T.
ENDIF
IF lNew = .T. // only moved on wrong area
oBtn3:Move( nNewTop, nNewLeft, , , .T. )
ENDIF
RETURN( NIL )Hallo Uwe,
herzlichen Dank.
Kannst du bitte das gesamte Beispiel posten.
Liebe Grüße
Otto

Hallo Uwe,
herzlichen Dank.
Ich probiere nun deine Funktion in mein Programm einzubauen.
lg
Otto

