Hi!
make a property in the textbox, called 'lPermanentlyDisabled'. Make the _Assign method for text box. In the assign method set lPermanentlyDisabled to .T.:
lparameters NewValue
this.lPermanentlyDisabled = !NewValue
this.Enabled = NewValue
This way you have an indicator to see that something else than Refresh disabled the textbox. So, in Refresh method do somehing like following:
if !this.lPermanentlyDisabled
...
this.Enabled = .F.
this.lPermanentlyDisabled = .F.
endif
So, when text box refresh fires, and something else disabled the taxtbox, the Refresh will not re-enable it.
HTH.
>I have Textboxes based on classes that depending on the value of a Form property ("C" for Change, "A" for Add, etc.) will do things like change the format of the Textbox so they look a certain way depending on the action that is going on. For example, I set the Enabled property to True in the Refreshes of the classes when the form is in "Add" mode, but when it is in "View" mode, Enabled is set to False. It works great under "normal" conditions, but the problem is that if I have a Textbox that should be disabled due to a value of another object selected by the user, the Refresh may override it. Do I need to remove the functionality in the Refreshes or is there another way to handle this? Thanks!
>
>Regards, Renoir
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.comICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs
It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.