Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Add open form instance (or window) to menu?
Message
General information
Forum:
Visual FoxPro
Category:
Menus & Menu designer
Miscellaneous
Thread ID:
00696111
Message ID:
00696126
Views:
13
>Several years ago I remember a DevCon demo where open instances of a form (or open windows) were added to the app's menu -- like most Windows apps do when items are opened. Can someone offer hints as to how this is done? I've experimented with redefining the menu pad and all of its bars on the fly, but I seem to remember that the solution demonstrated was more elegant than that. In this case, the form's caption includes a job number that should become the menu prompt. The prompt will need to change when the job data is requeried. Also, there can be multiple instances of the form.

Lynda,
In my form base class I call the method AddToMenu
*-- Add the form's caption to the Window menu popup
local lnBar, lcCaption, lcFormName

lcCaption = ThisForm.Caption
if popup("Window")
	*-- Find the next available bar number.
	if cntbar("Window") = 0 or ;
		getbar("Window", cntbar("Window")) < 0
		lnBar = cntbar("Window") + 1
	else
		lnBar = getbar("Window", cntbar("Window")) + 1
	endif

	define bar lnBar of Window prompt lcCaption
	lcFormName = '"'+ThisForm.Name+'"'
	on selection bar lnBar of Window ActivateIt(&lcFormName)
ENDIF
Then reverse the process to remove it.
HTH
Caroline
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform