Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Painted Myself into a Corner with Refresh?
Message
From
08/06/2001 09:29:48
 
 
To
08/06/2001 09:19:28
Jay Johengen
Altamahaw-Ossipee, North Carolina, United States
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00516845
Message ID:
00516854
Views:
9
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 && skip code if Enabled set outside of text box
  ...
  this.Enabled = .F.
  this.lPermanentlyDisabled = .F. && indicate that we disabled text box in Refresh
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.com
ICQ #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.
Previous
Reply
Map
View

Click here to load this message in the networking platform