It seems that if you add an entry to a ContextMenu while it’s open, it’ll turn into a blank, tiny little square.
Like this:

To reproduce, just create a new WinForms application and replace the Form1 class with this:
public partial class Form1 : Form
{
ContextMenu _menu = new ContextMenu();
public Form1()
{
InitializeComponent();
ContextMenu = _menu;
_menu.MenuItems.Add(new MenuItem() { Text = "Test" });
Timer a = new Timer() { Interval = 3000 };
a.Tick += (sender, e) =>
{
_menu.MenuItems.Add(new MenuItem() { Text = "Woah!" });
};
a.Start();
}
}
Then simply launch, right click and wait.
Is it possible to work around this without resorting to using something like ContextMenuStrip?
Use
Showmethod right after addition to workaround the issue:You may also need to track the popup state to avoid unexpected showing. Here is the full source to achieve that: