How do you make your custom data types property browser browsable when contained in a Control/Component (as a property)

// Your custom data type public class MySize { … public int Width{get{…}set{…}} public int Height{get{…}set{…}} } public class MySizeConverter: ExpandableObjectConverter { public override bool GetCreateInstanceSupported(ITypeDescriptorContext context) { return true; } public override object CreateInstance(ITypeDescriptorContext context, IDictionary propertyValues) { MySize size = new MySize(); size.Width = (int)propertyValues[(object)’Width’]; size.Height = (int)propertyValues[(object)’Height’]; return (object)size; }

How to HitTest a polygonal region

Bool HitTest(PointF[] polygonCorners, PointF mousePosition) { GraphicsPath path = new GraphicsPath(); path.AddLines(polygonCorners); Region region = new Region(path); // Hittest the region to verify if the point is in the rect if(region.IsVisible(mousePosition)) return true; else return false; }