Thanks for flagging this. Separators in PopupMenu are now in and will ship in the next release: https://feedback.objo.dev/feature/904
Rather than PopupMenu.AddItem(New MenuSeparator), I went with a dedicated method:
Var menu As New PopupMenu
menu.AddRow("Small")
menu.AddSeparator()
menu.AddRow("Large")
A separator is treated as a special popup row rather than a menu object, so it slots into the existing row model cleanly:
- It occupies an index and counts toward
RowCount.
RowTextAt returns an empty string at that index, and RowTag returns Nothing.
SetRowTag on a separator is a no-op.
- It can't be selected by mouse, keyboard,
SelectedRowIndex, or SelectRowWithText / SelectRowWithTag — assigning its index to SelectedRowIndex preserves the current selection and doesn't fire SelectionChanged.
RemoveRow and RemoveAllRows remove separators like any other row.
I kept the Menu / ContextMenu / MenuSeparator APIs as they are, since a popup's separator is a row in a dropdown rather than a command-menu item.