Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How to drag and move command buttons inside a form
Message
De
16/03/2008 09:53:55
Hee Lim Wang
Fantasy Software Enterprise
Malaisie
 
 
À
16/09/2007 07:20:34
Erick Miranda
Formata Data Business - Grupo Linx
Contagem, Brésil
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
01254261
Message ID:
01302476
Vues:
16
hi Erick !
click method in cmdMove button is not functioning
i want to do something when click the cmdMove button
pls show me how to do that ?




LOCAL loForm as Form
m.loForm = CREATEOBJECT([formTest])
m.loForm.Show()

RETURN

*******************************************************************************

DEFINE CLASS formTest as Form
nDifXCoord = 0
nDifYCoord = 0

*- Adding objects
ADD OBJECT cmdExit as CommandButton
ADD OBJECT cmdMove as CommandButton

PROCEDURE init()
WITH this
.WindowType = 1
.Caption = [Move the Button Below!]
.Height = 421
.Width = 656
.AutoCenter = .T.

*- Setting Exit button
WITH .cmdExit
.Caption = [\ .Height = 39
.Width = 152
.Top = 360
.Left = 264
.Visible = .T.
ENDWITH

*- Setting Move button
WITH .cmdMove
.Caption = [Move Me Within of the Form]
.Height = 65
.Width = 81
.Top = 24
.Left = 60
.DragMode = 1
.WordWrap = .T.
.Visible = .T.
ENDWITH

ENDWITH
ENDPROC

PROCEDURE DragDrop()
LPARAMETERS oSource, nXCoord, nYCoord

oSource.Left = nXCoord - thisForm.nDifXCoord
oSource.Top = nYCoord - thisForm.nDifYCoord
ENDPROC

*- Exit button
PROCEDURE cmdExit.Click()
ThisForm.Release()
ENDPROC

*- Move button
PROCEDURE cmdMove.MouseMove()
LPARAMETERS nButton, nShift, nXCoord, nYCoord

thisForm.nDifXCoord = nXCoord - THIS.Left
thisForm.nDifYCoord = nYCoord - THIS.Top
ENDPROC
ENDDEFINE
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform