请问,只有在表单上才能执行绘制处理程序 [英] Please, is it only on form that a paint handler can be executed

查看:43
本文介绍了请问,只有在表单上才能执行绘制处理程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在windows窗体上绘制了一个图表,我正在考虑将它绘制在除表单本身之外的单独控件上

I drew a graph sheet on a windows form, I'm thinking of drawing it on separate control other than the form itself

推荐答案

你可以处理Paint单个控件上的事件:表单是从控件派生的,并且Paint事件是继承的。



处理面板的油漆等非常常见以便使用它们作为PictureBox的替代品 - 例如 - 你可以处理任何控件的Paint,包括Buttons,TextBoxes等。



你唯一可以做的事情如果要更新它,则在控件上调用Invalidate。
You can handle the Paint event on individual controls: a form is derived from control, and the Paint event is inherited.

It is very common to handle Paint for Panels and so forth to use them as a substitute for the PictureBox for example - but you can handle Paint for any control, including Buttons, TextBoxes and so forth.

The only thing you may have to do is call Invalidate on the control when you want to update it.


这篇关于请问,只有在表单上才能执行绘制处理程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆