コード例 #1
0
        private static void DetachValueChangedEvent(this DateTimePicker ctrl)
        {
            var eventHandler = ctrl.GetEventHandler(ValueChangedEventName);

            if (eventHandler != null)
            {
                foreach (EventHandler item in eventHandler.GetInvocationList())
                {
                    ctrl.ValueChanged -= item;
                }
                AddEventHandlerList(ctrl, ValueChangedEventName, eventHandler);
            }
        }