Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Where is the problem?!?!
Message
De
21/02/2003 13:52:57
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Where is the problem?!?!
Divers
Thread ID:
00756309
Message ID:
00756309
Vues:
46
Just copy, paste and run this code (no viruses! :).... Then read after the code.

PUBLIC oForm
LOCAL i, cName
oForm=CREATEOBJECT("Form")
oForm.AddObject('Button', 'commandbutton')
oForm.Button.Visible=.T.
FOR i=1 TO 5
cName=SYS(2015)
oForm.AddObject(cName, "clsContainer")
WITH oForm. &cName
.Top=0
.Left=(i-1)*50+i*20
.Height=300
.Width=60
.Build
.Visible=.T.
ENDWITH
ENDFOR
oForm.Height=300
oForm.Width=300
oForm.Show

DEFINE CLASS clsContainer AS Container
PROCEDURE Build
LOCAL i, j, nSize
nSize=10
FOR i=1 TO this.Width/nSize
FOR j=1 TO this.Height/nSize
cName=SYS(2015)
this.AddObject(cName, "clsCell")
WITH this. &cName
STORE nSize TO .Width, .Height
.Left=(i-1)*nSize
.Top=(j-1)*nSize
.Visible=.T.
ENDWITH
ENDFOR
ENDFOR
ENDPROC
ENDDEFINE

DEFINE CLASS clsCell AS Control
PROCEDURE Click
this.BackColor=this.BackColor+50
ENDPROC
ENDDEFINE

Try to click cells. Is everything OK?
Then, comment 5th line of this code (oForm.Button.Visible=.T.) and run the code again. Does your VFP hung? Mine too... What is this?
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform