public static void Shift <T>(this Control.ControlCollection source, T from, T to, Func <T, bool> isItemMovable, Action <int, int> fromIndexToIndexAction = null, Action <T, T> fromToAction = null) where T : Control { var fromIndex = source.IndexOf(from); var toIndex = source.IndexOf(to); source.Shift(fromIndex, toIndex, isItemMovable, fromIndexToIndexAction, fromToAction); }