110,500
社区成员
发帖
与我相关
我的任务
分享
public static Delegate[] GetObjectEventList<T>(T p_Control, string p_EventName)
{
PropertyInfo _PropertyInfo = p_Control.GetType().GetProperty("Events", BindingFlags.Instance | BindingFlags.NonPublic);
if (_PropertyInfo != null)
{
object _EventList = _PropertyInfo.GetValue(p_Control, null);
if (_EventList != null && _EventList is EventHandlerList)
{
EventHandlerList _List = (EventHandlerList)_EventList;
FieldInfo _FieldInfo = (typeof(Control)).GetField(p_EventName, BindingFlags.Static | BindingFlags.NonPublic);
if (_FieldInfo == null) return null;
Delegate _ObjectDelegate = _List[_FieldInfo.GetValue(p_Control)];
if (_ObjectDelegate == null) return null;
return _ObjectDelegate.GetInvocationList();
}
}
return null;
}
namespace System.Windows.Forms
{
// 摘要:
// 表示显示数值的 Windows 数字显示框(也称作 up-down 控件)。
[ComVisible(true)]
[DefaultBindingProperty("Value")]
[SRDescription("DescriptionNumericUpDown")]
[DefaultProperty("Value")]
[DefaultEvent("ValueChanged")]
[ClassInterface(ClassInterfaceType.AutoDispatch)]
public class NumericUpDown : UpDownBase, ISupportInitialize
{
//
// 摘要:
// 在以某种方式更改 System.Windows.Forms.NumericUpDown.Value 属性后发生。
[SRCategory("CatAction")]
[SRDescription("NumericUpDownOnValueChangedDescr")]
public event EventHandler ValueChanged;