I have a Circle and a Line control. Circle control's OnPaint draws a circle and Line control's one draws a line. These two controls are contained in another control (DrawingControl). I need to put a Line over a Circle, but Circle's background deletes the Line. I tried enabling transparency and overriding Circle's OnPaintBackground method, but it doesn't seem to work. Do you have any ideas? Thanks.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Does this tutorial help? It consists of three steps: Enabling transparency, overriding OnPaintBackground and overriding OnMove
回答2:
See this answer about creating a diagonal-line control. This technique does not require using transparency, but instead uses an irregularly-shaped region. Creating a circle control this way would be a little more complicated than the line example, since you'll need to use bezier curves instead of line segments in order to create a smooth circle.