Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
_Assign method works like a _Access method
Message
 
 
À
05/01/2000 21:08:32
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Divers
Thread ID:
00313402
Message ID:
00313776
Vues:
60
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
Fil
Voir

Click here to load this message in the networking platform