问题描述
大家好,
我可以在自定义用户控件中使用 override void OnPaintBackground
吗?我在自定义用户控件中使用此方法的目的是因为我将在绘图区域中将基线(网格)绘制为图像在初始状态,但是此后,当我在其上画线时,我不想再次重新绘制背景(图像).因此,我需要重写OnPaintBackground方法并将其禁用以实现我的目的.我可以在Component中完成,但是如何在自定义用户控件中完成?[confused]
欢迎任何提示.
问候
cocoonwls
Hi all,
Can i use override void OnPaintBackground
in custom user control?My purpose to use this method in custom user control is because i will draw the base line (grid) as image in the drawing area at the initiate state, but after that, i don''t want to repaint again the background(image) when i draw some line on it. Thus, i need to override the OnPaintBackground method and disable it to fulfill my purpose. I can done it in Component,but how about in custom user control?[confused]
Any tips are welcome.
regards
cocoonwls
推荐答案
这篇关于组件和用户控件中的C#:OnPaintBackground的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!