General information
Category:
Object Oriented Programming
Hi Erik,
Put the following code into a .PRG and run it, click on the button.
**********************************************************
PUBLIC oform1
oform1=NEWOBJECT("form1")
oform1.Show
RETURN
*-- Form: form1 (d:\test\form_assign.scx)
*-- ParentClass: form
*-- BaseClass: form
*-- Time Stamp: 01/06/00 10:13:09 AM
*
DEFINE CLASS form1 AS form
DoCreate = .T.
Caption = "Form1"
Name = "Form1"
ADD OBJECT command1 AS commandbutton WITH ;
Top = 84, ;
Left = 252, ;
Height = 49, ;
Width = 61, ;
Caption = "Command1", ;
Name = "Command1"
PROCEDURE width_assign
LPARAMETERS vNewVal
*To do: Modify this routine for the Assign method
THIS.WIDTH = m.vNewVal
wait window 'width_assign fired:' + ALLT(STR(m.vNewVal))
ENDPROC
PROCEDURE command1.Click
local lnWidth
lnWidth = thisform.Width
ENDPROC
ENDDEFINE
*
*-- EndDefine: form1
**************************************************
These are the steps produced that code:
1.Open a new form
2.Add to it Width_Assign method
3.Go to the newly created method and add the following line at the bottom:
wait window 'width_assign fired:' + ALLT(STR(m.vNewVal))
4.Add a button to the form and in its Click event put the following code:
local lnWidth
lnWidth = thisform.Width
(5.Save the form, close it, open it in the class browser)
Thanks for your interest!
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