OnResize()中的大小是否已更新?

时间:2013-11-28 20:40:40

标签: c#

我正在编写一个继承自PictureBox的PlotBox控件。每次控件改变其大小时,我都想重绘一下。如果我做那样的事情:

protected override void OnResize(EventArgs e)
{
    base.OnResize(e);
    Replot();        
}
private void Replot()
{
    //logic goes here, for example:
    int width = Size.Width; 
    int height = Size.Height;
}

widthheight变量是否会保留新的控件大小?我还应该考虑其他问题吗?

1 个答案:

答案 0 :(得分:2)

在调用Replot()方法时,大小已经更新。