Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Label won't initialize enabled=.F.
Message
From
07/07/2003 22:12:27
 
 
To
07/07/2003 21:35:37
General information
Forum:
Visual FoxPro
Category:
Troubleshooting
Miscellaneous
Thread ID:
00807758
Message ID:
00807799
Views:
17
Yup, that works better. I think you did find a bug but the bug is that the click actually responds rather than the label didn't appear disabled. I'm of course judging by the revised behavior in VFP8.

Aloha,

James

>Hi James,
>I think a better solution:
>
>label_base.Init()
>  this.enabled = this.enabled
>
>That way I shouldn't have to worry about it ever again.
>I was really hoping that someone would confirm that I actually found a bug in the label baseclass.
>
>>Hi Bill,
>>
>>You could add the following to your Container definition to get the desired effect:
>>
>>  FUNCTION Init
>>    This._lbl1.Enabled = .F.
>>  ENDFUNC
>>
>>
>>It seems as if the bug in this situation is that the label function is actually disabled. In VFP8 it seems MS 'fixed' the functionality because when executing your code the label function does, in fact, respond to the click even though it was initialized to Enabled=.F.
>>
>>>I'm using VFP 7.0
>>>
>>>LOCAL lo
>>>lo = CREATEOBJECT( '_frm' )
>>>lo.VISIBLE = .T.
>>>SET STEP ON
>>>
>>>DEFINE CLASS _frm AS FORM
>>>  ADD OBJECT cnt1 AS _cnt
>>>ENDDEFINE
>>>
>>>DEFINE CLASS _cnt AS CONTAINER
>>>  ADD OBJECT _lbl1 AS _lbl ;
>>>    WITH ;
>>>    CAPTION = 'This should be disabled', ;
>>>    ENABLED = .F.
>>>ENDDEFINE
>>>
>>>DEFINE CLASS _lbl AS LABEL
>>>  PROCEDURE CLICK()
>>>    WAIT WINDOW PROGRAM()
>>>  ENDPROC
>>>ENDDEFINE
>>>
>>>Why isn't _lbl1 displayed disabled?
>>>It is disabled. If you click on it, nothing happens because it's disabled. But it appears enabled.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform