ich benutze eine Listbox mit einem Popupmenü und erhalte seit R4.1 sporadisch diesen Fehler.
Hat jemand eine Idee woher das kommen könnte und was das genau bedeutet?
Hier der Code, ich benutze diese Listbox seit ca 1 jahr unverndert und der Fehler trat erst mit R4.1 auf.
//X and Y will be different if you’re in a Container Control
dim x as integer = me.getcellx(col) + me.left + me.Window.left
dim y as integer = me.getcelly(row) + me.top + me.Window.top
//Create the base menu
dim base as new MenuItem
//Add our array data. Note, you could change the array data for each row if you wanted.
dim s() as string = me.celltag(row,col)
for i as integer = 0 to s.Ubound
base.Append New MenuItem(s(i))
next
//Do the popup
dim hitItem as menuitem = base.PopUp(x, y)
//Raise the event so the user can handle it however they want.
RaiseEvent MenuAction row, col, hititem
[quote]MenuItems in Cocoa
The Cocoa framework does not allow a MenuItem to be used in different places, e.g. several MenuBars. Trying to do so will raise a MenuHasParentException. In order to avoid the hassle of creating several times the same MenuItem, you can use the Clone method to make copies.[/quote]
Versuch mal:
Habe es herausgefunden. Seit R4.1 Klickt man in meine Listbox an eine Stelle, wo noch keine Zeile vorhanden ist, wird diese dort erstellt. Klickt man aber jetzt auf Column mit dem Menü in der Listbox wird das offensichtlich aufgerufen bevor der Listbox die Zeile hinzugefügt wurde.
Das kann ich jetzt lösen, danke!