Information générale
Catégorie:
Programmation Orientée Object
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!
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement