public static int? GetValue(PCCPackage p, int index) { Objectselect prompt = new Objectselect(); prompt.Init(p, index); return prompt.ShowDialog() == DialogResult.OK ? prompt.returnValue() : null; } }