Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Menu executing form methods and objects
Message
 
 
To
05/07/2010 18:51:31
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Miscellaneous
Thread ID:
01471439
Message ID:
01471490
Views:
37
>>>The main program in my project calls a modal form that calls a mpx in it's init. The form is the "home page" for the app and I want the menu items to execute certain controls and methods on the form. I can set skip of menu in the form/prg but can a menu execute tasks methods and events in a form?
>>>
>>>Thanks
>>>
>>>dg
>>
>>You can do something like this
>>
>>if type('_screen.ActiveForm.Name') = 'C' and _screen.ActiveForm.Caption = 'myFormwithTheMethod'
>>   _screen.ActiveForm.myMethod()
>>endif
>
>
>Thank you for the help. I am a little unclear just how to use your code.
>First, I misspoke; I have a MODELESS form that calls a menu
>
>
>In a procedure of a menu prompt, I have:
>
>		Set Skip Of Bar 1 Of Edit .t.
>		Set Skip Of Bar 2 Of Edit .t.
>		Set Skip Of Bar 3 Of Edit .t.
>		SET SKIP OF BAR 1 OF Tools .t.
>		SET SKIP OF BAR 2 OF Tools .t.
>
>		DO FORM yaddayadda  && a new modal form
>		
>		IF  table.logicalfield
>			Set Skip Of Bar 1 Of Edit .f.
>			Set Skip Of Bar 2 Of Edit .f.
>			Set Skip Of Bar 3 Of Edit .f.
>			SET SKIP OF BAR 1 OF Tools .f.
>			SET SKIP OF BAR 2 OF Tools .f.
>
>			*!* I want to execute the following form methods in the modeless form that is running		
>			*!*thisform.ImgABC.Visible = .t.
>			*!*thisform.ImgXYZ.Visible = .t.
>		ENDIF
>
>
>
>
>I can execute the code from a form control, but want to also execute it from a menu prompt.
>Thank you very much!
>
>dg

How your menu is defined? Are you running something like do myMenu.mpr where you have different menu items? If yes, the code I posted, should be in the procedure's code for the relevant menu pad or bar.
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform