Paint事件处理程序的注意事项

不要将一个对 MessageBox.Show() 的调用放在P aint 事件处理程序中 , 消息框可以覆盖部分客户区,引

发另一个P aint M事件。然后继续引发一个又一个的P aint 事件……而且,不要将任何 Console.Read() 或 Console.ReadLine() 调用放在 Paint 事件或任何事件处理程序中。不过,Co nsole.Write() 或 Console.WriteLine() 调用是安全的。

Published At
Categories with Web编程
Tagged with
comments powered by Disqus