本文介绍了油漆事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 29岁程序员,3月因学历无情被辞! 我正在创建一个用户控件,它从 UserControl_Paint事件中执行了很多自己的绘制操作,主要使用的是' 传入的e.Graphics对象油漆事件。它工作得很好。 偶尔,油漆事件不会发生。当用户按下Alt键第一个 时间时,这主要发生在具有许多第三方控件的应用程序 中。第一次按键后问题不会发生。我无法确定 来确定问题的来源。 欢迎任何和所有想法,因为我在最后绳子。 谢谢。 解决方案 尝试使用onpaint覆盖。 Michael I am creating a User Control that does a lot of it own painting from theUserControl_Paint event mostly using the e.Graphics object that''spassed into Paint event. It works pretty good.Occasionally, the paint event doesn''t fire. This occurs mostly in appswith many 3rd party controls when the user presses Alt key the firsttime. The problem doesn''t occur after the 1st key press. I can''t seemto nail down where the problem is coming from.Any and all ideas are welcome, as I am at the end of the rope.Thanks. 解决方案Try the onpaint override instead.Michael 这篇关于油漆事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!