要实现该功能,就必须重写系统的Onlayout事件函数。当窗体大小变化时,系统会自动触发该事件函数。
protected override void OnLayout(LayoutEventArgs levent)
{
//获取窗体工作区的长宽
var width = this.ClientSize.Width;
var height = this.ClientSize
要实现该功能,就必须重写系统的Onlayout事件函数。当窗体大小变化时,系统会自动触发该事件函数。
protected override void OnLayout(LayoutEventArgs levent)
{
//获取窗体工作区的长宽
var width = this.ClientSize.Width;
var height = this.ClientSize