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

Benoît Minisini gambas at ...1...
Tue Jul 10 13:27:16 CEST 2012


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...)

-- 
Benoît Minisini






More information about the User mailing list