Your code doesn’t actually check if the properties are Enumerable
types but if they are generic IList’s. Try this:
if(typeof(IEnumerable).IsAssignableFrom(p.PropertyType))
{
System.Windows.Forms.MessageBox.Show(p.Name);
}
Or this
if (p.PropertyType.GetInterfaces().Contains(typeof(IEnumerable)))
{
System.Windows.Forms.MessageBox.Show(p.Name);
}