Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Where is the problem?!?!
Message
From
21/02/2003 14:59:16
Jorge Haro
Independent Consultant
Juarez, Mexico
 
 
To
21/02/2003 13:52:57
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00756309
Message ID:
00756368
Views:
9
Odd, it seems that it will hang whenever there's no control to set focus to. If you substitute the button with another object that can not receive focus, such as a shape, it will also hang, the same happens if you set the command's enabled property to false before showing the form, I don't know *why* this happens though.

>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?
Previous
Reply
Map
View

Click here to load this message in the networking platform