| 20/02/06 ~ 15:47 -0700 : | Joseph J. Strout, | " Re: ConstructContextualMenu "
Right, but that's a pop-up menu, not a contextual menu. Just trying to get the terminology straight.
I might not be very strict with my vocabulary, I am sorry...
Anyway, since you've done this, maybe you can show Chuck how it's done -- he seems to be having difficulty with it.
Whenever you want the cont'menu to appear, just call Contextualmenu.Open, whatever the chunk of code you are in (with or without the IsCMMClick boolean).
The LangRef shows how to build a Contextualmenu in its Open event (RB5.5.5), but you can build it in another chunk of code with the Contextualmenu.DeleteAllRows and Contextualmenu.AddRow methods. I have told a canvas.MouseDown event build a Contextualmenu according to the canvas state and content, then open this Contextualmenu.
I do this in MouseDown events, in CellClick events, I even have a Contextualmenu opened by a Timer (with mode=1), just to let the rest of the event code run before opening the menu. This example is from a window having four Contextualmenus and seventeen Timers among 108 controls, and it runs nicely...
_______________________________________________ Unsubscribe or switch delivery mode: <http://www.realsoftware.com/support/listmanager/> Search the archives of this list here: <http://support.realsoftware.com/listarchives/lists.html>
