>Hi
>2 solutions to change the olecontrol possibility to be enabled/disabled:
>
>1.add just a commandbutton on the form to switch between 2 states:enabled/disabled
>
>*in click event
>with thisform.olecontrol1.object
>.enabled=!.enabled
>endwith
>
>
>the key is "object" otherwise cannot change the dtPicker state.
>
>2.can be also a checkbox with this code
>
>*in interactiveChange() event
>thisform.olecontrol1.object.enabled=iif(this.value=1,.t.,.f.)
>
>
>the visual indication of a disabled control is that it is grayed and dont react to events (user or by code).
Hi Yousfi,
In our case this is a complex container based class. I don't think it uses Ole control at all, but I can double check. I just didn't want to change the class itself. I guess I may try to access class objects directly from the control - let me try that.
UPDATE. I don't see a way to access inner objects of this class directly from the form. I attached a picture of the class.
UPDATE2. I found that this class had readonly_assign method that set the date control to show disabled. I'll try that now. - Tried that - no visual effect. It is not very important, so doesn't really matter. The class seems to be using textbox and a button which calls the calendar.
If it's not broken, fix it until it is.
My Blog