gpt4 book ai didi

c# - Winforms - ResizeEnd 在调整窗体大小时未被调用

转载 作者:太空狗 更新时间:2023-10-29 22:09:41 24 4
gpt4 key购买 nike

我想在调整表单大小后运行一些代码。但是,当我调整大小时,以下代码永远不会运行。我确定这是我看过的简单内容(我是 C# 和一般编程的新手)。谢谢。

    private void CalibrationForm_ResizeEnd(object sender, EventArgs e)
{
MessageBox.Show("You are in the Form.ResizeEnd event.");
}

最佳答案

你似乎没有 Hook 事件,甚至在属性中 Hook 它(右键单击表单然后属性并选择图片中的事件)

enter image description here

或者在构造函数中hook事件如下:

YourForm.ResizedEnd +=new EventHandler(CalibrationForm_Resize);

关于c# - Winforms - ResizeEnd 在调整窗体大小时未被调用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7959355/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com