OnPaint代码 [英] OnPaint code

查看:60
本文介绍了OnPaint代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在从常规表格到功能区表格devexpress 9.3的代码更改中遇到问题
以常规形式,我在下面使用代码

I had a problem in the code change from the regular form a ribbon form devexpress 9.3
in the regular form I am using code below

protected override void OnPaint(PaintEventArgs e)
        {
            pictureBox1.Image = RImage;
        }





但是在使用表单功能区之后,上述代码未执行
上面有替代代码吗?

(上面的代码用于将图像更改显示到PictureBox中).





but after using the form ribbon above code is not executed
is there any substitute code above

(above code is used to display the image changes into a PictureBox)

推荐答案

您不需要在Paint事件中执行此操作-PictureBox应该包含Image 属性并根据需要显示其自身.您甚至不需要Invalidate PictureBox-Image 属性设置器应为您执行此操作.

用户决定显示哪张图片时,通常会设置Image属性:尝试删除Rimage变量并引用PictureBox.Image属性.
You don''t need to do that in a Paint event - the PictureBox should hold the Image property and display itself as needed. You don''t even need to Invalidate the PictureBox - the Image property setter should do that for you.

It is normal to set the Image property when the user decides which picture to show: Try removing your Rimage variable and referring to the PictureBox.Image property instead.


基本上,我印象深刻与DevExpress组件一起并成为其常规用户.

OriginalGriff是正确的:您不必处理OnPaint事件.

将表格更改为功能区表格后,您是否介绍了此内容?

对于色带形式,在幕后会进行很多绘画和调整大小的事情,通常效果很好.

尝试调查组件的创建顺序,或将它们移至XtraPanel.

我会尝试在DevExpress论坛上搜索答案,或者将其发布为新问题.它们通常非常宽容和反应灵敏.

问候
Espen Harlinn
Basically I''m fairly impressed with, and a regular user of, the DevExpress comonents.

OriginalGriff is right: you should not have to handle the OnPaint event.

Is this someting you have introduced after altering your form to a ribbon form?

For a ribbon form there is a lot of painting and sizing stuff going on behind the scenes, and it usually works very well.

Try investigating the creation order of your components, or move them to an XtraPanel.

I would try searching the DevExpress forums for an answer, or post it as a new problem. They are usually very acommodating and responsive.

Regards
Espen Harlinn


这篇关于OnPaint代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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