[Gambas-user] How to determine if a menu exists?

Bruce bbruen at ...2308...
Tue Jul 10 13:53:07 CEST 2012


On Tue, 2012-07-10 at 13:27 +0200, Benoît Minisini wrote:
> Le 10/07/2012 13:18, Bruce a écrit :
> > I am trying to create a library that adds a set of sub-menus to a
> > specific menu in a form in the client project.  In order to do this
> > there is an obvious requirement that the parent menu exists in the form.
> >
> > The simplest analogy I can come up with here is that it is sort of like
> > a "Recent Files" manager for a File menu (the real use is so arcane as
> > to be unintelligible).
> >
> > So, in the _new() method of the main library class, I need to check that
> > the client form has actually got a menu called, say, "mnuRecentFiles"
> > and proceed accordingly.  For the life I me I cannot work out how to do
> > that.
> >
> > Any clues?
> > Bruce
> >
> 
> IsNull(MyForm.Controls["mnuRecentFiles"])
> 
> (MyForm.Controls.Exist is not possible. Maybe it should...)
> 
Thanks Benoît,
I was trying to use the Form.Menus collection.
Bruce





More information about the User mailing list