I have a .net form that is created in Excel (I don't know if that's relevant), and when I call form.Hide()
, Excel flickers briefly. If I instead call form.Close()
, the flicker is absent.
我有一个在Excel中创建的.net表单(我不知道这是否相关),当我调用form.Hide()时,Excel会短暂闪烁。如果我改为调用form.Close(),则闪烁不存在。
Why does the Hide()
version cause flicker, while the Close()
version not?
为什么Hide()版本会导致闪烁,而Close()版本不会?
1 个解决方案
#1
I imagine it is because Hide() is forced to redraw the window with it hidden and Close() terminates the process, which I believe is handled by the OS instead of .NET in the case of Hide()
我想是因为Hide()被强制重绘窗口隐藏它而Close()终止进程,我相信在Hide()的情况下由OS而不是.NET处理
#1
I imagine it is because Hide() is forced to redraw the window with it hidden and Close() terminates the process, which I believe is handled by the OS instead of .NET in the case of Hide()
我想是因为Hide()被强制重绘窗口隐藏它而Close()终止进程,我相信在Hide()的情况下由OS而不是.NET处理