1、WinForm创建自定义控件需要重载Control类的OnResize和OnPaint方法
这个OnResize方法是干什么用的
2、还有下面这个定义是干嘛用的,能说具体一些吗,好像经常要定义这个ValueChange
protected EventHandler OnValueChanged;
public event EventHandler ValueChanged
{
add{
if (OnValueChanged != null){
foreach (Delegate d in OnValueChanged.GetInvocationList()){
if (object.ReferenceEquals(d, value)) { return; }
}
}
OnValueChanged = (EventHandler)Delegate.Combine(OnValueChanged, value);
}
remove {
OnValueChanged = (EventHandler)Delegate.Remove(OnValueChanged, value);
}
}