Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Connect Toolbar button to a form
Message
 
To
14/04/2003 09:33:03
General information
Forum:
Visual FoxPro
Category:
CodeMine
Miscellaneous
Thread ID:
00777177
Message ID:
00777183
Views:
12
This message has been marked as the solution to the initial question of the thread.
>I would like to create a new toolbar button on the applications main toolbar and have it invoke a method on the active form. How do I set that up?
>
>I've been doing some investigation, but I'm not sure where I should put the code. Lets say I want to define a new method "mymethod"
>
>.statemanager.DefineAction('Form Mymethod', 'mymethod')
>
>Furthermore, once I get to that point, how will I enable & disable the button from the form level?


Steve,

If you want to have this method available to several forms throughout the application, the app object has a CreateStates() method for defining global state and actions. Put your DefineAction code there. Then, whenever the active form contains a method named mymethod, the button will be active. If the active form doesn't have the method, the button will be disabled.

HTH
_________________________________
There are 2 types of people in the world:
    Those who need closure
Previous
Reply
Map
View

Click here to load this message in the networking platform