On Sun, 2012-10-07 at 10:13 +0200, Fabien Bodard wrote:
> >> > >
> >> > > Public Sub _MenuEvent_Click()
> >> > >
> >> > >   Dim iX, iLength As Integer
> >> > >   Dim AddOnToRun As String
> >> >
> >> > When this is run, hMenuItem will be the last item you added, therefore
> >> > no matter how many Add-Ins you load only the last one will be run.
> >> > So you would need to find the menu item that was clicked and set
> >> > hMenuItem to that.
> >> >
> >> > >   iLength = Len(hMenuItem.Caption)
> >> > >   AddOnToRun = Left$(hMenuItem.Caption, (iLength - 3))
> >> > >   AddOnToRun = AddOnToRun & ".gambas"
> >> > >   Message(AddOnToRun)
> >> > >   AddOns.Run(AddOnToRun)
> >> > >
> >> > > End
> >>
> >> Couldn't you use 'Last' instead of hMenuItem in _MenuEvent_Click()?
> >>
Bruce, Tobian and Fabien,

Replaced hMenuItem with Last in event and all works well now

Public Sub _MenuEvent_Click()
  
  Dim iX, iLength As Integer
  Dim AddOnToRun As String
  iLength = Len(Last.Caption)
  AddOnToRun = Left$(Last.Caption, (iLength - 3))
  AddOnToRun = AddOnToRun & ".gambas"
  AddOns.Run(AddOnToRun)
  
End

Thanks you all very much,

Willy



------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Gambas-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to