Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Limitations
Message
From
09/07/2002 19:57:38
 
 
To
09/07/2002 18:12:07
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Miscellaneous
Thread ID:
00676849
Message ID:
00676872
Views:
22
For #3, here is code I have in the refresh method of one of the buttons on a main toolbar to disable/enable it depending on a condition. Something along the same lines with your specific condition should work for you.

Also, when the user makes a specific selection, you could set a property on the active form that the toolbar could check and if the form's property is enabled, then enable the toolbar button. If the activeform's property is not enabled, then disable the button. Something along the lines of _screen.activeform.lcmdbtnenable=1 when enabled and 0 when disabled or something along those lines. Better yet, if you have an object that is persistent whenever the form is instantiated, you could check for existence of the object first and then check the condition if the object exists to prevent the code from firing if a different form is active and that form does not have the property. You could do the same thing by adding a property to _screen also which may be simpler. Just remember to start out with adding the property and setting the default value when your app starts BEFORE the toolbar is loaded so it doesn't bomb out.
*mainapptoolbar cmdcloseallforms.refresh()
LOCAL llreturn
llreturn = DODEFAULT()
IF _Screen.Activeform.Windowtype=1
	this.enabled=.f.
ELSE
	this.enabled=.t.
ENDIF
RETURN llreturn
>Hi,
>
>Three questions?
>
>1. Is there a limit in VFP for the number of new methods you can create?
>2. Can you inherited more than one custom class in a form?
>
> * I have a form class and in that form I inherited a custom class to do
> some common processing. When I added two more method to the existing
> custom class, but I can see it in the class browser.
> (Related to question 1 and 2)
>
>3. How can I enabled and disabled toolbar buttons based on user's selection?
>
>
>Can someone help? Thanks in advance.
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform