拖动自定义控件使其宽高随之改变

版权声明:本文为博主原创文章,转载请发邮件到[email protected]授权。 https://blog.csdn.net/qq_33712555/article/details/83057830

拖动自定义控件使其宽高随之改变

首先,UserControl注册SizeChanged事件,然后

/// <summary>
/// 尺寸改变为新值
/// </summary>
private void CurvePnl_SizeChanged(object sender, SizeChangedEventArgs e)
{
    this.Width = e.NewSize.Width;
    this.Height = e.NewSize.Height;
}

猜你喜欢

转载自blog.csdn.net/qq_33712555/article/details/83057830
今日推荐