Contextual popupMenu

The example shows you how to obtain the Contextual Menu in the corresponding event. Note that in there you have access to x and y so you can use RowFromXY() and ColumnFromXY() to decide what you display depending on which cell.

from the Example, maybe it works on RealStudio

ConstructContextualMenu

[code] base.Append(New MenuItem(“Add new row”))

If Me.RowFromXY(x, y) >= 0 Then
base.Append(New MenuItem(“Remove row”))
End If

Return True[/code]

ContextualMenuAction

Select Case hitItem.Text Case "Add new row" Me.AddRow("New row") Case "Remove row" If Me.ListIndex >= 0 Then Me.RemoveRow(Me.ListIndex) End If End Select

Thanks Axel for the example code! I think I got my question wrong though. What I am actually trying to do, is to populate a column in a listbox with popup selections, to choose values from another listbox. Unfortunately there is no CellType for a popup-menu. Nor can I find something in the docs on how to do that. But for example in the xojo properties, this type of popup is excactly used. So how to do that?

There are a few webinars that show you how to do that. Should be either

http://developer.xojo.com/webinar-good-guy-listbox

Or

http://developer.xojo.com/webinar-using-the-listbox

[quote=244504:@Markus Winter]There are a few webinars that show you how to do that. Should be either

http://developer.xojo.com/webinar-good-guy-listbox

Or

http://developer.xojo.com/webinar-using-the-listbox[/quote]
Great, thanks Markus. I am studying the examples right now…