DevExpress 按钮设置背景图片的时出现了一点问题

_XuDaojie 2014-04-21 06:16:56

我想让simplebutton上显示这张图片,上面是我实现的,但是当鼠标移动到这张图片时,按钮样式又会变成下面这样,也就是说图片没了


this.simpleButton1.Appearance.BackColor = System.Drawing.Color.Transparent;
this.simpleButton1.Appearance.Options.UseBackColor = true;
this.simpleButton1.BackgroundImage = ((System.Drawing.Image)(resources.GetObject("simpleButton1.BackgroundImage")));
this.simpleButton1.BackgroundImageLayout = System.Windows.Forms.ImageLayout.Zoom;
this.simpleButton1.ButtonStyle = DevExpress.XtraEditors.Controls.BorderStyles.UltraFlat;
this.simpleButton1.Location = new System.Drawing.Point(45, 6);
this.simpleButton1.LookAndFeel.Style = DevExpress.LookAndFeel.LookAndFeelStyle.UltraFlat;
this.simpleButton1.LookAndFeel.UseDefaultLookAndFeel = false;
this.simpleButton1.Name = "simpleButton1";
this.simpleButton1.Size = new System.Drawing.Size(218, 120);
this.simpleButton1.TabIndex = 0;
this.simpleButton1.Text = "生产相关";

我记得WinForm的Button是有个可以设置获得焦点后的按钮样式的,但是在SimpleButton里都没找到
...全文
539 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
_XuDaojie 2014-04-25
  • 打赏
  • 举报
回复
引用 3 楼 duanzi_peng 的回复:
[quote=引用 2 楼 duanzi_peng 的回复:] 好像还不支持BackgroundImage; https://community.devexpress.com/forums/t/5791.aspx
用普通的按钮可以。[/quote]后来我就是用的winform的按钮
exception92 2014-04-22
  • 打赏
  • 举报
回复
引用 2 楼 duanzi_peng 的回复:
好像还不支持BackgroundImage; https://community.devexpress.com/forums/t/5791.aspx
用普通的按钮可以。
exception92 2014-04-22
  • 打赏
  • 举报
回复
好像还不支持BackgroundImage; https://community.devexpress.com/forums/t/5791.aspx
u013347644 2014-04-21
  • 打赏
  • 举报
回复
用按钮的mouseenter和mouseleave事件来控制呢?

8,834

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 组件/控件开发
社区管理员
  • 组件/控件开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧