Possible or not: ListBox as PopupMenu datasource?

I would like to use a list of files that are located in a ListBox (multi-column) as a PopupMenu’s datasource. Is this possible, and is this covered anywhere in the user guide?

LB is a ListBox , 0 is the Column number

  for i as integer = 0 to LB.ListCount-1
    PopupMenu1.AddRow LB.Cell(i,0) 
  next

[quote=79138:@Axel Schneider]LB is a ListBox , 0 is the Column number

for i as integer = 0 to LB.ListCount-1 PopupMenu1.AddRow LB.Cell(i,0) next [/quote]

Damn, it’s that easy!?!

It works and thanks for the code! :slight_smile:

If you use the call more than once remember to use:

PopupMenu1.DeleteAllRows

Before the loop otherwise you will add the Listbox items each time.