General information
Category:
Forms & Form designer
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
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only