| |
|
|
RudiB. | ¡Hola zusammen,
hier una 5 Características-Button....en Abhängigkeit de el Punto/Postion a welcher el Button geklickt se.
Links oben, rechts oben, links unten, rechts unten oder Mitte.
Windowstyle 24
Windowtitle "5 Características Button"
Ventana 300,200-450,350
Declarar bs#,posx%,posa%,posy%,posb%,half_b%,half_h%,neutral_b%,neutral_h%
Dim bs#,16'
Def @GetWindowRect(2) !"USER32", "GetWindowRect"
Def @ScreenToClient(2) !"USER32","ScreenToClient"
cls Externo("USER32","GetSysColor",15)
Var test7&=Control("BUTTON","+",$54410000,150,70,200,100,%hwnd,0,%hInstance,$0)
Var text&=Crear("Text",%hwnd,"5 Características-Button",140,173,140,22)
Mientras que 1
Waitinput
If getfocus(test7&)
posx%=%mousex
posy%=%mousey
@GetWindowRect(test7&,bs#)
@ScreenToClient(%hwnd,bs#)
@ScreenToClient(%hwnd,bs#+8)
half_b%=((LONG(bs#,8)-LONG(bs#,0))/2)
half_h%=((LONG(bs#,12)-LONG(bs#,4))/2)
neutral_b%=((LONG(bs#,8)-LONG(bs#,0))/5)
neutral_h%=((LONG(bs#,12)-LONG(bs#,4))/5)
posa%=Largo(bs#,0)+half_b%
posb%=Largo(bs#,4)+half_h%
setfocus(%Hwnd)
locate 1,1
Caso negativo (posx%>posa%-neutral_b%) and (posx%<posa%+neutral_b%) and (posy%>posb%-neutral_h%) and (posy%<posb%+neutral_h%)
If (posx%<posa%) and (posy%<posb%)
imprimir "letzter Click en links oben "
Endif
If (posx%>posa%) and (posy%<posb%)
imprimir "letzter Click en rechts oben "
Endif
If (posx%>posa%) and (posy%>posb%)
Imprimir "letzter Click en rechts unten "
Endif
If (posx%<posa%) and (posy%>posb%)
Imprimir "letzter Click en links unten "
EndIf
Más
Imprimir "letzter Click en Mitte "
EndIf
Endif
Endwhile
Waitinput
|
|
|
| Xprofan X4 Rudolf Beske / München
Hardware: NB Intel I9 - 16GByte RAM | 29.04.2021 ▲ |
|
|
|
|
Michael W. | Gut para Bewegungskreuze a la "Map View" oder "Google Earth". Leicht transparent y unos pocos Pfeilchen dazu. |
|
|
| |
|
|