i我需要用一个额外的Event扩展usercontrol类。 所以我决定创建自己的用户控件
public partial class Custom_User_Control : Control
{
public Custom_User_Control()
{
InitializeComponent();
}
protected override void OnPaint(PaintEventArgs pe)
{
base.OnPaint(pe);
}
public event EventHandler<bool> finnished;
#region protected members
/// <summary>
/// Calls the finnish event
/// </summary>
/// <param name="success">True if successfull</param>
protected void On_Finnished(bool success)
{
finnished?.Invoke(this, success);
}
#endregion
}
但是当我尝试创建新的custom_control实例
public partial class My_First_Custom_User_control_Object: Custom_User_Control
{
}
设计师告诉我
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
未定义AutoscaleMode。为什么此属性不是从用户控件派生的?