Esta utilidad muestra un ejemplo de ello, si quieren que se guarde esta información para que el usuario cargue las ventanas con las caracteristias que él a colocado, pues solo hagan una tabla en la que guarden el control y sus propiedades, en el Init del Form, carguen estas propiedades y en el Unload, guarden las nuevas.
Espero les sea de utilidad.
Alejandro Magaña
PUBLIC loForm1 loForm1 = CREATEOBJECT("Form1") loForm1.SHOW(1) DEFINE CLASS Form1 AS FORM TOP = 0 LEFT = 0 HEIGHT = 225 WIDTH = 276 AUTOCENTER = .T. CAPTION = "Mover y ajustar controles" xoffset = 0 yoffset = 0 NAME = "Form1" ADD OBJECT command10 AS COMMANDBUTTON WITH ; TOP = 68, LEFT = 84, ; HEIGHT = 49, WIDTH = 84, ; CAPTION = "Mi botón", NAME = "Command10" ADD OBJECT check1 AS CHECKBOX WITH ; TOP = 20, LEFT = 54, ; HEIGHT = 17, WIDTH = 60, ; CAPTION = "Mover", NAME = "Check1" ADD OBJECT check2 AS CHECKBOX WITH ; TOP = 20, LEFT = 161, ; HEIGHT = 17, WIDTH = 60, ; CAPTION = "Ajustar", NAME = "Check2" ADD OBJECT label1 AS LABEL WITH ; CAPTION = [Para mover el botón deberá activar la ] + ; [casilla "Mover", y para ajustar su Height y ] + ; [Width, active la casilla "Ajustar"], ; HEIGHT = 60, LEFT = 6, ; TOP = 161, WIDTH = 267, ; NAME = "Label1", WORDWRAP = .T. PROCEDURE ajustar LPARAMETERS oSource, nXCoord, nYCoord, nPosicion IF nPosicion = 1 oSource.WIDTH = nXCoord - oSource.LEFT ELSE oSource.HEIGHT = nYCoord - oSource.TOP ENDIF ENDPROC PROCEDURE DRAGDROP LPARAMETERS oSource, nXCoord, nYCoord oSource.LEFT = nXCoord - THISFORM.XOffset oSource.TOP = nYCoord - THISFORM.YOffset ENDPROC PROCEDURE command10.DRAGDROP LPARAMETERS oSource, nXCoord, nYCoord THIS.PARENT.DRAGDROP(oSource, nXCoord, nYCoord) ENDPROC PROCEDURE command10.CLICK MESSAGEBOX("Left: "+TRANSFORM(THIS.LEFT)+CHR(13)+; "Top: "+TRANSFORM(THIS.TOP)+CHR(13)+; "Width: "+TRANSFORM(THIS.WIDTH)+CHR(13)+; "height: "+TRANSFORM(THIS.HEIGHT)) ENDPROC PROCEDURE command10.MOUSEMOVE LPARAMETERS nButton, nShift, nXCoord, nYCoord IF THISFORM.Check1.VALUE = 1 IF nButton = 1 && Left button THISFORM.XOffset = nXCoord - THIS.LEFT THISFORM.YOffset = nYCoord - THIS.TOP THIS.DRAG ENDIF ENDIF IF THISFORM.check2.VALUE = 1 THISFORM.XOffset = nXCoord - THIS.LEFT THISFORM.YOffset = nYCoord - THIS.TOP DO CASE CASE BETWEEN(THISFORM.XOffSet,THIS.WIDTH - 8,THIS.WIDTH + 8) THIS.MOUSEPOINTER = 9 IF nButton = 1 THISFORM.Ajustar(THIS,nXCoord,nYCoord,1) ENDIF CASE BETWEEN(THISFORM.YOffSet,THIS.HEIGHT - 8,THIS.HEIGHT + 8) THIS.MOUSEPOINTER = 7 IF nButton = 1 THISFORM.Ajustar(THIS,nXCoord,nYCoord,2) ENDIF OTHERWISE THIS.MOUSEPOINTER = 0 ENDCASE ENDIF ENDPROC PROCEDURE check1.CLICK IF THIS.VALUE = 1 THIS.PARENT.check2.VALUE = 0 ENDIF ENDPROC PROCEDURE check2.CLICK IF THIS.VALUE = 1 THIS.PARENT.check1.VALUE = 0 ENDIF ENDPROC ENDDEFINE
No hay comentarios. :
Publicar un comentario
Los comentarios son moderados, por lo que pueden demorar varias horas para su publicación.