Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
When is Hidden too Hidden?
Message
De
22/10/2001 18:14:17
Brett Shearer
Eagle Datamation International
Sydney, Australie
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
When is Hidden too Hidden?
Divers
Thread ID:
00571893
Message ID:
00571893
Vues:
52
I have written this code similarly in other languages, and all works fine, but VFP7 doesn't work. How should this be coded for VFP?
The problem is that the hidden property is not available from within the class that has defined it....

LOCAL fn as form
fn = CREATEOBJECT("FORM")
fn.Caption = 'Move into and out of each field and watch one blow up'

fn.AddObject('WithoutDefault', 'TEXTBOXWithoutDefault')
fn.WithoutDefault.Visible = .t.
fn.AddObject('WithDefault', 'TextBoxWithDefault')
fn.WithDefault.Visible = .t.
fn.Show(1)

DEFINE CLASS TextBoxAbstract as TextBox
HIDDEN MyProperty
PROCEDURE LostFocus
MESSAGEBOX('Value : ' + This.MyProperty)
ENDPROC
PROCEDURE Init
This.MyProperty = 'Working'
endproc
ENDDEFINE

DEFINE class TextBoxWithoutDefault as TextBoxAbstract
Top = 20
Left = 10
ENDDEFINE

DEFINE class TextBoxWithDefault as TextBoxAbstract
Top = 50
Left = 10
PROCEDURE LostFocus
MESSAGEBOX('Before DODEFAULT()')
DODEFAULT()
MESSAGEBOX('After DODEFAULT()')
endproc
ENDDEFINE
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform