On Sat, 2012-12-01 at 01:13 +0100, Willy Raets wrote:
> I have this piece of code (in a rather big project) that build op a menu
> during run time in case AddOns get installed. Each installed AddOn gets
> it own Menu Item upon installation for launching the AddOn. THis all
> works like clockwork.
> 
> This is the code that creates the menu items for each Add On installed:
> 
> For iNdex = 1 To AddOnNumber
>   hMenuItem = New Menu(hMenu) As "_MenuEvent"
>   With hMenuItem
>     .Name = "mnu" & AddOnName[iNdex]
>     .Enabled = True
>     .Caption = AddOnName[iNdex]
>     .Text = AddOnName[iNdex] & "..."
>     .Picture = Picture.Load(AddOnPath & "/" & AddOnName[iNdex] & ".png")
>   End With
> Next
> 
> Now I write code to remove the installed AddOns if users want to.
> Removing is no problem and works well.
> 
> Only problem that remains is how to remove the menu item that starts the
> AddOn during run time?
> 
> In my Subroutine Remove() the name of the AddOn menu item to be removed
> is: "mnu" & AvailableName[Index]
> 
> AvailableName[Index] is the name of the AddOn that has been removed a
> few lines of code before.
> 
> How do I remove this menu item? Any suggestions?
> 
> Thanks,
> 
> Willy
> 

(Quick answer)
You could just set its' .Visible to false

B



------------------------------------------------------------------------------
Keep yourself connected to Go Parallel: 
INSIGHTS What's next for parallel hardware, programming and related areas?
Interviews and blogs by thought leaders keep you ahead of the curve.
http://goparallel.sourceforge.net
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to